descriptors: use new pat/pmt classes;

use CServiceScan API to get frontend;


Origin commit data
------------------
Branch: ni/coolstream
Commit: 985a14dfc0
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-01-13 (Fri, 13 Jan 2012)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-01-13 16:05:30 +04:00
parent 796ead5b28
commit f444cf9c7b

View File

@@ -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;
}