diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 230039c9e..b7ce67e64 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2400,6 +2400,11 @@ timing.numericzap Umschalten mit Zifferntasten timing.popup_messages Popup Meldungen timing.static_messages Interaktive Meldungen timing.volumebar Lautstärkeanzeige +tunersetup.cable Kabel (DVB-C) +tunersetup.hybrid Hybrid (DVB-C/T/T2) +tunersetup.mode Betriebsmodus +tunersetup.power 5V Versorgung bei DVB-T/T2 Kanälen +tunersetup.terr Terrestrisch (DVB-T/T2) tmdb.api_key TMDb API Schlüssel tmdb.enabled TMDb-Unterstützung tmdb.read_data Suche TMDb-Daten ... diff --git a/data/locale/english.locale b/data/locale/english.locale index c224a6128..a37f2ba6f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2400,6 +2400,11 @@ timing.numericzap Numeric Zap timing.popup_messages Popup messages timing.static_messages Interactive messages timing.volumebar Volume bar +tunersetup.cable Cable (DVB-C) +tunersetup.hybrid Hybrid (DVB-C/T/T2) +tunersetup.mode Operation Mode +tunersetup.power 5V Supply on DVB-T/T2 Channels +tunersetup.terr Terrestrial (DVB-T/T2) tmdb.api_key TMDb API key tmdb.enabled TMDb support tmdb.read_data Search TMDb data ... diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 1cef717e7..373b6dbac 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -341,6 +341,14 @@ const CMenuOptionChooser::keyval SATSETUP_FRONTEND_MODE[SATSETUP_FRONTEND_MODE_C { CFrontend::FE_MODE_LINK_TWIN, LOCALE_SATSETUP_FE_MODE_LINK_TWIN }, }; +#define FRONTEND_FORCE_MODE_COUNT 3 +const CMenuOptionChooser::keyval FRONTEND_FORCE_MODE[FRONTEND_FORCE_MODE_COUNT] = +{ + { 0, LOCALE_TUNERSETUP_HYBRID }, + { 1, LOCALE_TUNERSETUP_CABLE }, + { 2, LOCALE_TUNERSETUP_TERR } +}; + CScanSetup::CScanSetup(int wizard_mode) { width = 40; @@ -359,6 +367,7 @@ CScanSetup::CScanSetup(int wizard_mode) linkfe = NULL; in_menu = false; allow_start = true; + tsp = NULL; if (CFEManager::getInstance()->haveCable()) nid = new CIntInput(LOCALE_SATSETUP_CABLE_NID, (int*) &scansettings.cable_nid, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); } @@ -952,6 +961,19 @@ int CScanSetup::showFrontendSetup(int number) setupMenu->addItem(mc); msettings.Clear(); + + if (fe->hasCable() && fe->hasTerr()) { + mc = new CMenuOptionChooser(LOCALE_TUNERSETUP_MODE, (int *)&fe_config.force_mode, FRONTEND_FORCE_MODE, FRONTEND_FORCE_MODE_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE); + setupMenu->addItem(mc); + } + + if (fe->hasTerr()) { + tsp = new CMenuOptionChooser(LOCALE_TUNERSETUP_POWER, (int *)&fe_config.powered, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, fe_config.force_mode != 1, this); + tsp->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE); + setupMenu->addItem(tsp); + } + if (fe->hasSat()) { /* disable all but mode option for linked frontends */ bool allow_moptions = !CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED; @@ -1890,6 +1912,16 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* printf("[neutrino] CScanSetup::%s: logical numbers %d\n", __FUNCTION__, scansettings.scan_logical_numbers); lcnhd->setActive(scansettings.scan_logical_numbers); } + else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_TUNERSETUP_MODE)) { + CFrontend * fe = CFEManager::getInstance()->getFE(fenumber); + frontend_config_t & fe_config = fe->getConfig(); + if (fe->hasCable() && fe->hasTerr()) + fe->forceDelSys(fe_config.force_mode); + if (fe_config.force_mode == 1) + fe_config.powered = 0; + tsp->setActive(fe_config.force_mode != 1); + ret = menu_return::RETURN_EXIT_REPAINT; + } return ret; } diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index f281de2f3..608e2d5a0 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -57,6 +57,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver CMenuForwarder *fsatSelect; CMenuOptionChooser * dtype; CMenuOptionChooser * dorder; + CMenuOptionChooser * tsp; CMenuForwarder *uniSetup; CMenuOptionNumberChooser * ojDiseqcRepeats; CIntInput * nid; diff --git a/src/system/locals.h b/src/system/locals.h index e1ce2a230..1648baea4 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2427,6 +2427,11 @@ typedef enum LOCALE_TIMING_POPUP_MESSAGES, LOCALE_TIMING_STATIC_MESSAGES, LOCALE_TIMING_VOLUMEBAR, + LOCALE_TUNERSETUP_CABLE, + LOCALE_TUNERSETUP_HYBRID, + LOCALE_TUNERSETUP_MODE, + LOCALE_TUNERSETUP_POWER, + LOCALE_TUNERSETUP_TERR, LOCALE_TMDB_API_KEY, LOCALE_TMDB_ENABLED, LOCALE_TMDB_READ_DATA, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d435ab2cc..b187b33f2 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2427,6 +2427,11 @@ const char * locale_real_names[] = "timing.popup_messages", "timing.static_messages", "timing.volumebar", + "tunersetup.cable", + "tunersetup.hybrid", + "tunersetup.mode", + "tunersetup.power", + "tunersetup.terr", "tmdb.api_key", "tmdb.enabled", "tmdb.read_data", diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 987148734..012b87605 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -153,6 +153,7 @@ class CFrontend bool standby; uint32_t deliverySystemMask; + uint32_t forcedSystemMask; //fe_delivery_system_t deliverySystems[MAX_DELSYS]; //uint32_t numDeliverySystems; @@ -209,6 +210,7 @@ class CFrontend fe_status_t getStatus(void) const; uint32_t getUncorrectedBlocks(void) const; void getDelSys(int f, int m, const char * &fec, const char * &sys, const char * &mod); + void forceDelSys(int i); void getFEInfo(void); int32_t getCurrentSatellitePosition() { return currentSatellitePosition; } @@ -294,6 +296,7 @@ class CFrontend bool hasTerr(void); bool isHybrid(void); bool supportsDelivery(delivery_system_t); + bool forcedDelivery(delivery_system_t); delivery_system_t getCurrentDeliverySystem(void); uint32_t getSupportedDeliverySystems(void) const; static uint32_t getXMLDeliverySystem(delivery_system_t delsys); diff --git a/src/zapit/include/zapit/frontend_types.h b/src/zapit/include/zapit/frontend_types.h index 51d164f5d..b4763ae43 100644 --- a/src/zapit/include/zapit/frontend_types.h +++ b/src/zapit/include/zapit/frontend_types.h @@ -127,6 +127,7 @@ typedef struct { enum fe_interleaving interleaving; #endif uint8_t polarization; + uint8_t plp_id; } FrontendParameters; typedef struct frontend_config { @@ -141,6 +142,8 @@ typedef struct frontend_config { int diseqc_order; int use_usals; int rotor_swap; + int force_mode; + int powered; } frontend_config_t; #endif // __FRONTEND_TYPES_H__ diff --git a/src/zapit/include/zapit/scannit.h b/src/zapit/include/zapit/scannit.h index 18752ce93..e0bb4bb01 100644 --- a/src/zapit/include/zapit/scannit.h +++ b/src/zapit/include/zapit/scannit.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -56,6 +57,7 @@ class CNit : public OpenThreads::Thread bool ParseSatelliteDescriptor(SatelliteDeliverySystemDescriptor * sd, TransportStreamInfo * ts); bool ParseCableDescriptor(CableDeliverySystemDescriptor * sd, TransportStreamInfo * ts); bool ParseTerrestrialDescriptor(TerrestrialDeliverySystemDescriptor * sd, TransportStreamInfo * ts); + bool ParseTerrestrial2Descriptor(T2DeliverySystemDescriptor * sd, TransportStreamInfo * ts); bool ParseServiceList(ServiceListDescriptor * sd, TransportStreamInfo * ts); bool ParseLogicalChannels(LogicalChannelDescriptor * ld, TransportStreamInfo * ts, bool hd = false); diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 5fd546b58..233b1dd70 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -253,12 +253,17 @@ bool CFEManager::loadSettings() fe_config.diseqc_order = getConfigValue(fe, "diseqc_order", UNCOMMITED_FIRST); fe_config.use_usals = getConfigValue(fe, "use_usals", 0); fe_config.rotor_swap = getConfigValue(fe, "rotor_swap", 0); + fe_config.force_mode = getConfigValue(fe, "force_mode", 0); + fe_config.powered = getConfigValue(fe, "powered", 0); fe->setRotorSatellitePosition(getConfigValue(fe, "lastSatellitePosition", 0)); /* default mode for first / next frontends */ int def_mode = def_modeX; + if (fe->hasCable() && fe->hasTerr()) + fe->forceDelSys(fe_config.force_mode); + if (fe->hasSat() && fsat) { fsat = false; def_mode = def_mode0; @@ -356,6 +361,8 @@ void CFEManager::saveSettings(bool write) setConfigValue(fe, "lastSatellitePosition", fe->getRotorSatellitePosition()); setConfigValue(fe, "mode", fe->getMode()); setConfigValue(fe, "master", fe->getMaster()); + setConfigValue(fe, "force_mode", fe_config.force_mode); + setConfigValue(fe, "powered", fe_config.powered); std::vector satList; satellite_map_t satellites = fe->getSatellites(); @@ -555,6 +562,8 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel) if (!mfe->supportsDelivery(channel->delsys)) continue; + if (mfe->forcedDelivery(channel->delsys)) + continue; if (mfe->getMode() == CFrontend::FE_MODE_UNUSED || CFrontend::linked(mfe->getMode())) continue; diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 70374b507..f172fc5c7 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -72,12 +73,15 @@ extern int zapit_debug; #define TRANSMISSION_MODE 8 #define GUARD_INTERVAL 9 #define HIERARCHY 10 +// DVB-T2 specific +#define PLP_ID 11 #define FE_COMMON_PROPS 2 #define FE_DVBS_PROPS 6 #define FE_DVBS2_PROPS 8 #define FE_DVBC_PROPS 6 #define FE_DVBT_PROPS 10 +#define FE_DVBT2_PROPS 11 /* stolen from dvb.c from vlc */ static const struct dtv_property dvbs_cmdargs[] = { @@ -130,6 +134,26 @@ static const struct dtv_property dvbt_cmdargs[] = { { DTV_TUNE, {}, { 0 }, 0}, }; +static const struct dtv_property dvbt2_cmdargs[] = { + { DTV_CLEAR, {0,0,0}, { 0 } ,0}, + { DTV_FREQUENCY, {}, { 0 } ,0}, + { DTV_MODULATION, {}, { QAM_AUTO } ,0}, + { DTV_INVERSION, {}, { INVERSION_AUTO } ,0}, + { DTV_BANDWIDTH_HZ, {}, { 8000000 } ,0}, + { DTV_DELIVERY_SYSTEM, {}, { SYS_DVBT2 } ,0}, + { DTV_CODE_RATE_HP, {}, { FEC_AUTO } ,0}, + { DTV_CODE_RATE_LP, {}, { FEC_AUTO } ,0}, + { DTV_TRANSMISSION_MODE,{}, { TRANSMISSION_MODE_AUTO}, 0}, + { DTV_GUARD_INTERVAL, {}, { GUARD_INTERVAL_AUTO}, 0}, + { DTV_HIERARCHY, {}, { HIERARCHY_AUTO }, 0}, +#if defined DTV_STREAM_ID + { DTV_STREAM_ID, {}, { 0 } ,0}, +#elif defined DTV_DVBT2_PLP_ID + { DTV_DVBT2_PLP_ID, {}, { 0 } ,0}, +#endif + { DTV_TUNE, {}, { 0 }, 0} +}; + #define diff(x,y) (max(x,y) - min(x,y)) #define FE_TIMER_INIT() \ @@ -302,6 +326,7 @@ void CFrontend::getFEInfo(void) #endif // HAVE_ARM_HARDWARE deliverySystemMask = UNKNOWN_DS; + forcedSystemMask = UNKNOWN_DS; #if (DVB_API_VERSION >= 5) && (DVB_API_VERSION_MINOR >= 5) dtv_property prop[1]; @@ -461,7 +486,7 @@ fe_code_rate_t CFrontend::getCodeRate(const uint8_t fec_inner, delivery_system_t dvb_fec_t f = (dvb_fec_t) fec_inner; fe_code_rate_t fec; - if (delsys == DVB_S || delsys == DVB_C || delsys == DVB_T) { + if (delsys == DVB_S || delsys == DVB_C || delsys == DVB_T || delsys == DVB_T2) { switch (f) { case fNone: fec = FEC_NONE; @@ -483,7 +508,7 @@ fe_code_rate_t CFrontend::getCodeRate(const uint8_t fec_inner, delivery_system_t break; default: if (zapit_debug) - printf("no valid fec for DVB-%c set.. assume auto\n", (delsys == DVB_S ? 'S' : (delsys == DVB_C ? 'C' : 'T'))); + printf("no valid fec for DVB-%c set.. assume auto\n", (delsys == DVB_S ? 'S' : (delsys == DVB_C ? 'C' : 'T/T2'))); /* fall through */ case fAuto: fec = FEC_AUTO; @@ -610,6 +635,14 @@ fe_guard_interval_t CFrontend::getGuardInterval(const uint8_t guard_interval) return GUARD_INTERVAL_1_8; case 0x03: return GUARD_INTERVAL_1_4; +#if defined GUARD_INTERVAL_1_128 + case 0x05: + return GUARD_INTERVAL_1_128; + case 0x06: + return GUARD_INTERVAL_19_128; + case 0x07: + return GUARD_INTERVAL_19_256; +#endif default: return GUARD_INTERVAL_AUTO; } @@ -624,6 +657,10 @@ fe_modulation_t CFrontend::getConstellation(const uint8_t constellation) return QAM_16; case 0x02: return QAM_64; + case 0x04: + return QAM_128; + case 0x05: + return QAM_256; default: return QAM_AUTO; } @@ -638,6 +675,14 @@ fe_transmit_mode_t CFrontend::getTransmissionMode(const uint8_t transmission_mod return TRANSMISSION_MODE_8K; case 0x02: return TRANSMISSION_MODE_4K; +#if defined TRANSMISSION_MODE_1K + case 0x04: + return TRANSMISSION_MODE_1K; + case 0x05: + return TRANSMISSION_MODE_16K; + case 0x06: + return TRANSMISSION_MODE_32K; +#endif default: return TRANSMISSION_MODE_AUTO; } @@ -782,6 +827,21 @@ void CFrontend::getDelSys(int f, int m, const char *&fec, const char *&sys, cons return getDelSys(getCurrentDeliverySystem(), f, m, fec, sys, mod); } +void CFrontend::forceDelSys(int i) +{ + switch (i) { + case 1: + forcedSystemMask = ALL_TERR; + break; + case 2: + forcedSystemMask = ALL_CABLE; + break; + default: + forcedSystemMask = UNKNOWN_DS; + break; + } +} + void CFrontend::getXMLDelsysFEC(fe_code_rate_t xmlfec, delivery_system_t & delsys, fe_modulation_t &mod, fe_code_rate_t & fec) { if ((int)xmlfec < FEC_S2_QPSK_1_2) { @@ -970,11 +1030,14 @@ void CFrontend::getDelSys(delivery_system_t delsys, int f, int m, const char *&f case FEC_2_5: fec = "2/5"; break; - default: - INFO("[frontend] getDelSys: unknown FEC: %d !!!\n", f); + case FEC_NONE: + fec = "0"; + break; case FEC_AUTO: fec = "AUTO"; break; + default: + INFO("[frontend] getDelSys: unknown FEC: %d !!!\n", f); } } @@ -1105,6 +1168,14 @@ uint32_t CFrontend::getFEBandwidth(fe_bandwidth_t bandwidth) case BANDWIDTH_5_MHZ: bandwidth_hz = 5000000; break; + case BANDWIDTH_1_712_MHZ: + bandwidth_hz = 1712000; + break; + case BANDWIDTH_10_MHZ: + bandwidth_hz = 10000000; + break; + case BANDWIDTH_AUTO: + bandwidth_hz = 0; } return bandwidth_hz; @@ -1160,11 +1231,14 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p case FEC_2_5: fec = FEC_2_5; break; - default: - INFO("[fe%d] DEMOD: unknown FEC: %d\n", fenumber, fec_inner); + case FEC_NONE: + fec = FEC_NONE; + break; case FEC_AUTO: fec = FEC_AUTO; break; + default: + INFO("[fe%d] DEMOD: unknown FEC: %d\n", fenumber, fec_inner); } switch(feparams->pilot) { case ZPILOT_ON: @@ -1211,7 +1285,6 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p nrOfProps = FE_DVBC_PROPS; break; case DVB_T: - case DVB_T2: case DTMB: memcpy(cmdseq.props, dvbt_cmdargs, sizeof(dvbt_cmdargs)); nrOfProps = FE_DVBT_PROPS; @@ -1226,6 +1299,21 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p cmdseq.props[DELIVERY_SYSTEM].u.data = getFEDeliverySystem(feparams->delsys); cmdseq.props[BANDWIDTH].u.data = getFEBandwidth(feparams->bandwidth); break; + case DVB_T2: + memcpy(cmdseq.props, dvbt2_cmdargs, sizeof(dvbt2_cmdargs)); + nrOfProps = FE_DVBT2_PROPS; + cmdseq.props[FREQUENCY].u.data = feparams->frequency; + cmdseq.props[MODULATION].u.data = feparams->modulation; + cmdseq.props[INVERSION].u.data = feparams->inversion; + cmdseq.props[CODE_RATE_HP].u.data = feparams->code_rate_HP; + cmdseq.props[CODE_RATE_LP].u.data = feparams->code_rate_LP; + cmdseq.props[TRANSMISSION_MODE].u.data = feparams->transmission_mode; + cmdseq.props[GUARD_INTERVAL].u.data = feparams->guard_interval; + cmdseq.props[HIERARCHY].u.data = feparams->hierarchy; + cmdseq.props[DELIVERY_SYSTEM].u.data = getFEDeliverySystem(feparams->delsys); + cmdseq.props[BANDWIDTH].u.data = getFEBandwidth(feparams->bandwidth); + cmdseq.props[PLP_ID].u.data = feparams->plp_id; + break; default: INFO("unknown frontend type, exiting"); return false; @@ -1251,7 +1339,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p int CFrontend::setFrontend(const FrontendParameters *feparams, bool nowait) { - struct dtv_property cmdargs[FE_COMMON_PROPS + FE_DVBT_PROPS]; // WARNING: increase when needed more space + struct dtv_property cmdargs[FE_COMMON_PROPS + FE_DVBT2_PROPS]; // WARNING: increase when needed more space struct dtv_properties cmdseq; #ifdef PEDANTIC_VALGRIND_SETUP memset(&cmdargs, 0, sizeof(cmdargs)); @@ -1332,7 +1420,7 @@ void CFrontend::secSetTone(const fe_sec_tone_mode_t toneMode, const uint32_t ms) void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms) { - if (slave || info.type != FE_QPSK) + if (slave || ((info.type != FE_QPSK) && (info.type != FE_OFDM))) return; if (currentVoltage == voltage) @@ -1697,6 +1785,7 @@ int CFrontend::setParameters(transponder *TP, bool nowait) if (freq < 1000*1000) feparams.frequency = freq * 1000; getDelSys(feparams.delsys, feparams.fec_inner, feparams.modulation, f, s, m); + secSetVoltage(SEC_VOLTAGE_OFF, 100); break; case DVB_T: case DVB_T2: @@ -1704,6 +1793,7 @@ int CFrontend::setParameters(transponder *TP, bool nowait) if (freq < 1000*1000) feparams.frequency = freq * 1000; getDelSys(feparams.delsys, feparams.fec_inner, feparams.modulation, f, s, m); + secSetVoltage(config.powered ? SEC_VOLTAGE_13 : SEC_VOLTAGE_OFF, 100); break; default: printf("[fe%d] unknown delsys %d\n", fenumber, feparams.delsys); @@ -2290,6 +2380,11 @@ bool CFrontend::supportsDelivery(delivery_system_t delsys) return (deliverySystemMask & delsys) != 0; } +bool CFrontend::forcedDelivery(delivery_system_t delsys) +{ + return (forcedSystemMask & delsys) != 0; +} + delivery_system_t CFrontend::getCurrentDeliverySystem(void) { // FIXME: this should come from demod information diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 52a2dfe75..3b2d233d3 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -610,6 +610,8 @@ void CServiceManager::ParseSatTransponders(delivery_system_t delsys, xmlNodePtr memset(&feparams, 0x00, sizeof(FrontendParameters)); feparams.frequency = xmlGetNumericAttribute(tps, "frequency", 0); + if (feparams.frequency == 0) + feparams.frequency = xmlGetNumericAttribute(tps, "centre_frequency", 0); feparams.inversion = INVERSION_AUTO; if (CFrontend::isCable(delsys)) { @@ -742,6 +744,8 @@ void CServiceManager::ParseSatTransponders(delivery_system_t delsys, xmlNodePtr xmlGetNumericAttribute(tps, "guard_interval", 0); feparams.hierarchy = (fe_hierarchy_t) xmlGetNumericAttribute(tps, "hierarchy", 0); + feparams.plp_id = (uint8_t) + xmlGetNumericAttribute(tps, "plp_id", 0); if (feparams.frequency > 1000*1000) feparams.frequency /= 1000; // old transponder list } diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index cb7a81b0b..b16a3c83c 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -253,6 +253,10 @@ bool CNit::Parse() ParseTerrestrialDescriptor((TerrestrialDeliverySystemDescriptor *)d, tsinfo); break; + case EXTENSION_DESCRIPTOR: + ParseTerrestrial2Descriptor((T2DeliverySystemDescriptor *)d, tsinfo); + break; + case SERVICE_LIST_DESCRIPTOR: ParseServiceList((ServiceListDescriptor *) d, tsinfo); break; @@ -440,6 +444,39 @@ bool CNit::ParseTerrestrialDescriptor(TerrestrialDeliverySystemDescriptor * sd, CServiceScan::getInstance()->AddTransponder(TsidOnid, &feparams, true); return true; } +bool CNit::ParseTerrestrial2Descriptor(T2DeliverySystemDescriptor * sd, TransportStreamInfo * tsinfo) +{ + if (!CServiceScan::getInstance()->GetFrontend()->hasTerr()) + return false; + + FrontendParameters feparams; + + memset(&feparams, 0, sizeof(feparams)); + + feparams.delsys = DVB_T2; + feparams.inversion = INVERSION_AUTO; + feparams.plp_id = sd->getPlpId(); + feparams.code_rate_HP = CFrontend::getCodeRate(FEC_AUTO, DVB_T2); + feparams.code_rate_LP = CFrontend::getCodeRate(FEC_AUTO, DVB_T2); + feparams.modulation = CFrontend::getConstellation(QAM_AUTO); + feparams.bandwidth = CFrontend::getBandwidth(sd->getBandwidth()); + feparams.hierarchy = CFrontend::getHierarchy(HIERARCHY_AUTO); + feparams.transmission_mode = CFrontend::getTransmissionMode(sd->getTransmissionMode()); + + for (T2CellConstIterator cell = sd->getCells()->begin(); cell != sd->getCells()->end(); ++cell) + { + for (T2FrequencyConstIterator T2freq = (*cell)->getCentreFrequencies()->begin(); T2freq != (*cell)->getCentreFrequencies()->end(); ++T2freq) + { + feparams.frequency = (*T2freq) * 10; + freq_id_t freq = CREATE_FREQ_ID(feparams.frequency, true); + transponder_id_t TsidOnid = CREATE_TRANSPONDER_ID64( + freq, satellitePosition, tsinfo->getOriginalNetworkId(), tsinfo->getTransportStreamId()); + + CServiceScan::getInstance()->AddTransponder(TsidOnid, &feparams, true); + } + } + return true; +} bool CNit::ParseServiceList(ServiceListDescriptor * sd, TransportStreamInfo * tsinfo) {