From a3770b2e69c00d751c625212ac233188c8479b28 Mon Sep 17 00:00:00 2001 From: max_10 Date: Sat, 28 Oct 2017 22:29:12 +0200 Subject: [PATCH 1/2] libdvbci: log cosmetic Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f6ecb88ba0b259039e36b88f4691bce0b690886e Author: max_10 Date: 2017-10-28 (Sat, 28 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- common/ca_ci.cpp | 2 +- libdvbci/dvbci_appmgr.cpp | 6 +++--- libdvbci/dvbci_session.cpp | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index 165f13d..8ea87a9 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -863,7 +863,7 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char * cabuf, if ((*It)->multi && (*It)->TP == TP && (*It)->source == source && !sid_found && (*It)->ci_use_count < CI_MAX_MULTI) { int pos = 3; - + (*It)->SID[(*It)->ci_use_count] = SID; (*It)->ci_use_count++; diff --git a/libdvbci/dvbci_appmgr.cpp b/libdvbci/dvbci_appmgr.cpp index de95912..1e69bfa 100644 --- a/libdvbci/dvbci_appmgr.cpp +++ b/libdvbci/dvbci_appmgr.cpp @@ -82,11 +82,11 @@ int eDVBCIApplicationManagerSession::doAction() return 1; } case stateFinal: - printf("[CI AM] in final state."); + printf("[CI AM] in final state.\n"); wantmenu = 0; if (wantmenu) { - printf("[CI AM] wantmenu: sending Tenter_menu"); + printf("[CI AM] wantmenu: sending Tenter_menu\n"); const unsigned char tag[3] = {0x9F, 0x80, 0x22}; // Tenter_menu sendAPDU(tag); wantmenu = 0; @@ -101,7 +101,7 @@ int eDVBCIApplicationManagerSession::doAction() int eDVBCIApplicationManagerSession::startMMI() { - printf("[CI AM] in appmanager -> startmmi()"); + printf("[CI AM] in appmanager -> startmmi()\n"); const unsigned char tag[3] = {0x9F, 0x80, 0x22}; // Tenter_menu sendAPDU(tag); slot->mmiOpened = true; diff --git a/libdvbci/dvbci_session.cpp b/libdvbci/dvbci_session.cpp index eee71b9..7618526 100644 --- a/libdvbci/dvbci_session.cpp +++ b/libdvbci/dvbci_session.cpp @@ -36,7 +36,7 @@ int eDVBCISession::buildLengthField(unsigned char *pkt, int len) } else { - printf("too big length\n"); + printf("[CI SESS] too big length\n"); exit(0); } } @@ -97,7 +97,7 @@ void eDVBCISession::sendOpenSessionResponse(eDVBCISlot *slot, unsigned char sess { char pkt[6]; pkt[0] = session_status; - printf("[CI SESS] sendOpenSessionResponse"); + printf("[CI SESS] sendOpenSessionResponse\n"); memcpy(pkt + 1, resource_identifier, 4); sendSPDU(slot, 0x92, pkt, 5, session_nb); } @@ -148,7 +148,7 @@ eDVBCISession* eDVBCISession::createSession(eDVBCISlot *slot, const unsigned cha tag |= resource_identifier[2] << 8; tag |= resource_identifier[3]; - printf("[CI SESS] Tag: %08lx > ", tag); + printf("[CI SESS] Tag: %08lx >\n", tag); switch (tag) { @@ -211,7 +211,7 @@ eDVBCISession* eDVBCISession::createSession(eDVBCISlot *slot, const unsigned cha void eDVBCISession::handleClose() { - printf("%s\n", __FUNCTION__); + printf("[CI SESS] %s\n", __FUNCTION__); unsigned char data[1] = {0x00}; sendSPDU(0x96, data, 1, 0, 0); @@ -253,13 +253,13 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size unsigned char tag = *pkt++; int llen, hlen; - printf("[CI SESS] slot: %p",slot); + printf("[CI SESS] receiveData slot: %p > ",slot); #if 0 for(unsigned int i = 0; i < len; i++) printf("%02x ", ptr[i]); - printf("\n"); #endif + printf("\n"); llen = parseLengthField(pkt, hlen); pkt += llen; @@ -307,7 +307,7 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size session->recvCreateSessionResponse(pkt); break; case 0x95: - printf("[CI SESS] recvCloseSessionRequest"); + printf("[CI SESS] recvCloseSessionRequest\n"); session->recvCloseSessionRequest(pkt); break; default: From f2f1c0b16eb9daea8c5dd32ce960fda117074dd7 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 30 Oct 2017 21:00:23 +0100 Subject: [PATCH 2/2] gstreamer: fix lang detection Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5ef8f2edade642b6860b02494d19b6af6241c2ef Author: TangoCash Date: 2017-10-30 (Mon, 30 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/Makefile.am | 3 ++- libarmbox/playback_gst.cpp | 45 ++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/libarmbox/Makefile.am b/libarmbox/Makefile.am index 0c1a721..ee99e6a 100644 --- a/libarmbox/Makefile.am +++ b/libarmbox/Makefile.am @@ -14,7 +14,8 @@ AM_LDFLAGS = \ @AVCODEC_LIBS@ \ @SWRESAMPLE_LIBS@ \ -lpthread -lasound -lrt \ - -lgstreamer-1.0 + -lgstreamer-1.0 \ + -lgsttag-1.0 libarmbox_la_SOURCES = \ hardware_caps.c \ diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 5a815bc..390ffc5 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -49,6 +49,7 @@ extern cDemux * audioDemux; extern cDemux * videoDemux; #include +#include #include typedef enum @@ -839,15 +840,16 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu if(m_gst_playbin) { gint i, n_audio = 0; - //GstStructure * structure = NULL; // get audio g_object_get (m_gst_playbin, "n-audio", &n_audio, NULL); - printf("%s: %d audio\n", __FUNCTION__, n_audio); + lt_info("%s: %d audio\n", __FUNCTION__, n_audio); if(n_audio == 0) return; + language->clear(); + for (i = 0; i < n_audio; i++) { // apids @@ -855,16 +857,17 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu GstPad * pad = 0; g_signal_emit_by_name (m_gst_playbin, "get-audio-pad", i, &pad); + GstCaps * caps = gst_pad_get_current_caps(pad); + gst_object_unref(pad); + if (!caps) continue; GstStructure * structure = gst_caps_get_structure(caps, 0); - //const gchar *g_type = gst_structure_get_name(structure); - - //if (!structure) - //return atUnknown; - //ac3flags[0] = 0; + GstTagList * tags = NULL; + gchar * g_lang = NULL; + gchar * g_codec = NULL; // ac3flags if ( gst_structure_has_name (structure, "audio/mpeg")) @@ -872,23 +875,11 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu gint mpegversion, layer = -1; if (!gst_structure_get_int (structure, "mpegversion", &mpegversion)) - //return atUnknown; ac3flags[i] = 0; switch (mpegversion) { case 1: - /* - { - gst_structure_get_int (structure, "layer", &layer); - if ( layer == 3 ) - return atMP3; - else - return atMPEG; - ac3flags[0] = 4; - break; - } - */ ac3flags[i] = 4; case 2: //return atAAC; @@ -912,9 +903,21 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu ac3flags[i] = 0; gst_caps_unref(caps); - } - // numpids + //(ac3flags[i] > 2) ? ac3flags[i] = 1 : ac3flags[i] = 0; + + g_signal_emit_by_name (m_gst_playbin, "get-audio-tags", i, &tags); + if (tags && GST_IS_TAG_LIST(tags)) + { + 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(); + lt_info("%s: language:%s\n", __FUNCTION__, language[i].c_str()); + g_free(g_lang); + } + gst_tag_list_free(tags); + } + } *numpida=i; } }