mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
Merge branch 'master' of https://github.com/TangoCash/libstb-hal-cst-next.git into mpx
update version 1.0.1 Conflicts: include/hardware_caps.h libarmbox/hardware_caps.c libduckbox/hardware_caps.c libspark/hardware_caps.c
This commit is contained in:
@@ -40,7 +40,7 @@ inline void cs_api_exit()
|
||||
#define cs_free_uncached free
|
||||
|
||||
// Callback function helpers
|
||||
static inline void cs_register_messenger(cs_messenger) { return; };
|
||||
void cs_register_messenger(cs_messenger messenger);
|
||||
static inline void cs_deregister_messenger(void) { return; };
|
||||
//cs_messenger cs_get_messenger(void);
|
||||
|
||||
|
@@ -29,12 +29,11 @@ hw_caps_t *get_hwcaps(void)
|
||||
memset(&caps, 0, sizeof(hw_caps_t));
|
||||
|
||||
initialized = 1;
|
||||
caps.has_CI = 0;
|
||||
caps.has_CI = 1;
|
||||
caps.can_cec = 1;
|
||||
caps.can_shutdown = 1;
|
||||
caps.display_xres = 16;
|
||||
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
||||
caps.display_can_deepstandby = 0;
|
||||
caps.display_can_set_brightness = 1;
|
||||
caps.has_HDMI = 1;
|
||||
strcpy(caps.boxvendor, "AX-Technologies");
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include <pthread.h>
|
||||
#include <syscall.h>
|
||||
|
||||
#include "dmx_lib.h"
|
||||
#include "audio_lib.h"
|
||||
#include "video_lib.h"
|
||||
|
||||
@@ -42,11 +41,9 @@
|
||||
#define lt_debug_c(args...) _lt_debug(HAL_DEBUG_PLAYBACK, NULL, args)
|
||||
#define lt_info_c(args...) _lt_info(HAL_DEBUG_PLAYBACK, NULL, args)
|
||||
|
||||
static const char * FILENAME = "[playback.cpp]";
|
||||
static const char * FILENAME = "[playback_gst.cpp]";
|
||||
extern cVideo * videoDecoder;
|
||||
extern cAudio * audioDecoder;
|
||||
extern cDemux * audioDemux;
|
||||
extern cDemux * videoDemux;
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/tag/tag.h>
|
||||
@@ -111,7 +108,7 @@ void processMpegTsSection(GstMpegtsSection* section)
|
||||
}
|
||||
}
|
||||
|
||||
void playbinNotifySource(GObject *object, GParamSpec *unused, gpointer user_data)
|
||||
void playbinNotifySource(GObject *object, GParamSpec *param_spec, gpointer user_data)
|
||||
{
|
||||
GstElement *source = NULL;
|
||||
cPlayback *_this = (cPlayback*)user_data;
|
||||
@@ -189,7 +186,7 @@ void playbinNotifySource(GObject *object, GParamSpec *unused, gpointer user_data
|
||||
}
|
||||
}
|
||||
|
||||
GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
{
|
||||
gchar * sourceName;
|
||||
|
||||
@@ -672,13 +669,19 @@ bool cPlayback::SetAPid(int pid, bool /*ac3*/)
|
||||
{
|
||||
lt_info("%s: pid %i\n", __func__, pid);
|
||||
|
||||
int current_audio;
|
||||
int to_audio = pid;
|
||||
|
||||
if(pid != mAudioStream)
|
||||
for (unsigned int i = 0; i < REC_MAX_APIDS; i++) {
|
||||
if (real_apids[i])
|
||||
if (real_apids[i] == pid)
|
||||
to_audio = i;
|
||||
}
|
||||
|
||||
if(to_audio != mAudioStream)
|
||||
{
|
||||
g_object_set (G_OBJECT (m_gst_playbin), "current-audio", pid, NULL);
|
||||
printf("%s: switched to audio stream %i\n", __FUNCTION__, pid);
|
||||
mAudioStream = pid;
|
||||
g_object_set (G_OBJECT (m_gst_playbin), "current-audio", to_audio, NULL);
|
||||
printf("%s: switched to audio stream %i\n", __FUNCTION__, to_audio);
|
||||
mAudioStream = to_audio;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -901,12 +904,11 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu
|
||||
GstStructure * structure = gst_caps_get_structure(caps, 0);
|
||||
GstTagList * tags = NULL;
|
||||
gchar * g_lang = NULL;
|
||||
gchar * g_codec = NULL;
|
||||
|
||||
// ac3flags
|
||||
if ( gst_structure_has_name (structure, "audio/mpeg"))
|
||||
{
|
||||
gint mpegversion, layer = -1;
|
||||
gint mpegversion;
|
||||
|
||||
if (!gst_structure_get_int (structure, "mpegversion", &mpegversion))
|
||||
ac3flags[i] = 0;
|
||||
@@ -945,7 +947,15 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu
|
||||
{
|
||||
if (gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &g_lang))
|
||||
{
|
||||
language[i] = std::string(gst_tag_get_language_name(g_lang)).c_str();
|
||||
std::string slang;
|
||||
if (gst_tag_check_language_code(g_lang))
|
||||
slang = gst_tag_get_language_name(g_lang);
|
||||
else
|
||||
slang = g_lang;
|
||||
if (slang.empty())
|
||||
language[i] = "unk";
|
||||
else
|
||||
language[i] = slang.c_str();
|
||||
lt_info("%s: language:%s\n", __FUNCTION__, language[i].c_str());
|
||||
g_free(g_lang);
|
||||
}
|
||||
@@ -1090,7 +1100,7 @@ int cPlayback::GetAPid(void)
|
||||
gint current_audio = 0;
|
||||
g_object_get (m_gst_playbin, "current-audio", ¤t_audio, NULL);
|
||||
lt_info("%s: %d audio\n", __FUNCTION__, current_audio);
|
||||
return current_audio;
|
||||
return real_apids[current_audio] ? real_apids[current_audio] : current_audio;
|
||||
}
|
||||
|
||||
int cPlayback::GetVPid(void)
|
||||
|
@@ -994,8 +994,10 @@ void cVideo::SetCECState(bool state)
|
||||
usleep(10000);
|
||||
message.address = 0x0f; /* broadcast */
|
||||
message.data[0] = CEC_MSG_ACTIVE_SOURCE;
|
||||
message.data[1] = ((((int)physicalAddress >> 12) & 0xf) << 4) + (((int)physicalAddress >> 8) & 0xf);
|
||||
message.data[2] = ((((int)physicalAddress >> 4) & 0xf) << 4) + (((int)physicalAddress >> 0) & 0xf);
|
||||
//message.data[1] = ((((int)physicalAddress >> 12) & 0xf) << 4) + (((int)physicalAddress >> 8) & 0xf);
|
||||
//message.data[2] = ((((int)physicalAddress >> 4) & 0xf) << 4) + (((int)physicalAddress >> 0) & 0xf);
|
||||
message.data[1] = physicalAddress[0];
|
||||
message.data[2] = physicalAddress[1];
|
||||
message.length = 3;
|
||||
SendCECMessage(message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user