From f444cf9c7bf0c9a33e647a9342e24c91004983ca Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 13 Jan 2012 16:05:30 +0400 Subject: [PATCH] descriptors: use new pat/pmt classes; use CServiceScan API to get frontend; Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/985a14dfc0edfcee318ae4f9ab7a176434a1bc7c Author: [CST] Focus Date: 2012-01-13 (Fri, 13 Jan 2012) ------------------ This commit was generated by Migit --- src/zapit/src/descriptors.cpp | 38 ++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/zapit/src/descriptors.cpp b/src/zapit/src/descriptors.cpp index dc43bc83b..e198da888 100644 --- a/src/zapit/src/descriptors.cpp +++ b/src/zapit/src/descriptors.cpp @@ -251,7 +251,8 @@ int satellite_delivery_system_descriptor(const unsigned char * const buffer, t_t transponder_id_t TsidOnid; int modulationSystem, modulationType, rollOff, fec_inner; - if (CFrontend::getInstance()->getInfo()->type != FE_QPSK) + CFrontend * frontend = CServiceScan::getInstance()->GetFrontend(); + if (frontend->getInfo()->type != FE_QPSK) return -1; feparams.frequency = @@ -315,7 +316,8 @@ int satellite_delivery_system_descriptor(const unsigned char * const buffer, t_t int cable_delivery_system_descriptor(const unsigned char * const buffer, t_transport_stream_id transport_stream_id, t_original_network_id original_network_id, t_satellite_position satellitePosition, freq_id_t freq) { transponder_id_t TsidOnid; - if (CFrontend::getInstance()->getInfo()->type != FE_QAM) + CFrontend * frontend = CServiceScan::getInstance()->GetFrontend(); + if (frontend->getInfo()->type != FE_QAM) return -1; FrontendParameters feparams; @@ -442,6 +444,9 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s CZapitChannel *channel = NULL; bool tpchange = false; static transponder_id_t last_tpid = 0; + + static CPat pat; + //scrambled if(free_ca && scan_fta_flag){ return; @@ -624,7 +629,8 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s CZapitBouquet* bouquet; int bouquetId; char pname[100]; - if (CFrontend::getInstance()->getInfo()->type == FE_QPSK) + CFrontend * frontend = CServiceScan::getInstance()->GetFrontend(); + if (frontend->getInfo()->type == FE_QPSK) snprintf(pname, 100, "[%c%03d.%d] %s", satellitePosition > 0? 'E' : 'W', abs(satellitePosition)/10, abs(satellitePosition)%10, providerName.c_str()); else snprintf(pname, 100, "%s", providerName.c_str()); @@ -654,10 +660,14 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s break; } if(CZapit::getInstance()->scanPids()) { - if(tpchange) - parse_pat(); + if(tpchange) { + //parse_pat(); + pat.Reset(); + pat.Parse(); + } channel->resetPids(); +#if 0 if(!pat_get_pmt_pid(channel)) { if(!parse_pmt(channel)) { //if(channel->getPreAudioPid() == 0 && channel->getVideoPid() == 0) @@ -667,6 +677,15 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s } } } +#endif + if(pat.Parse(channel)) { + CPmt pmt; + if(!pmt.parse_pmt(channel)) { + if ((channel->getPreAudioPid() != 0) || (channel->getVideoPid() != 0)) { + channel->setPidsFlag(); + } + } + } } if(service_type == ST_DIGITAL_TELEVISION_SERVICE && !channel->scrambled) { CZapit::getInstance()->SetCurrentChannelID(channel->getChannelID()); @@ -851,11 +870,12 @@ void subtitling_descriptor(const unsigned char * const) /* 0x5A */ int terrestrial_delivery_system_descriptor(const unsigned char * const) { - if (CFrontend::getInstance()->getInfo()->type != FE_OFDM) - return -1; - /* TODO */ - +#if 0 + CFrontend * frontend = CServiceScan::getInstance()->GetFrontend(); + if (frontend->getInfo()->type != FE_OFDM) + return -1; +#endif return 0; }