Ticket #5882: t5882_S2Api_2.diff
File t5882_S2Api_2.diff, 94.5 KB (added by , 17 years ago) |
---|
-
mythtv/libs/libmythtv/cardutil.cpp
diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp index 18e1efa..07b7143 100644
a b QString CardUtil::ProbeDVBType(const QString &device) 242 242 VERBOSE(VB_IMPORTANT, "FE_GET_INFO ioctl failed (" + dvbdev + ")."); 243 243 return ret; 244 244 } 245 DTVTunerType type(info.type); 246 if (type == DTVTunerType::kTunerTypeQPSK) 247 { 248 /* XXX TODO 249 * there is currently no way to detect if the frontend supports DVB-S2 250 * so every DVB-S frontend is handled as DVB-S2 */ 251 type = DTVTunerType::kTunerTypeDVB_S2; 252 } 245 253 close(fd_frontend); 246 254 247 DTVTunerType type(info.type);248 255 ret = (type.toString() != "UNKNOWN") ? type.toString().toUpper() : ret; 249 256 #endif // USING_DVB 250 257 … … bool CardUtil::IsDVBCardType(const QString card_type) 337 344 { 338 345 QString ct = card_type.toUpper(); 339 346 return (ct == "DVB") || (ct == "QAM") || (ct == "QPSK") || 340 (ct == "OFDM") || (ct == "ATSC") ;347 (ct == "OFDM") || (ct == "ATSC") || (ct == "DVB_S2"); 341 348 } 342 349 343 350 QString get_on_cardid(const QString &to_get, uint cardid) -
mythtv/libs/libmythtv/cardutil.h
diff --git a/mythtv/libs/libmythtv/cardutil.h b/mythtv/libs/libmythtv/cardutil.h index 6831d27..c8c8575 100644
a b class MPUBLIC CardUtil 54 54 HDHOMERUN = 10, 55 55 FREEBOX = 11, 56 56 HDPVR = 12, 57 DVBS2 = 13, 57 58 }; 58 59 59 60 static enum CARD_TYPES toCardType(const QString &name) … … class MPUBLIC CardUtil 84 85 return FREEBOX; 85 86 if ("HDPVR" == name) 86 87 return HDPVR; 88 if ("DVB_S2" == name) 89 return DVBS2; 87 90 return ERROR_UNKNOWN; 88 91 } 89 92 -
mythtv/libs/libmythtv/channelbase.cpp
diff --git a/mythtv/libs/libmythtv/channelbase.cpp b/mythtv/libs/libmythtv/channelbase.cpp index 443b3ec..5ce0ac0 100644
a b bool ChannelBase::IsTunable(const QString &input, const QString &channum) const 190 190 191 191 // Fetch tuning data from the database. 192 192 QString tvformat, modulation, freqtable, freqid, dtv_si_std; 193 QString msystem, rolloff; 193 194 int finetune; 194 195 uint64_t frequency; 195 196 int mpeg_prog_num; … … bool ChannelBase::IsTunable(const QString &input, const QString &channum) const 201 202 tvformat, modulation, freqtable, freqid, 202 203 finetune, frequency, 203 204 dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 205 msystem, rolloff, 204 206 mplexid, commfree)) 205 207 { 206 208 VERBOSE(VB_IMPORTANT, loc + " " + QString( -
mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp index f4e0578..67483ac 100644
a b bool ChannelScanSM::ScanTransportsStartingOn(int sourceid, 1439 1439 startChan["coderate_hp"], startChan["coderate_lp"], 1440 1440 startChan["constellation"], startChan["trans_mode"], 1441 1441 startChan["guard_interval"], startChan["hierarchy"], 1442 startChan["modulation"], startChan["bandwidth"]); 1442 startChan["modulation"], startChan["bandwidth"], 1443 startChan["msystem"], startChan["rolloff"]); 1443 1444 } 1444 1445 1445 1446 if (ok) -
mythtv/libs/libmythtv/channelscan/channelscanmiscsettings.h
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanmiscsettings.h b/mythtv/libs/libmythtv/channelscan/channelscanmiscsettings.h index 3c20d10..29082c4 100644
a b class ScanFecSetting: public ComboBoxSetting 146 146 addSelection("1/2"); 147 147 addSelection("2/3"); 148 148 addSelection("3/4"); 149 addSelection("3/5"); 149 150 addSelection("4/5"); 150 151 addSelection("5/6"); 151 152 addSelection("6/7"); 152 153 addSelection("7/8"); 153 154 addSelection("8/9"); 155 addSelection("9/10"); 154 156 } 155 157 }; 156 158 … … class ScanFec: public ScanFecSetting, public TransientStorage 165 167 } 166 168 }; 167 169 170 class ScanModulationSystem: public ComboBoxSetting, public TransientStorage 171 { 172 public: 173 ScanModulationSystem() : ScanModulationSystemSetting(this) 174 { 175 setLabel(QObject::tr("Modul. System")); 176 setHelpText(QObject::tr("Modulation System (Default: DVB-S)")); 177 addSelection("DVB-S","dvbs",true); 178 addSelection("DVB-S2","dvbs2"); 179 }; 180 }; 181 182 183 class ScanRollOff: public ComboBoxSetting 184 { 185 public: 186 ScanRollOff(Storage *_storage) : ComboBoxSetting(_storage) 187 { 188 setLabel(QObject::tr("Roll-off")); 189 setHelpText(QObject::tr( 190 "Roll-off (Default: Auto):\n" 191 "The DVB-S2 standard in addition \n" 192 " to the single DVB-S 35% roll-off\n" 193 " factor, provides two additional roll-off\n" 194 " factors to further increase transponder efficiency")); 195 addSelection(QObject::tr("Auto"),"auto"); 196 addSelection("0.35","0.35",true); 197 addSelection("0.20"); 198 addSelection("0.25"); 199 } 200 }; 201 168 202 class ScanCodeRateLP: public ScanFecSetting, public TransientStorage 169 203 { 170 204 public: -
mythtv/libs/libmythtv/channelscan/channelscanner.cpp
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner.cpp index 15d18a6..7168d5c 100644
a b void ChannelScanner::Scan( 143 143 } 144 144 else if ((ScanTypeSetting::NITAddScan_DVBT == scantype) || 145 145 (ScanTypeSetting::NITAddScan_DVBS == scantype) || 146 (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || 146 147 (ScanTypeSetting::NITAddScan_DVBC == scantype)) 147 148 { 148 149 VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); … … DTVConfParser::return_t ChannelScanner::ImportDVBUtils( 219 220 DTVConfParser::cardtype_t type = DTVConfParser::UNKNOWN; 220 221 type = (CardUtil::DVBT == cardtype) ? DTVConfParser::OFDM : type; 221 222 type = (CardUtil::QPSK == cardtype) ? DTVConfParser::QPSK : type; 223 type = (CardUtil::DVBS2 == cardtype) ? DTVConfParser::DVBS2 : type; 222 224 type = (CardUtil::DVBC == cardtype) ? DTVConfParser::QAM : type; 223 225 type = ((CardUtil::ATSC == cardtype) || 224 226 (CardUtil::HDHOMERUN == cardtype)) ? DTVConfParser::ATSC : type; … … void ChannelScanner::PreScanCommon( 302 304 QString sub_type = CardUtil::ProbeDVBType(device.toUInt()).upper(); 303 305 bool need_nit = (("QAM" == sub_type) || 304 306 ("QPSK" == sub_type) || 307 ("DVB_S2" == sub_type) || 305 308 ("OFDM" == sub_type)); 306 309 307 310 // Ugh, Some DVB drivers don't fully support signal monitoring... -
mythtv/libs/libmythtv/channelscan/modulationsetting.h
diff --git a/mythtv/libs/libmythtv/channelscan/modulationsetting.h b/mythtv/libs/libmythtv/channelscan/modulationsetting.h index 88f0254..8168f83 100644
a b class ScanModulationSetting: public ComboBoxSetting 58 58 { 59 59 addSelection(QObject::tr("Auto"),"auto",true); 60 60 addSelection("QPSK","qpsk"); 61 #ifdef FE_GET_EXTENDED_INFO62 61 addSelection("8PSK","8psk"); 63 #endif64 62 addSelection("QAM 16","qam_16"); 65 63 addSelection("QAM 32","qam_32"); 66 64 addSelection("QAM 64","qam_64"); -
mythtv/libs/libmythtv/channelscan/panedvbs2.h
diff --git a/mythtv/libs/libmythtv/channelscan/panedvbs2.h b/mythtv/libs/libmythtv/channelscan/panedvbs2.h index 8a5742d..466c1c2 100644
a b class PaneDVBS2 : public HorizontalConfigurationGroup 22 22 left->addChild( pfrequency = new ScanFrequency()); 23 23 left->addChild( ppolarity = new ScanPolarity()); 24 24 left->addChild( psymbolrate = new ScanSymbolRate()); 25 right->addChild(pfec = new ScanFec()); 25 left->addChild( pfec = new ScanFec()); 26 right->addChild(pmsystem = new ScanModulationSystem()); 26 27 right->addChild(pmodulation = new ScanModulation()); 27 28 right->addChild(pinversion = new ScanInversion()); 29 right->addChild(prolloff = new ScanRollOff()); 28 30 addChild(left); 29 31 addChild(right); 30 32 } … … class PaneDVBS2 : public HorizontalConfigurationGroup 35 37 QString fec(void) const { return pfec->getValue(); } 36 38 QString polarity(void) const { return ppolarity->getValue(); } 37 39 QString modulation(void) const { return pmodulation->getValue(); } 40 QString rolloff(void) const { return prolloff->getValue(); } 41 QString msystem(void) const { return pmsystem->getValue(); } 38 42 39 43 protected: 40 44 ScanFrequency *pfrequency; … … class PaneDVBS2 : public HorizontalConfigurationGroup 43 47 ScanFec *pfec; 44 48 ScanPolarity *ppolarity; 45 49 ScanModulation *pmodulation; 50 ScanRollOff *prolloff; 51 ScanModulationSystem *pmsystem; 46 52 }; 47 53 48 54 #endif // _PANE_DVBS2_H_ -
mythtv/libs/libmythtv/channelscan/scaninfo.cpp
diff --git a/mythtv/libs/libmythtv/channelscan/scaninfo.cpp b/mythtv/libs/libmythtv/channelscan/scaninfo.cpp index 72c80a8..b0b5c91 100644
a b ScanDTVTransportList LoadScan(uint scanid) 76 76 " hp_code_rate, lp_code_rate, modulation, " 77 77 " transmission_mode, guard_interval, hierarchy, " 78 78 " modulation, bandwidth, sistandard, " 79 " tuner_type, transportid " 79 " tuner_type, transportid, " 80 " msystem, rolloff " 80 81 "FROM channelscan_dtv_multiplex " 81 82 "WHERE scanid = :SCANID"); 82 83 query.bindValue(":SCANID", scanid); … … ScanDTVTransportList LoadScan(uint scanid) 97 98 query.value(6).toString(), query.value(7).toString(), 98 99 query.value(8).toString(), query.value(9).toString(), 99 100 query.value(10).toString(), query.value(11).toString(), 100 query.value(12).toString()); 101 query.value(12).toString(), query.value(16).toString(), 102 query.value(17).toString()); 101 103 102 104 query2.prepare( 103 105 "SELECT " -
mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp
diff --git a/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp b/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp index 4c78ddb..694d34a 100644
a b void ScanTypeSetting::SetInput(const QString &cardids_inputname) 133 133 addSelection(tr("Import channels.conf"), 134 134 QString::number(DVBUtilsImport)); 135 135 break; 136 case CardUtil::DVBS2: 137 addSelection(tr("Full Scan (Tuned)"), 138 QString::number(NITAddScan_DVBS2)); 139 addSelection(tr("Import channels.conf"), 140 QString::number(DVBUtilsImport)); 141 break; 136 142 case CardUtil::QAM: 137 143 addSelection(tr("Full Scan (Tuned)"), 138 144 QString::number(NITAddScan_DVBC)); … … QMap<QString,QString> ScanOptionalConfig::GetStartChan(void) const 329 335 startChan["modulation"] = "qpsk"; 330 336 startChan["polarity"] = pane->polarity(); 331 337 } 338 else if (ScanTypeSetting::NITAddScan_DVBS2 == st) 339 { 340 const PaneDVBS2 *pane = paneDVBS2; 341 342 startChan["std"] = "dvb"; 343 startChan["frequency"] = pane->frequency(); 344 startChan["inversion"] = pane->inversion(); 345 startChan["symbolrate"] = pane->symbolrate(); 346 startChan["fec"] = pane->fec(); 347 startChan["modulation"] = pane->modulation();; 348 startChan["polarity"] = pane->polarity(); 349 startChan["rolloff"] = pane->rolloff(); 350 } 332 351 else if (ScanTypeSetting::NITAddScan_DVBC == st) 333 352 { 334 353 const PaneDVBC *pane = paneDVBC; -
mythtv/libs/libmythtv/channelutil.cpp
diff --git a/mythtv/libs/libmythtv/channelutil.cpp b/mythtv/libs/libmythtv/channelutil.cpp index 28e141f..e7836ec 100644
a b static uint insert_dtv_multiplex( 121 121 signed char trans_mode, 122 122 QString inner_FEC, QString constellation, 123 123 signed char hierarchy, QString hp_code_rate, 124 QString lp_code_rate, QString guard_interval) 124 QString lp_code_rate, QString guard_interval, 125 QString msystem, QString rolloff) 125 126 { 126 127 MSqlQuery query(MSqlQuery::InitCon()); 127 128 … … static uint insert_dtv_multiplex( 165 166 "lp_code_rate = :LP_CODE_RATE, " : ""; 166 167 updateStr += (!guard_interval.isNull()) ? 167 168 "guard_interval = :GUARD_INTERVAL, " : ""; 169 updateStr += (!msystem.isNull()) ? 170 "msystem = :MSYSTEM, " : ""; 171 updateStr += (!rolloff.isNull()) ? 172 "rolloff = :ROLLOFF, " : ""; 168 173 169 174 updateStr = updateStr.left(updateStr.length()-2) + " "; 170 175 … … static uint insert_dtv_multiplex( 194 199 insertStr += (!hp_code_rate.isNull()) ? "hp_code_rate, " : ""; 195 200 insertStr += (!lp_code_rate.isNull()) ? "lp_code_rate, " : ""; 196 201 insertStr += (!guard_interval.isNull()) ? "guard_interval, " : ""; 202 insertStr += (!msystem.isNull()) ? "msystem, " : ""; 203 insertStr += (!rolloff.isNull()) ? "rolloff, " : ""; 197 204 insertStr = insertStr.left(insertStr.length()-2) + ") "; 198 205 199 206 insertStr += … … static uint insert_dtv_multiplex( 213 220 insertStr += (!hp_code_rate.isNull()) ? ":HP_CODE_RATE, " : ""; 214 221 insertStr += (!lp_code_rate.isNull()) ? ":LP_CODE_RATE, " : ""; 215 222 insertStr += (!guard_interval.isNull()) ? ":GUARD_INTERVAL, " : ""; 223 insertStr += (!msystem.isNull()) ? ":MSYSTEM, " : ""; 224 insertStr += (!rolloff.isNull()) ? ":ROLLOFF, " : ""; 216 225 insertStr = insertStr.left(insertStr.length()-2) + ");"; 217 226 218 227 query.prepare((mplex) ? updateStr : insertStr); … … static uint insert_dtv_multiplex( 254 263 query.bindValue(":LP_CODE_RATE", lp_code_rate); 255 264 if (!guard_interval.isNull()) 256 265 query.bindValue(":GUARD_INTERVAL",guard_interval); 266 if (!msystem.isNull()) 267 query.bindValue(":MSYSTEM", msystem); 268 if (!rolloff.isNull()) 269 query.bindValue(":ROLLOFF", rolloff); 257 270 258 271 if (!query.exec() || !query.isActive()) 259 272 { … … void handle_transport_desc(vector<uint> &muxes, const MPEGDescriptor &desc, 292 305 { 293 306 QString dummy_mod; 294 307 QString dummy_sistd; 308 QString dummy_msystem; 309 QString dummy_rolloff; 295 310 uint dummy_tsid, dummy_netid; 296 311 ChannelUtil::GetTuningParams(mux, dummy_mod, freq, 297 dummy_tsid, dummy_netid, dummy_sistd); 312 dummy_tsid, dummy_netid, 313 dummy_msystem, dummy_rolloff, 314 dummy_sistd); 298 315 } 299 316 300 317 mux = ChannelUtil::CreateMultiplex( … … void handle_transport_desc(vector<uint> &muxes, const MPEGDescriptor &desc, 307 324 cd.TransmissionModeString()[0].toAscii(), 308 325 QString(), cd.ConstellationString(), 309 326 cd.HierarchyString()[0].toAscii(), cd.CodeRateHPString(), 310 cd.CodeRateLPString(), cd.GuardIntervalString()); 327 cd.CodeRateLPString(), cd.GuardIntervalString(), 328 QString(), QString()); 311 329 312 330 if (mux) 313 331 muxes.push_back(mux); … … void handle_transport_desc(vector<uint> &muxes, const MPEGDescriptor &desc, 334 352 -1, 335 353 cd.FECInnerString(), QString(), 336 354 -1, QString(), 337 QString(), QString()); 355 QString(), QString(), 356 cd.ModulationSystemString(), cd.RollOffString()); 338 357 339 358 if (mux) 340 359 muxes.push_back(mux); … … void handle_transport_desc(vector<uint> &muxes, const MPEGDescriptor &desc, 357 376 -1, 358 377 cd.FECInnerString(), QString::null, 359 378 -1, QString::null, 379 QString::null, QString::null, 360 380 QString::null, QString::null); 361 381 362 382 if (mux) … … uint ChannelUtil::CreateMultiplex(int sourceid, QString sistandard, 377 397 -1, 378 398 QString::null, QString::null, 379 399 -1, QString::null, 400 QString::null, QString::null, 380 401 QString::null, QString::null); 381 402 } 382 403 … … uint ChannelUtil::CreateMultiplex( 390 411 signed char trans_mode, 391 412 QString inner_FEC, QString constellation, 392 413 signed char hierarchy, QString hp_code_rate, 393 QString lp_code_rate, QString guard_interval) 414 QString lp_code_rate, QString guard_interval, 415 QString msystem, QString rolloff) 394 416 { 395 417 return insert_dtv_multiplex( 396 418 sourceid, sistandard, … … uint ChannelUtil::CreateMultiplex( 402 424 trans_mode, 403 425 inner_FEC, constellation, 404 426 hierarchy, hp_code_rate, 405 lp_code_rate, guard_interval); 427 lp_code_rate, guard_interval, 428 msystem, rolloff); 406 429 } 407 430 408 431 uint ChannelUtil::CreateMultiplex(uint sourceid, const DTVMultiplex &mux, … … uint ChannelUtil::CreateMultiplex(uint sourceid, const DTVMultiplex &mux, 418 441 mux.trans_mode.toChar().toAscii(), 419 442 mux.fec.toString(), mux.modulation.toString(), 420 443 mux.hierarchy.toChar().toAscii(), mux.hp_code_rate.toString(), 421 mux.lp_code_rate.toString(), mux.guard_interval.toString()); 444 mux.lp_code_rate.toString(), mux.guard_interval.toString(), 445 mux.msystem.toString(), mux.rolloff.toString()); 422 446 } 423 447 424 448 … … bool ChannelUtil::GetTuningParams(uint mplexid, 706 730 uint64_t &frequency, 707 731 uint &dvb_transportid, 708 732 uint &dvb_networkid, 733 QString &dvb_msystem, 734 QString &dvb_rolloff, 709 735 QString &si_std) 710 736 { 711 737 if (!mplexid || (mplexid == 32767)) /* 32767 deals with old lineups */ … … bool ChannelUtil::GetTuningParams(uint mplexid, 713 739 714 740 MSqlQuery query(MSqlQuery::InitCon()); 715 741 query.prepare( 716 "SELECT transportid, networkid, frequency, modulation, sistandard " 742 "SELECT transportid, networkid, frequency, modulation, sistandard, " 743 "msystem, rolloff " 717 744 "FROM dtv_multiplex " 718 745 "WHERE mplexid = :MPLEXID"); 719 746 query.bindValue(":MPLEXID", mplexid); … … bool ChannelUtil::GetTuningParams(uint mplexid, 732 759 frequency = (uint64_t) query.value(2).toDouble(); // Qt 3.1 compat 733 760 modulation = query.value(3).toString(); 734 761 si_std = query.value(4).toString(); 762 dvb_msystem = query.value(5).toString(); 763 dvb_rolloff = query.value(6).toString(); 735 764 736 765 return true; 737 766 } … … bool ChannelUtil::GetChannelData( 1483 1512 QString &dtv_si_std, int &mpeg_prog_num, 1484 1513 uint &atsc_major, uint &atsc_minor, 1485 1514 uint &dvb_transportid, uint &dvb_networkid, 1515 QString &dvb_msystem, QString &dvb_rolloff, 1486 1516 uint &mplexid, 1487 1517 bool &commfree) 1488 1518 { … … bool ChannelUtil::GetChannelData( 1535 1565 return true; 1536 1566 1537 1567 return GetTuningParams(mplexid, modulation, frequency, 1538 dvb_transportid, dvb_networkid, dtv_si_std); 1568 dvb_transportid, dvb_networkid, 1569 dvb_msystem, dvb_rolloff, dtv_si_std); 1539 1570 } 1540 1571 1541 1572 bool ChannelUtil::GetChannelSettings(int chanid, bool &useonairguide, -
mythtv/libs/libmythtv/channelutil.h
diff --git a/mythtv/libs/libmythtv/channelutil.h b/mythtv/libs/libmythtv/channelutil.h index e0ed317..3c91154 100644
a b class MPUBLIC ChannelUtil 67 67 signed char trans_mode, 68 68 QString inner_FEC, QString constellation, 69 69 signed char hierarchy, QString hp_code_rate, 70 QString lp_code_rate, QString guard_interval); 70 QString lp_code_rate, QString guard_interval, 71 QString msystem, QString rolloff); 71 72 72 73 static uint CreateMultiplex(uint sourceid, const DTVMultiplex&, 73 74 int transport_id, int network_id); … … class MPUBLIC ChannelUtil 90 91 uint64_t &frequency, 91 92 uint &dvb_transportid, 92 93 uint &dvb_networkid, 94 QString &msystem, 95 QString &rolloff, 93 96 QString &si_std); 94 97 95 98 static bool GetATSCChannel(uint sourceid, const QString &channum, … … class MPUBLIC ChannelUtil 159 162 QString &dtv_si_std, int &mpeg_prog_num, 160 163 uint &atsc_major, uint &atsc_minor, 161 164 uint &dvb_transportid, uint &dvb_networkid, 165 QString &msystem, QString &rolloff, 162 166 uint &mplexid, bool &commfree); 163 167 static bool GetChannelSettings(int chanid, bool &useonairguide, 164 168 bool &hidden); -
mythtv/libs/libmythtv/dbcheck.cpp
diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp index fd00c46..17c1752 100644
a b NULL 4302 4302 return false; 4303 4303 } 4304 4304 4305 if (dbver == "1223") 4306 { 4307 const char *updates[] = { 4308 "ALTER TABLE dtv_multiplex ADD msystem VARCHAR(10) DEFAULT NULL AFTER polarity;", 4309 "ALTER TABLE dtv_multiplex ADD rolloff VARCHAR(10) DEFAULT NULL AFTER modulation;", 4310 NULL 4311 }; 4312 if (!performActualUpdate(updates, "1224", dbver)) 4313 return false; 4314 } 4315 4305 4316 return true; 4306 4317 } 4307 4318 -
mythtv/libs/libmythtv/dtvconfparser.cpp
diff --git a/mythtv/libs/libmythtv/dtvconfparser.cpp b/mythtv/libs/libmythtv/dtvconfparser.cpp index 82fa9a7..d24ea19 100644
a b DTVConfParser::return_t DTVConfParser::Parse(void) 112 112 { 113 113 if ((type == OFDM) && (str == "T")) 114 114 ok &= ParseVDR(list, channelNo); 115 else if (( type == QPSK) && (str == "S"))115 else if (((type == QPSK) || (type == DVBS2)) && (str == "S")) 116 116 ok &= ParseVDR(list, channelNo); 117 117 else if ((type == QAM) && (str == "C")) 118 118 ok &= ParseVDR(list, channelNo); … … DTVConfParser::return_t DTVConfParser::Parse(void) 121 121 ok &= ParseConfOFDM(list); 122 122 else if (type == ATSC) 123 123 ok &= ParseConfATSC(list); 124 else if ( type == QPSK)124 else if ((type == QPSK) || (type == DVBS2)) 125 125 ok &= ParseConfQPSK(list); 126 126 else if (type == QAM) 127 127 ok &= ParseConfQAM(list); … … bool DTVConfParser::ParseVDR(const QStringList &tokens, int channelNo) 274 274 case 'R': 275 275 case 'L': 276 276 mux.polarity.ParseVDR(ori); 277 case 'S': 278 mux.msystem.ParseVDR(params); 279 case 'O': 280 mux.rolloff.ParseVDR(params); 277 281 break; 278 282 default: 279 283 return false; -
mythtv/libs/libmythtv/dtvconfparser.h
diff --git a/mythtv/libs/libmythtv/dtvconfparser.h b/mythtv/libs/libmythtv/dtvconfparser.h index 2795493..8ae6c9d 100644
a b class DTVConfParser 80 80 { 81 81 public: 82 82 enum return_t { ERROR_CARDTYPE, ERROR_OPEN, ERROR_PARSE, OK }; 83 enum cardtype_t { ATSC, OFDM, QPSK, QAM, UNKNOWN };83 enum cardtype_t { ATSC, OFDM, QPSK, DVBS2, QAM, UNKNOWN }; 84 84 85 85 DTVConfParser(enum cardtype_t _type, uint sourceid, const QString &_file); 86 86 virtual ~DTVConfParser() { } -
mythtv/libs/libmythtv/dtvconfparserhelpers.cpp
diff --git a/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp b/mythtv/libs/libmythtv/dtvconfparserhelpers.cpp index 01212cb..8d14e21 100644
a b const char *DTVBandwidth::dbStr[DTVBandwidth::kDBStrCnt] = 145 145 146 146 const DTVParamHelperStruct DTVCodeRate::confTable[] = 147 147 { 148 { "FEC_ AUTO", kFECAuto},148 { "FEC_NONE", kFECNone }, 149 149 { "FEC_1_2", kFEC_1_2 }, 150 150 { "FEC_2_3", kFEC_2_3 }, 151 151 { "FEC_3_4", kFEC_3_4 }, … … const DTVParamHelperStruct DTVCodeRate::confTable[] = 154 154 { "FEC_6_7", kFEC_6_7 }, 155 155 { "FEC_7_8", kFEC_7_8 }, 156 156 { "FEC_8_9", kFEC_8_9 }, 157 { "FEC_NONE", kFECNone }, 157 { "FEC_AUTO", kFECAuto }, 158 { "FEC_3_5", kFEC_3_5 }, 159 { "FEC_9_10", kFEC_9_10 }, 158 160 { NULL, kFECAuto }, 159 161 }; 160 162 … … const DTVParamHelperStruct DTVCodeRate::vdrTable[] = 164 166 { "12", kFEC_1_2 }, 165 167 { "23", kFEC_2_3 }, 166 168 { "34", kFEC_3_4 }, 169 { "35", kFEC_3_5 }, 167 170 { "45", kFEC_4_5 }, 168 171 { "56", kFEC_5_6 }, 169 172 { "67", kFEC_6_7 }, 170 173 { "78", kFEC_7_8 }, 171 174 { "89", kFEC_8_9 }, 175 { "910", kFEC_9_10}, 172 176 { "0", kFECNone }, 173 177 { NULL, kFECAuto } 174 178 }; 175 179 176 180 const DTVParamHelperStruct DTVCodeRate::parseTable[] = 177 181 { 178 { " auto", kFECAuto},182 { "none", kFECNone }, 179 183 { "1/2", kFEC_1_2 }, 180 184 { "2/3", kFEC_2_3 }, 181 185 { "3/4", kFEC_3_4 }, … … const DTVParamHelperStruct DTVCodeRate::parseTable[] = 184 188 { "6/7", kFEC_6_7 }, 185 189 { "7/8", kFEC_7_8 }, 186 190 { "8/9", kFEC_8_9 }, 187 { "none", kFECNone }, 191 { "auto", kFECAuto }, 192 { "3/5", kFEC_3_5 }, 193 { "9/10", kFEC_9_10}, 188 194 { NULL, kFECAuto } 189 195 }; 190 196 … … const char *DTVCodeRate::dbStr[DTVCodeRate::kDBStrCnt] = 199 205 "6/7", ///< kFEC_6_7 200 206 "7/8", ///< kFEC_7_8 201 207 "8/9", ///< kFEC_8_9 202 "auto" ///< kFECAuto 208 "auto", ///< kFECAuto 209 "3/5", ///< kFEC_3_5 210 "9/10", ///< kFEC_9_10 203 211 }; 204 212 205 213 const DTVParamHelperStruct DTVModulation::confTable[] = … … const DTVParamHelperStruct DTVModulation::confTable[] = 213 221 { "QPSK", kModulationQPSK }, 214 222 { "8VSB", kModulation8VSB }, 215 223 { "16VSB", kModulation16VSB }, 216 { "2VSB", kModulation2VSB },217 { "4VSB", kModulation4VSB },218 { "BPSK", kModulationBPSK },219 224 { "16APSK", kModulation16APSK }, 220 225 { "32APSK", kModulation32APSK }, 221 226 { "8PSK", kModulation8PSK }, 222 { " 16PSK", kModulation16PSK },227 { "DQPSK", kModulationDQPSK }, 223 228 { "analog", kModulationAnalog }, 224 229 { NULL, kModulationQAMAuto }, 225 230 }; … … const DTVParamHelperStruct DTVModulation::vdrTable[] = 232 237 { "64", kModulationQAM64 }, 233 238 { "128", kModulationQAM128 }, 234 239 { "256", kModulationQAM256 }, 240 { "2", kModulationQPSK }, 241 { "10", kModulation8VSB }, 242 { "11", kModulation16VSB }, 243 { "6", kModulation16APSK }, 244 { "7", kModulation32APSK }, 245 { "5", kModulation8PSK }, 235 246 { "0", kModulationQPSK }, 236 247 { NULL, kModulationQAMAuto }, 237 248 }; … … const DTVParamHelperStruct DTVModulation::parseTable[] = 247 258 { "qpsk", kModulationQPSK }, 248 259 { "8vsb", kModulation8VSB }, 249 260 { "16vsb", kModulation16VSB }, 250 { "2vsb", kModulation2VSB }, 251 { "4vsb", kModulation4VSB }, 252 { "bpsk", kModulationBPSK }, 261 { "8psk", kModulation8PSK }, 253 262 { "16apsk", kModulation16APSK }, 254 263 { "32apsk", kModulation32APSK }, 255 { "8psk", kModulation8PSK }, 256 { "16psk", kModulation16PSK }, 264 { "dqpsk", kModulationDQPSK }, 257 265 // alternates 258 266 { "a", kModulationQAMAuto }, 259 267 { "qam_auto", kModulationQAMAuto }, … … const DTVParamHelperStruct DTVModulation::parseTable[] = 262 270 { "qam-64", kModulationQAM64 }, 263 271 { "qam-128", kModulationQAM128 }, 264 272 { "qam-256", kModulationQAM256 }, 265 // qpsk, no alternative266 { "8-vsb", kModulation8VSB },267 { "16-vsb", kModulation16VSB },268 { "2-vsb", kModulation2VSB },269 { "4-vsb", kModulation4VSB },270 // bpsk, no alternative271 273 { "16-apsk", kModulation16APSK }, 272 274 { "32-apsk", kModulation32APSK }, 273 275 { "8-psk", kModulation8PSK }, 274 { "16-psk", kModulation16PSK }, 276 { "16-psk", kModulationDQPSK }, 277 { "dq-psk", kModulationDQPSK }, 278 { "16psk", kModulationDQPSK }, 275 279 { NULL, kModulationQAMAuto }, 276 280 }; 277 281 … … const char *DTVModulation::dbStr[DTVModulation::kDBStrCnt] = 286 290 "auto", ///< kModulationQAMAuto 287 291 "8vsb", ///< kModulation8VSB 288 292 "16vsb", ///< kModulation16VSB 289 "2vsb", ///< kModulation2VSB 290 "4vsb", ///< kModulation4VSB 291 "bpsk", ///< kModulationBPSK 293 "8psk", ///< kModulation8PSK 292 294 "16apsk", ///< kModulation16APSK 293 295 "32apsk", ///< kModulation32APSK 294 "8psk", ///< kModulation8PSK 295 "16psk", ///< kModulation16PSK 296 "dqpsk", ///< kModulationDQPSK 296 297 }; 297 298 298 299 const DTVParamHelperStruct DTVTransmitMode::confTable[] = … … const char *DTVPolarity::dbStr[DTVPolarity::kDBStrCnt] = 420 421 "r", ///< kPolarityRight 421 422 "l" ///< kPolarityLeft 422 423 }; 424 425 const DTVParamHelperStruct DTVModulationSystem::confTable[] = 426 { 427 { "SYS_DVBS", kModulationSystemDVBS }, 428 { "SYS_DVBS2", kModulationSystemDVBS2 }, 429 { NULL, kModulationSystemDVBS }, 430 }; 431 432 const DTVParamHelperStruct DTVModulationSystem::vdrTable[] = 433 { 434 { "0", kModulationSystemDVBS }, 435 { "1", kModulationSystemDVBS2 }, 436 { NULL, kModulationSystemDVBS }, 437 }; 438 439 const DTVParamHelperStruct DTVModulationSystem::parseTable[] = 440 { 441 { "dvbs2", kModulationSystemDVBS2 }, 442 { "dvbs", kModulationSystemDVBS }, 443 { NULL, kModulationSystemDVBS }, 444 }; 445 446 const char *DTVModulationSystem::dbStr[DTVModulationSystem::kDBStrCnt] = 447 { 448 "dvbs", ///< kModulationSystemDVBS 449 "dvbs2", ///< kModulationSystemDVBS2 450 }; 451 452 const DTVParamHelperStruct DTVRollOff::confTable[] = 453 { 454 { "ROLLOFF_35", kRollOff35 }, 455 { "ROLLOFF_20", kRollOff20 }, 456 { "ROLLOFF_25", kRollOff25 }, 457 { "ROLLOFF_AUTO", kRollOffAuto }, 458 { NULL, kRollOffAuto }, 459 }; 460 461 const DTVParamHelperStruct DTVRollOff::vdrTable[] = 462 { 463 { "35", kRollOff35 }, 464 { "20", kRollOff20 }, 465 { "25", kRollOff25 }, 466 { "0", kRollOffAuto }, 467 { NULL, kRollOff35 }, 468 }; 469 470 const DTVParamHelperStruct DTVRollOff::parseTable[] = 471 { 472 { "0.35", kRollOff35 }, 473 { "0.20", kRollOff20 }, 474 { "0.25", kRollOff25 }, 475 { "auto", kRollOffAuto }, 476 { NULL, kRollOff35 }, 477 }; 478 479 const char *DTVRollOff::dbStr[DTVRollOff::kDBStrCnt] = 480 { 481 "0.35", ///< kRollOff35 482 "0.20", ///< kRollOff20 483 "0.25", ///< kRollOff25 484 "auto", ///< kRollOffAuto 485 }; -
mythtv/libs/libmythtv/dtvconfparserhelpers.h
diff --git a/mythtv/libs/libmythtv/dtvconfparserhelpers.h b/mythtv/libs/libmythtv/dtvconfparserhelpers.h index 88130bc..a8cc8ae 100644
a b class DTVCodeRate : public DTVParamHelper 191 191 static const DTVParamHelperStruct confTable[]; 192 192 static const DTVParamHelperStruct vdrTable[]; 193 193 static const DTVParamHelperStruct parseTable[]; 194 static const uint kDBStrCnt = 1 0;194 static const uint kDBStrCnt = 12; 195 195 static const char *dbStr[kDBStrCnt]; 196 196 197 197 public: … … class DTVCodeRate : public DTVParamHelper 207 207 kFEC_7_8, 208 208 kFEC_8_9, 209 209 kFECAuto, 210 kFEC_3_5, 211 kFEC_9_10, 210 212 }; 211 213 212 214 DTVCodeRate(int _default = kFECAuto) : DTVParamHelper(_default) { } … … class DTVModulation : public DTVParamHelper 236 238 public: 237 239 enum 238 240 { 239 kModulationQPSK = 0, 240 kModulationQAM16 = 1, 241 kModulationQAM32 = 2, 242 kModulationQAM64 = 3, 243 kModulationQAM128 = 4, 244 kModulationQAM256 = 5, 245 kModulationQAMAuto = 6, 246 kModulation8VSB = 7, 247 kModulation16VSB = 8, 248 kModulation2VSB = 9, 249 kModulation4VSB = 10, 250 kModulationBPSK = 11, 251 kModulation16APSK = 12, 252 kModulation32APSK = 13, 253 kModulation8PSK = 14, 254 kModulation16PSK = 15, 255 kModulationAnalog = 16, /* for analog channel scanner */ 241 kModulationQPSK, 242 kModulationQAM16, 243 kModulationQAM32, 244 kModulationQAM64, 245 kModulationQAM128, 246 kModulationQAM256, 247 kModulationQAMAuto, 248 kModulation8VSB, 249 kModulation16VSB, 250 kModulation16APSK, 251 kModulation32APSK, 252 kModulation8PSK, 253 kModulationDQPSK, 254 kModulationAnalog = 99, /* for analog channel scanner */ 256 255 }; 257 256 258 257 DTVModulation(int _default = kModulationQAMAuto) … … class DTVPolarity : public DTVParamHelper 414 413 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 415 414 }; 416 415 416 class DTVModulationSystem : public DTVParamHelper 417 { 418 protected: 419 static const DTVParamHelperStruct confTable[]; 420 static const DTVParamHelperStruct vdrTable[]; 421 static const DTVParamHelperStruct parseTable[]; 422 static const uint kDBStrCnt = 2; 423 static const char *dbStr[kDBStrCnt]; 424 425 public: 426 enum 427 { 428 kModulationSystemDVBS, 429 kModulationSystemDVBS2, 430 }; 431 432 DTVModulationSystem(int _default = kModulationSystemDVBS) 433 : DTVParamHelper(_default) { } 434 435 bool ParseConf(const QString &_value) 436 { return ParseParam(_value, value, confTable); } 437 bool ParseVDR(const QString &_value) 438 { return ParseParam(_value, value, vdrTable); } 439 bool Parse(const QString &_value) 440 { return ParseParam(_value, value, parseTable); } 441 442 QString toString() const { return toString(value); } 443 444 static QString toString(int _value) 445 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 446 }; 447 448 class DTVRollOff : public DTVParamHelper 449 { 450 protected: 451 static const DTVParamHelperStruct confTable[]; 452 static const DTVParamHelperStruct vdrTable[]; 453 static const DTVParamHelperStruct parseTable[]; 454 static const uint kDBStrCnt = 4; 455 static const char *dbStr[kDBStrCnt]; 456 457 public: 458 enum 459 { 460 kRollOff35, 461 kRollOff20, 462 kRollOff25, 463 kRollOffAuto, 464 }; 465 466 DTVRollOff(int _default = kRollOff35) 467 : DTVParamHelper(_default) { } 468 469 bool ParseConf(const QString &_value) 470 { return ParseParam(_value, value, confTable); } 471 bool ParseVDR(const QString &_value) 472 { return ParseParam(_value, value, vdrTable); } 473 bool Parse(const QString &_value) 474 { return ParseParam(_value, value, parseTable); } 475 476 QString toString() const { return toString(value); } 477 478 static QString toString(int _value) 479 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 480 }; 481 482 class DTVPilot : public DTVParamHelper 483 { 484 protected: 485 static const DTVParamHelperStruct confTable[]; 486 static const DTVParamHelperStruct vdrTable[]; 487 static const DTVParamHelperStruct parseTable[]; 488 static const uint kDBStrCnt = 3; 489 static const char *dbStr[kDBStrCnt]; 490 491 public: 492 enum 493 { 494 kPilotOn, 495 kPilotOff, 496 kPilotAuto, 497 }; 498 499 DTVPilot(int _default = kPilotAuto) 500 : DTVParamHelper(_default) { } 501 502 bool ParseConf(const QString &_value) 503 { return ParseParam(_value, value, confTable); } 504 505 QString toString() const { return toString(value); } 506 507 static QString toString(int _value) 508 { return DTVParamHelper::toString(dbStr, _value, kDBStrCnt); } 509 }; 510 417 511 #endif // _DTVCONFPARSERHELPERS_H_ -
mythtv/libs/libmythtv/dtvmultiplex.cpp
diff --git a/mythtv/libs/libmythtv/dtvmultiplex.cpp b/mythtv/libs/libmythtv/dtvmultiplex.cpp index 5439bfc..35f08dd 100644
a b DTVMultiplex &DTVMultiplex::operator=(const DTVMultiplex &other) 24 24 fec = other.fec; 25 25 mplex = other.mplex; 26 26 sistandard = other.sistandard; 27 msystem = other.msystem; 28 rolloff = other.rolloff; 27 29 sistandard.detach(); 28 30 return *this; 29 31 } … … bool DTVMultiplex::operator==(const DTVMultiplex &m) const 40 42 (guard_interval == m.guard_interval) && 41 43 (fec == m.fec) && 42 44 (polarity == m.polarity) && 43 (hierarchy == m.hierarchy)); 45 (hierarchy == m.hierarchy) && 46 (msystem == m.msystem) && 47 (rolloff == m.rolloff)); 44 48 } 45 49 46 50 /////////////////////////////////////////////////////////////////////////////// … … bool DTVMultiplex::operator==(const DTVMultiplex &m) const 48 52 49 53 QString DTVMultiplex::toString() const 50 54 { 51 QString ret = QString(" %1 %2 %3")52 .arg(frequency).arg(modulation.toString()).arg(inversion.toString()) ;55 QString ret = QString("f: %1 mod: %2 inv: %3 fec: %4") 56 .arg(frequency).arg(modulation.toString()).arg(inversion.toString()).arg(fec.toString()); 53 57 54 ret += QString(" %1 %2 %3 %4 %5 %6 %7")58 ret += QString("hp: %1 lp: %2 bandw: %3 transmode: %4 guardi: %5 hier: %6 polar: %7 msys: %8 rolloff: %9") 55 59 .arg(hp_code_rate.toString()).arg(lp_code_rate.toString()) 56 60 .arg(bandwidth.toString()).arg(trans_mode.toString()) 57 61 .arg(guard_interval.toString()).arg(hierarchy.toString()) 58 .arg(polarity.toString()); 62 .arg(polarity.toString()) 63 .arg(msystem.toString()).arg(rolloff.toString()); 59 64 60 65 return ret; 61 66 } … … bool DTVMultiplex::IsEqual(DTVTunerType type, const DTVMultiplex &other, 102 107 return 103 108 (inversion == other.inversion) && 104 109 (symbolrate == other.symbolrate) && 105 (fec == other.fec); 110 (fec == other.fec) && 111 (msystem == other.msystem) && 112 (rolloff == other.rolloff); 106 113 } 107 114 108 115 return false; … … bool DTVMultiplex::ParseDVB_S_and_C( 182 189 return ok; 183 190 } 184 191 192 bool DTVMultiplex::ParseDVB_S2( 193 const QString &_frequency, const QString &_inversion, 194 const QString &_symbol_rate, const QString &_fec_inner, 195 const QString &_modulation, const QString &_polarity, 196 const QString &_msystem, const QString &_rolloff) 197 { 198 bool ok = inversion.Parse(_inversion); 199 if (!ok) 200 { 201 VERBOSE(VB_GENERAL, LOC_WARN + 202 "Invalid inversion, falling back to 'auto'"); 203 204 ok = true; 205 } 206 207 symbolrate = _symbol_rate.toInt(); 208 if (!symbolrate) 209 { 210 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid symbol rate " + 211 QString("parameter '%1', aborting.").arg(_symbol_rate)); 212 213 return false; 214 } 215 216 ok &= fec.Parse(_fec_inner); 217 ok &= modulation.Parse(_modulation); 218 219 if (!_polarity.isEmpty()) 220 ok &= polarity.Parse(_polarity.toLower()); 221 222 ok &= msystem.Parse(_msystem); 223 224 if (!ok) 225 { 226 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid S2 modulation system " + 227 QString("parameter '%1', aborting.").arg(_symbol_rate)); 228 return false; 229 } 230 231 if (!_rolloff.isEmpty()) 232 ok &= rolloff.Parse(_rolloff); 233 234 if (ok) 235 frequency = _frequency.toInt(&ok); 236 237 return ok; 238 } 239 185 240 bool DTVMultiplex::ParseTuningParams( 186 241 DTVTunerType type, 187 242 QString _frequency, QString _inversion, QString _symbolrate, 188 243 QString _fec, QString _polarity, 189 244 QString _hp_code_rate, QString _lp_code_rate, QString _ofdm_modulation, 190 245 QString _trans_mode, QString _guard_interval, QString _hierarchy, 191 QString _modulation, QString _bandwidth) 246 QString _modulation, QString _bandwidth, 247 QString _msystem, QString _rolloff) 192 248 { 193 249 if (DTVTunerType::kTunerTypeOFDM == type) 194 250 { … … bool DTVMultiplex::ParseTuningParams( 199 255 } 200 256 201 257 if ((DTVTunerType::kTunerTypeQPSK == type) || 202 (DTVTunerType::kTunerTypeDVB_S2 == type) ||203 258 (DTVTunerType::kTunerTypeQAM == type)) 204 259 { 205 260 return ParseDVB_S_and_C( … … bool DTVMultiplex::ParseTuningParams( 207 262 _fec, _modulation, _polarity); 208 263 } 209 264 265 if (DTVTunerType::kTunerTypeDVB_S2 == type) 266 { 267 return ParseDVB_S2( 268 _frequency, _inversion, _symbolrate, 269 _fec, _modulation, _polarity, 270 _msystem, _rolloff); 271 } 272 210 273 if (DTVTunerType::kTunerTypeATSC == type) 211 274 return ParseATSC(_frequency, _modulation); 212 275 … … bool DTVMultiplex::FillFromDB(DTVTunerType type, uint mplexid) 223 286 " fec, polarity, " 224 287 " hp_code_rate, lp_code_rate, constellation, " 225 288 " transmission_mode, guard_interval, hierarchy, " 226 " modulation, bandwidth, sistandard " 289 " modulation, bandwidth, sistandard, " 290 " msystem, rolloff " 227 291 "FROM dtv_multiplex " 228 292 "WHERE dtv_multiplex.mplexid = :MPLEXID"); 229 293 query.bindValue(":MPLEXID", mplexid); … … bool DTVMultiplex::FillFromDB(DTVTunerType type, uint mplexid) 256 320 query.value(6).toString(), query.value(7).toString(), 257 321 query.value(8).toString(), query.value(9).toString(), 258 322 query.value(10).toString(), query.value(11).toString(), 259 query.value(12).toString()); 323 query.value(12).toString(), query.value(14).toString(), 324 query.value(15).toString()); 260 325 } 261 326 262 327 //////////////////////////////////////////////////////////////////////////// … … uint ScanDTVTransport::SaveScan(uint scanid) const 318 383 " mplexid, frequency, inversion, " 319 384 " symbolrate, fec, polarity, " 320 385 " hp_code_rate, lp_code_rate, modulation, " 386 " msystem, rolloff, " 321 387 " transmission_mode, guard_interval, hierarchy, " 322 388 " bandwidth, sistandard, tuner_type " 323 389 " ) " … … uint ScanDTVTransport::SaveScan(uint scanid) const 326 392 " :MPLEXID, :FREQUENCY, :INVERSION, " 327 393 " :SYMBOLRATE, :FEC, :POLARITY, " 328 394 " :HP_CODE_RATE, :LP_CODE_RATE, :MODULATION, " 395 " :MSYSTEM, :ROLLOFF, " 329 396 " :TRANSMISSION_MODE, :GUARD_INTERVAL, :HIERARCHY, " 330 397 " :BANDWIDTH, :SISTANDARD, :TUNER_TYPE " 331 398 " );"); … … uint ScanDTVTransport::SaveScan(uint scanid) const 340 407 query.bindValue(":HP_CODE_RATE", hp_code_rate.toString()); 341 408 query.bindValue(":LP_CODE_RATE", lp_code_rate.toString()); 342 409 query.bindValue(":MODULATION", modulation.toString()); 410 query.bindValue(":MSYSTEM", msystem.toString()); 411 query.bindValue(":ROLLOFF", rolloff.toString()); 343 412 query.bindValue(":TRANSMISSION_MODE", trans_mode.toString()); 344 413 query.bindValue(":GUARD_INTERVAL", guard_interval.toString()); 345 414 query.bindValue(":HIERARCHY", hierarchy.toString()); -
mythtv/libs/libmythtv/dtvmultiplex.h
diff --git a/mythtv/libs/libmythtv/dtvmultiplex.h b/mythtv/libs/libmythtv/dtvmultiplex.h index e793719..28eda98 100644
a b class DTVMultiplex 49 49 const QString &symbol_rate, const QString &fec_inner, 50 50 const QString &modulation, const QString &polarity); 51 51 52 bool ParseDVB_S2( 53 const QString &frequency, const QString &inversion, 54 const QString &symbol_rate, const QString &fec_inner, 55 const QString &modulation, const QString &polarity, 56 const QString &msystem, const QString &rolloff); 57 52 58 bool ParseTuningParams( 53 59 DTVTunerType type, 54 60 QString frequency, QString inversion, QString symbolrate, 55 61 QString fec, QString polarity, 56 62 QString hp_code_rate, QString lp_code_rate, QString constellation, 57 63 QString trans_mode, QString guard_interval, QString hierarchy, 58 QString modulation, QString bandwidth); 64 QString modulation, QString bandwidth, 65 QString msystem, QString rolloff); 59 66 60 67 QString toString() const; 61 68 … … class DTVMultiplex 74 81 DTVHierarchy hierarchy; 75 82 DTVPolarity polarity; 76 83 DTVCodeRate fec; ///< Inner Forward Error Correction rate 84 DTVModulationSystem msystem; 85 DTVRollOff rolloff; 77 86 78 87 // Optional additional info 79 88 uint mplex; -
mythtv/libs/libmythtv/dvbchannel.cpp
diff --git a/mythtv/libs/libmythtv/dvbchannel.cpp b/mythtv/libs/libmythtv/dvbchannel.cpp index 5ed8f60..84f3d98 100644
a b 49 49 50 50 static void drain_dvb_events(int fd); 51 51 static bool wait_for_backend(int fd, int timeout_ms); 52 52 53 static struct dvb_fe_params dtvmultiplex_to_dvbparams( 53 54 DTVTunerType, const DTVMultiplex&); 54 55 static DTVMultiplex dvbparams_to_dtvmultiplex( 55 56 DTVTunerType, const dvb_fe_params&); 56 57 58 static bool dtvmultiplex_to_dtvproperties( 59 DTVTunerType, const DTVMultiplex&, struct dtv_properties*, bool do_tune); 60 61 static bool dtvmultiplex_to_dtvproperties( 62 DTVTunerType, const DTVMultiplex&, struct dtv_properties*); 63 64 static DTVMultiplex dtvproperties_to_dtvmultiplex( 65 DTVTunerType, const dtv_properties&); 66 67 57 68 #define LOC QString("DVBChan(%1:%2): ").arg(GetCardID()).arg(device) 58 69 #define LOC_WARN QString("DVBChan(%1:%2) Warning: ") \ 59 70 .arg(GetCardID()).arg(device) … … bool DVBChannel::Open(DVBChannel *who) 167 178 frontend_name = master->frontend_name; 168 179 card_type = master->card_type; 169 180 capabilities = master->capabilities; 170 ext_modulations = master->ext_modulations;171 181 frequency_minimum = master->frequency_minimum; 172 182 frequency_maximum = master->frequency_maximum; 173 183 symbol_rate_minimum = master->symbol_rate_minimum; … … bool DVBChannel::Open(DVBChannel *who) 210 220 return false; 211 221 } 212 222 213 #ifdef FE_GET_EXTENDED_INFO214 if (info.caps & FE_HAS_EXTENDED_INFO)215 {216 bool ok = true;217 dvb_fe_caps_extended extinfo;218 bzero(&extinfo, sizeof(extinfo));219 if (ioctl(fd_frontend, FE_GET_EXTENDED_INFO, &extinfo) < 0)220 {221 VERBOSE(VB_IMPORTANT, LOC_ERR +222 "Failed to get frontend extended information." + ENO);223 224 ok = false;225 }226 227 if (ok && (extinfo.modulations & MOD_8PSK))228 {229 if (ioctl(fd_frontend, FE_SET_STANDARD, FE_DVB_S2) < 0)230 {231 VERBOSE(VB_IMPORTANT, LOC_ERR +232 "Failed to set frontend standard to DVB-S2." + ENO);233 234 ok = false;235 }236 else if (ioctl(fd_frontend, FE_GET_INFO, &info) < 0)237 {238 VERBOSE(VB_IMPORTANT, LOC_ERR +239 "Failed to get frontend information." + ENO);240 241 ok = false;242 }243 }244 245 if (!ok)246 {247 close(fd_frontend);248 fd_frontend = -1;249 return false;250 }251 252 ext_modulations = extinfo.modulations;253 }254 #endif255 256 223 frontend_name = info.name; 257 card_type = info.type; 224 //card_type = info.type; 225 card_type.Parse(CardUtil::ProbeDVBType(device)); 258 226 capabilities = info.caps; 259 227 frequency_minimum = info.frequency_min; 260 228 frequency_maximum = info.frequency_max; … … bool DVBChannel::Init(QString &inputname, QString &startchannel, bool setchan) 309 277 bool DVBChannel::TuneMultiplex(uint mplexid, QString inputname) 310 278 { 311 279 DTVMultiplex tuning; 312 if (!tuning.FillFromDB(card_type, mplexid)) 280 bool ok = true; 281 //card_type.Parse(CardUtil::ProbeDVBType(inputname)); 282 ok = tuning.FillFromDB(card_type, mplexid); 283 if (!ok) 313 284 return false; 314 285 315 CheckOptions(tuning);286 //CheckOptions(tuning); 316 287 317 288 return Tune(tuning, inputname); 318 289 } … … bool DVBChannel::SetChannelByString(const QString &channum) 365 336 366 337 // Get the input data for the channel 367 338 QString tvformat, modulation, freqtable, freqid, si_std; 339 QString msystem, rolloff; 368 340 int finetune; 369 341 uint64_t frequency; 370 342 int mpeg_prog_num; … … bool DVBChannel::SetChannelByString(const QString &channum) 375 347 tvformat, modulation, freqtable, freqid, 376 348 finetune, frequency, 377 349 si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 350 msystem, rolloff, 378 351 mplexid, commfree)) 379 352 { 380 353 VERBOSE(VB_IMPORTANT, loc_err + … … bool DVBChannel::CheckModulation(DTVModulation modulation) const 596 569 const DTVModulation m = modulation; 597 570 const uint64_t c = capabilities; 598 571 599 #ifdef FE_GET_EXTENDED_INFO600 if ((c & FE_HAS_EXTENDED_INFO) &&601 (DTVModulation::kModulation8PSK == m) &&602 (ext_modulations & DTVModulation::kModulation8PSK))603 {604 return true;605 }606 #endif // FE_GET_EXTENDED_INFO607 608 572 return 609 573 ((DTVModulation::kModulationQPSK == m) && (c & FE_CAN_QPSK)) || 610 574 ((DTVModulation::kModulationQAM16 == m) && (c & FE_CAN_QAM_16)) || … … bool DVBChannel::Tune(const DTVMultiplex &tuning, 680 644 } 681 645 682 646 bool reset = (force_reset || first_tune); 683 struct dvb_fe_params params = dtvmultiplex_to_dvbparams(card_type, tuning); 647 //struct dvb_fe_params params = dtvmultiplex_to_dvbparams(card_type, tuning); 648 649 struct dtv_properties cmds; 650 651 //clear card cache 652 dtv_property props[11]; 653 memset(&props, 0, sizeof(props)); 654 props[0].cmd = DTV_CLEAR; 655 cmds.num = 1; 656 cmds.props = props; 657 if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmds) < 0) 658 { 659 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 660 "Clearing tuner cache failed." + ENO); 661 return false; 662 } 663 664 dtvmultiplex_to_dtvproperties(card_type, tuning, &cmds); 684 665 685 666 bool is_dvbs = (DTVTunerType::kTunerTypeQPSK == card_type || 686 667 DTVTunerType::kTunerTypeDVB_S2 == card_type); … … bool DVBChannel::Tune(const DTVMultiplex &tuning, 737 718 // make sure we tune to frequency, if the lnb has changed 738 719 reset = first_tune = true; 739 720 } 740 741 params.frequency = lnb->GetIntermediateFrequency( 742 diseqc_settings, tuning); 721 722 for (uint i = 0; i < cmds.num; i++) 723 { 724 if (cmds.props[i].cmd == DTV_FREQUENCY) 725 { 726 cmds.props[i].u.data = lnb->GetIntermediateFrequency( 727 diseqc_settings, tuning); 728 break; 729 } 730 } 731 //params.frequency = lnb->GetIntermediateFrequency( 732 // diseqc_settings, tuning); 743 733 744 734 // if card can auto-FEC, use it -- sometimes NITs are inaccurate 745 if (capabilities & FE_CAN_FEC_AUTO)746 params.u.qpsk.fec_inner = FEC_AUTO;735 //if (capabilities & FE_CAN_FEC_AUTO) 736 // params.u.qpsk.fec_inner = FEC_AUTO; 747 737 } 748 738 749 739 VERBOSE(VB_CHANNEL, LOC + "Old Params: " + … … bool DVBChannel::Tune(const DTVMultiplex &tuning, 753 743 754 744 // DVB-S is in kHz, other DVB is in Hz 755 745 int freq_mult = (is_dvbs) ? 1 : 1000; 756 QString suffix = (is_dvbs) ? "kHz" : "Hz";746 //QString suffix = (is_dvbs) ? "kHz" : "Hz"; 757 747 758 748 if (reset || !prev_tuning.IsEqual(card_type, tuning, 500 * freq_mult)) 759 749 { 760 VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 761 .arg(params.frequency).arg(suffix)); 762 763 #ifdef FE_GET_EXTENDED_INFO 764 if (card_type == DTVTunerType::kTunerTypeDVB_S2) 750 //VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 751 // .arg(params.frequency).arg(suffix)); 752 VERBOSE(VB_CHANNEL, LOC + "Tune(): Tuning ..."); 753 //if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 754 VERBOSE(VB_IMPORTANT, "ioctl"); 755 if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmds) < 0) 765 756 { 766 if (ioctl(fd_frontend, FE_SET_FRONTEND2, ¶ms) < 0) 767 { 768 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 769 "Setting Frontend(2) tuning parameters failed." + ENO); 770 return false; 771 } 772 } 773 else 774 #endif // FE_GET_EXTENDED_INFO 775 { 776 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 777 { 778 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 779 "Setting Frontend tuning parameters failed." + ENO); 780 return false; 781 } 757 VERBOSE(VB_IMPORTANT, LOC_ERR + "Tune(): " + 758 "Setting Frontend tuning parameters failed." + ENO); 759 return false; 782 760 } 783 761 784 762 // Extra delay to add for broken DVB drivers … … bool DVBChannel::IsTuningParamsProbeSupported(void) const 835 813 return false; 836 814 } 837 815 838 dvb_fe_params params; 839 return ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) >= 0; 816 //dvb_fe_params params; 817 //return ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) >= 0; 818 struct dtv_properties cmds; 819 cmds.num = 0; 820 return ioctl(fd_frontend, FE_GET_PROPERTY, &cmds) >= 0; 840 821 } 841 822 842 823 /** \fn DVBChannel::ProbeTuningParams(DTVMultiplex&) const … … bool DVBChannel::ProbeTuningParams(DTVMultiplex &tuning) const 868 849 return false; 869 850 } 870 851 871 dvb_fe_params params; 872 if (ioctl(fd_frontend, FE_GET_FRONTEND, ¶ms) < 0) 852 struct dtv_properties cmds; 853 dtv_property props[11]; 854 memset(&props, 0, sizeof(props)); 855 cmds.props = props; 856 dtvmultiplex_to_dtvproperties(card_type, tuning, &cmds, false); 857 if (ioctl(fd_frontend, FE_GET_PROPERTY, &cmds) < 0) 873 858 { 874 859 VERBOSE(VB_IMPORTANT, LOC_ERR + 875 860 "Getting Frontend tuning parameters failed." + ENO); … … bool DVBChannel::ProbeTuningParams(DTVMultiplex &tuning) const 880 865 uint mplex = tuning.mplex; 881 866 QString sistandard = tuning.sistandard; sistandard.detach(); 882 867 883 tuning = d vbparams_to_dtvmultiplex(card_type, params);868 tuning = dtvproperties_to_dtvmultiplex(card_type, cmds); 884 869 885 870 tuning.mplex = mplex; 886 871 tuning.sistandard = sistandard; … … static bool wait_for_backend(int fd, int timeout_ms) 1094 1079 return true; 1095 1080 } 1096 1081 1097 static struct dvb_fe_params dtvmultiplex_to_dvbparams(1098 DTVTunerType tuner_type, const DTVMultiplex &tuning)1099 {1100 dvb_fe_params params;1101 bzero(¶ms, sizeof(params));1102 1103 params.frequency = tuning.frequency;1104 params.inversion = (fe_spectral_inversion_t) (int) tuning.inversion;1105 1106 if (DTVTunerType::kTunerTypeQPSK == tuner_type)1107 {1108 params.u.qpsk.symbol_rate = tuning.symbolrate;1109 params.u.qpsk.fec_inner = (fe_code_rate_t) (int) tuning.fec;1110 }1111 1112 if (DTVTunerType::kTunerTypeDVB_S2 == tuner_type)1113 {1114 #ifdef FE_GET_EXTENDED_INFO1115 params.u.qpsk2.symbol_rate = tuning.symbolrate;1116 params.u.qpsk2.fec_inner = (fe_code_rate_t) (int) tuning.fec;1117 params.u.qpsk2.modulation = (fe_modulation_t) (int) tuning.modulation;1118 #else // if !FE_GET_EXTENDED_INFO1119 VERBOSE(VB_IMPORTANT, "DVBChan Error, MythTV was compiled without "1120 "DVB-S2 headers being present so DVB-S2 tuning will fail.");1121 #endif // !FE_GET_EXTENDED_INFO1122 }1123 1124 if (DTVTunerType::kTunerTypeQAM == tuner_type)1125 {1126 params.u.qam.symbol_rate = tuning.symbolrate;1127 params.u.qam.fec_inner = (fe_code_rate_t) (int) tuning.fec;1128 params.u.qam.modulation = (fe_modulation_t) (int) tuning.modulation;1129 }1130 1082 1131 if (DTVTunerType::kTunerTypeOFDM == tuner_type) 1132 { 1133 params.u.ofdm.bandwidth = 1134 (fe_bandwidth_t) (int) tuning.bandwidth; 1135 params.u.ofdm.code_rate_HP = 1136 (fe_code_rate_t) (int) tuning.hp_code_rate; 1137 params.u.ofdm.code_rate_LP = 1138 (fe_code_rate_t) (int) tuning.lp_code_rate; 1139 params.u.ofdm.constellation = 1140 (fe_modulation_t) (int) tuning.modulation; 1141 params.u.ofdm.transmission_mode = 1142 (fe_transmit_mode_t) (int) tuning.trans_mode; 1143 params.u.ofdm.guard_interval = 1144 (fe_guard_interval_t) (int) tuning.guard_interval; 1145 params.u.ofdm.hierarchy_information = 1146 (fe_hierarchy_t) (int) tuning.hierarchy; 1147 } 1083 static DTVMultiplex dtvproperties_to_dtvmultiplex( 1084 DTVTunerType tuner_type, const dtv_properties &cmds) 1085 { 1086 DTVMultiplex tuning; 1148 1087 1149 if (DTVTunerType::kTunerTypeATSC == tuner_type)1088 for (uint i = 0; i < cmds.num; i++) 1150 1089 { 1090 switch (cmds.props[i].cmd) 1091 { 1092 case DTV_MODULATION: 1093 tuning.modulation = cmds.props[i].u.data; 1094 break; 1095 case DTV_DELIVERY_SYSTEM: 1096 switch (cmds.props[i].u.data) 1097 { 1098 case SYS_DVBS: 1099 tuning.msystem = DTVModulationSystem::kModulationSystemDVBS; 1100 break; 1101 case SYS_DVBS2: 1102 tuning.msystem = DTVModulationSystem::kModulationSystemDVBS2; 1103 break; 1104 case SYS_DVBT: 1105 case SYS_DVBC_ANNEX_AC: 1106 case SYS_DVBC_ANNEX_B: 1151 1107 #ifdef USE_ATSC 1152 params.u.vsb.modulation = 1153 (fe_modulation_t) (int) tuning.modulation; 1154 #endif // USE_ATSC 1108 case SYS_ATSC: 1109 #endif 1110 break; 1111 default: 1112 VERBOSE(VB_IMPORTANT, "Unknown DVB delivery system." + ENO); 1113 }; 1114 break; 1115 case DTV_FREQUENCY: 1116 if (tuning.modulation == DTVModulation::kModulationQPSK || 1117 tuning.modulation == DTVModulation::kModulation8PSK) 1118 tuning.frequency = cmds.props[i].u.data / 1000UL; 1119 else 1120 tuning.frequency = cmds.props[i].u.data; 1121 break; 1122 case DTV_SYMBOL_RATE: 1123 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1124 tuner_type == DTVTunerType::kTunerTypeDVB_S2 || 1125 tuner_type == DTVTunerType::kTunerTypeQAM) 1126 { 1127 if (tuning.modulation == DTVModulation::kModulationQPSK || 1128 tuning.modulation == DTVModulation::kModulation8PSK) 1129 tuning.symbolrate = cmds.props[i].u.data / 1000UL; 1130 else 1131 tuning.symbolrate = cmds.props[i].u.data; 1132 }; 1133 break; 1134 case DTV_INNER_FEC: 1135 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1136 tuner_type == DTVTunerType::kTunerTypeDVB_S2 || 1137 tuner_type == DTVTunerType::kTunerTypeQAM) 1138 { 1139 tuning.symbolrate = cmds.props[i].u.data; 1140 } 1141 break; 1142 case DTV_PILOT: 1143 break; 1144 case DTV_ROLLOFF: 1145 if (tuner_type == DTVTunerType::kTunerTypeDVB_S2) 1146 tuning.rolloff = cmds.props[i].u.data; 1147 break; 1148 case DTV_INVERSION: 1149 tuning.inversion = cmds.props[i].u.data; 1150 break; 1151 case DTV_BANDWIDTH_HZ: 1152 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1153 tuning.bandwidth = cmds.props[i].u.data; 1154 break; 1155 case DTV_CODE_RATE_HP: 1156 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1157 tuning.hp_code_rate = cmds.props[i].u.data; 1158 break; 1159 case DTV_CODE_RATE_LP: 1160 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1161 tuning.lp_code_rate = cmds.props[i].u.data; 1162 break; 1163 case DTV_TRANSMISSION_MODE: 1164 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1165 tuning.trans_mode = cmds.props[i].u.data; 1166 break; 1167 case DTV_GUARD_INTERVAL: 1168 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1169 tuning.guard_interval = cmds.props[i].u.data; 1170 break; 1171 case DTV_HIERARCHY: 1172 if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1173 tuning.hierarchy = cmds.props[i].u.data; 1174 break; 1175 case DTV_TUNE: 1176 break; 1177 default: 1178 VERBOSE(VB_IMPORTANT, "Unknown DTV command." + ENO); 1179 } 1155 1180 } 1156 1157 return params; 1181 return tuning; 1158 1182 } 1159 1183 1160 static DTVMultiplex dvbparams_to_dtvmultiplex( 1161 DTVTunerType tuner_type, const dvb_fe_params ¶ms) 1184 static bool dtvmultiplex_to_dtvproperties( 1185 DTVTunerType tuner_type, 1186 const DTVMultiplex &tuning, 1187 struct dtv_properties *cmdseq) 1162 1188 { 1163 DTVMultiplex tuning; 1164 1165 tuning.frequency = params.frequency; 1166 tuning.inversion = params.inversion; 1189 return dtvmultiplex_to_dtvproperties(tuner_type, tuning, cmdseq, true); 1190 } 1167 1191 1168 if ((DTVTunerType::kTunerTypeQPSK == tuner_type) || 1169 (DTVTunerType::kTunerTypeDVB_S2 == tuner_type)) 1192 static bool dtvmultiplex_to_dtvproperties( 1193 DTVTunerType tuner_type, 1194 const DTVMultiplex &tuning, 1195 struct dtv_properties *cmdseq, 1196 bool do_tune) 1197 { 1198 VERBOSE(VB_IMPORTANT, tuner_type.toString()); 1199 if (tuner_type == DTVTunerType::kTunerTypeQPSK || 1200 (tuner_type == DTVTunerType::kTunerTypeDVB_S2 && 1201 tuning.msystem == DTVModulationSystem::kModulationSystemDVBS)) 1170 1202 { 1171 tuning.symbolrate = params.u.qpsk.symbol_rate; 1172 tuning.fec = params.u.qpsk.fec_inner; 1203 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1204 cmdseq->props[0].u.data = SYS_DVBS; 1205 cmdseq->props[1].cmd = DTV_FREQUENCY; 1206 cmdseq->props[1].u.data = tuning.frequency; 1207 cmdseq->props[2].cmd = DTV_MODULATION; 1208 cmdseq->props[2].u.data = QPSK; 1209 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1210 cmdseq->props[3].u.data = tuning.symbolrate; 1211 cmdseq->props[4].cmd = DTV_INNER_FEC; 1212 cmdseq->props[4].u.data = (fe_code_rate_t) (int) tuning.fec; 1213 cmdseq->props[5].cmd = DTV_INVERSION; 1214 cmdseq->props[5].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1215 if (do_tune) 1216 { 1217 cmdseq->props[6].cmd = DTV_TUNE; 1218 cmdseq->num = 7; 1219 } 1220 else 1221 { 1222 cmdseq->num = 6; 1223 } 1173 1224 } 1174 1175 if (DTVTunerType::kTunerTypeQAM == tuner_type)1225 else if (tuner_type == DTVTunerType::kTunerTypeDVB_S2 && 1226 tuning.msystem == DTVModulationSystem::kModulationSystemDVBS2) 1176 1227 { 1177 tuning.symbolrate = params.u.qam.symbol_rate; 1178 tuning.fec = params.u.qam.fec_inner; 1179 tuning.modulation = params.u.qam.modulation; 1228 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1229 cmdseq->props[0].u.data = SYS_DVBS2; 1230 cmdseq->props[1].cmd = DTV_FREQUENCY; 1231 cmdseq->props[1].u.data = tuning.frequency; 1232 cmdseq->props[2].cmd = DTV_MODULATION; 1233 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1234 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1235 cmdseq->props[3].u.data = tuning.symbolrate; 1236 cmdseq->props[4].cmd = DTV_INNER_FEC; 1237 cmdseq->props[4].u.data = (fe_code_rate_t) (int) tuning.fec; 1238 cmdseq->props[5].cmd = DTV_INVERSION; 1239 cmdseq->props[5].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1240 cmdseq->props[6].cmd = DTV_PILOT; 1241 cmdseq->props[6].u.data = PILOT_AUTO; 1242 cmdseq->props[7].cmd = DTV_ROLLOFF; 1243 cmdseq->props[7].u.data = (fe_rolloff_t) (int) tuning.rolloff; 1244 1245 if (do_tune) 1246 { 1247 cmdseq->props[8].cmd = DTV_TUNE; 1248 cmdseq->num = 9; 1249 } 1250 else 1251 cmdseq->num = 8; 1180 1252 } 1181 1182 if (DTVTunerType::kTunerTypeOFDM == tuner_type) 1253 else if (tuner_type == DTVTunerType::kTunerTypeQAM) 1183 1254 { 1184 tuning.bandwidth = params.u.ofdm.bandwidth; 1185 tuning.hp_code_rate = params.u.ofdm.code_rate_HP; 1186 tuning.lp_code_rate = params.u.ofdm.code_rate_LP; 1187 tuning.modulation = params.u.ofdm.constellation; 1188 tuning.trans_mode = params.u.ofdm.transmission_mode; 1189 tuning.guard_interval = params.u.ofdm.guard_interval; 1190 tuning.hierarchy = params.u.ofdm.hierarchy_information; 1255 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1256 cmdseq->props[0].u.data = (fe_delivery_system_t) (int) tuning.msystem; 1257 cmdseq->props[1].cmd = DTV_FREQUENCY; 1258 cmdseq->props[1].u.data = tuning.frequency; 1259 cmdseq->props[2].cmd = DTV_MODULATION; 1260 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1261 cmdseq->props[3].cmd = DTV_SYMBOL_RATE; 1262 cmdseq->props[3].u.data = tuning.symbolrate; 1263 cmdseq->props[4].cmd = DTV_INNER_FEC; 1264 cmdseq->props[4].u.data = (fe_code_rate_t) (int) tuning.fec; 1265 cmdseq->props[5].cmd = DTV_INVERSION; 1266 cmdseq->props[5].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1267 if (do_tune) 1268 { 1269 cmdseq->props[6].cmd = DTV_TUNE; 1270 cmdseq->num = 7; 1271 } 1272 else 1273 cmdseq->num = 6; 1191 1274 } 1192 1193 if (DTVTunerType::kTunerTypeATSC == tuner_type) 1275 else if (tuner_type == DTVTunerType::kTunerTypeOFDM) 1194 1276 { 1277 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1278 cmdseq->props[0].u.data = SYS_DVBC_ANNEX_AC; 1279 cmdseq->props[1].cmd = DTV_FREQUENCY; 1280 cmdseq->props[1].u.data = tuning.frequency; 1281 cmdseq->props[2].cmd = DTV_MODULATION; 1282 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation; 1283 cmdseq->props[3].cmd = DTV_INVERSION; 1284 cmdseq->props[3].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1285 cmdseq->props[4].cmd = DTV_BANDWIDTH_HZ; 1286 cmdseq->props[4].u.data = (fe_bandwidth_t) (int) tuning.bandwidth; 1287 cmdseq->props[5].cmd = DTV_CODE_RATE_HP; 1288 cmdseq->props[5].u.data = (fe_code_rate_t) (int) tuning.hp_code_rate; 1289 cmdseq->props[6].cmd = DTV_CODE_RATE_LP; 1290 cmdseq->props[6].u.data = (fe_code_rate_t) (int) tuning.lp_code_rate; 1291 cmdseq->props[7].cmd = DTV_TRANSMISSION_MODE; 1292 cmdseq->props[7].u.data = (fe_transmit_mode_t) (int) tuning.trans_mode; 1293 cmdseq->props[8].cmd = DTV_GUARD_INTERVAL; 1294 cmdseq->props[8].u.data = (fe_guard_interval_t) (int) tuning.guard_interval; 1295 cmdseq->props[9].cmd = DTV_HIERARCHY; 1296 cmdseq->props[9].u.data = (fe_hierarchy_t) (int) tuning.hierarchy; 1297 if (do_tune) 1298 { 1299 cmdseq->props[10].cmd = DTV_TUNE; 1300 cmdseq->num = 11; 1301 } 1302 else 1303 cmdseq->num = 10; 1304 } 1195 1305 #ifdef USE_ATSC 1196 tuning.modulation = params.u.vsb.modulation; 1197 #endif // USE_ATSC 1306 else if (tuner_type == DTVTunerType::kTunerTypeATSC) 1307 { 1308 cmdseq->props[0].cmd = DTV_DELIVERY_SYSTEM; 1309 cmdseq->props[0].u.data = SYS_ATSC; 1310 cmdseq->props[1].cmd = DTV_FREQUENCY; 1311 cmdseq->props[1].u.data = tuning.frequency * 1000UL; 1312 cmdseq->props[2].cmd = DTV_MODULATION; 1313 cmdseq->props[2].u.data = (fe_modulation_t) (int) tuning.modulation;; 1314 cmdseq->props[3].cmd = DTV_INVERSION; 1315 cmdseq->props[3].u.data = (fe_spectral_inversion_t) (int) tuning.inversion; 1316 if (do_tune) 1317 { 1318 cmdseq->props[4].cmd = DTV_TUNE; 1319 cmdseq->num = 5; 1320 } 1321 else 1322 cmdseq->num = 4; 1198 1323 } 1199 1200 return tuning; 1324 #endif 1325 else 1326 { 1327 VERBOSE(VB_IMPORTANT, "Unknown tuner type." + ENO); 1328 } 1329 return true; 1201 1330 } 1331 -
mythtv/libs/libmythtv/dvbchannel.h
diff --git a/mythtv/libs/libmythtv/dvbchannel.h b/mythtv/libs/libmythtv/dvbchannel.h index 83e1f23..6e0aeca 100644
a b class DVBChannel : public DTVChannel 117 117 QString frontend_name; 118 118 DTVTunerType card_type; 119 119 uint64_t capabilities; 120 uint64_t ext_modulations;121 120 uint64_t frequency_minimum; 122 121 uint64_t frequency_maximum; 123 122 uint symbol_rate_minimum; -
mythtv/libs/libmythtv/dvbtypes.h
diff --git a/mythtv/libs/libmythtv/dvbtypes.h b/mythtv/libs/libmythtv/dvbtypes.h index 6dd0443..d4647b6 100644
a b 19 19 #include <linux/dvb/frontend.h> 20 20 #include <linux/dvb/dmx.h> 21 21 22 #if (DVB_API_VERSION != 3 )23 # error "DVB driver includes with API version 3not found!"22 #if (DVB_API_VERSION != 3 && DVB_API_VERSION != 5) 23 # error "DVB driver includes with correct API version not found!" 24 24 #endif 25 25 26 26 #ifndef DVB_API_VERSION_MINOR 27 27 # define DVB_API_VERSION_MINOR 0 28 28 #endif 29 29 30 #if ( DVB_API_VERSION >= 3 && DVB_API_VERSION_MINOR >= 1)30 #if ((DVB_API_VERSION >= 3 && DVB_API_VERSION_MINOR >= 1) || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 0)) 31 31 # define USE_ATSC 32 32 #else 33 33 #warning DVB API version < 3.1 … … 39 39 # define VSB_16 (fe_modulation)(QAM_AUTO+2) 40 40 #endif 41 41 42 #ifdef FE_GET_EXTENDED_INFO 43 #define dvb_fe_params dvb_frontend_parameters_new 44 #else 45 #define dvb_fe_params dvb_frontend_parameters 46 #endif 42 #define dvb_fe_params dvb_frontend_parameters 47 43 48 44 class QString; 49 45 QString toString(fe_status); -
mythtv/libs/libmythtv/firewirechannel.cpp
diff --git a/mythtv/libs/libmythtv/firewirechannel.cpp b/mythtv/libs/libmythtv/firewirechannel.cpp index 65771f4..cc50d7e 100644
a b bool FirewireChannel::SetChannelByString(const QString &channum) 60 60 61 61 // Fetch tuning data from the database. 62 62 QString tvformat, modulation, freqtable, freqid, dtv_si_std; 63 QString msystem, rolloff; 63 64 int finetune; 64 65 uint64_t frequency; 65 66 int mpeg_prog_num; … … bool FirewireChannel::SetChannelByString(const QString &channum) 70 71 tvformat, modulation, freqtable, freqid, 71 72 finetune, frequency, 72 73 dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 74 msyste, rolloff, 73 75 mplexid, commfree)) 74 76 { 75 77 VERBOSE(VB_IMPORTANT, loc + " " + QString( -
mythtv/libs/libmythtv/frequencytables.cpp
diff --git a/mythtv/libs/libmythtv/frequencytables.cpp b/mythtv/libs/libmythtv/frequencytables.cpp index 2657e79..7a802b9 100644
a b TransportScanItem::TransportScanItem(uint _sourceid, 68 68 _tuning.lp_code_rate.toString(), _tuning.modulation.toString(), 69 69 _tuning.trans_mode.toString(), _tuning.guard_interval.toString(), 70 70 _tuning.hierarchy.toString(), _tuning.modulation.toString(), 71 _tuning.bandwidth.toString()); 71 _tuning.bandwidth.toString(), _tuning.msystem.toString(), 72 _tuning.rolloff.toString()); 72 73 } 73 74 74 75 TransportScanItem::TransportScanItem(uint sourceid, -
mythtv/libs/libmythtv/hdhrchannel.cpp
diff --git a/mythtv/libs/libmythtv/hdhrchannel.cpp b/mythtv/libs/libmythtv/hdhrchannel.cpp index bf5b357..420cab3 100644
a b bool HDHRChannel::SetChannelByString(const QString &channum) 291 291 292 292 // Fetch tuning data from the database. 293 293 QString tvformat, modulation, freqtable, freqid, si_std; 294 QString msystem, rolloff; 294 295 int finetune; 295 296 uint64_t frequency; 296 297 int mpeg_prog_num; … … bool HDHRChannel::SetChannelByString(const QString &channum) 301 302 tvformat, modulation, freqtable, freqid, 302 303 finetune, frequency, 303 304 si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 305 msystem, rolloff, 304 306 mplexid, commfree)) 305 307 { 306 308 return false; … … bool HDHRChannel::TuneMultiplex(uint mplexid, QString inputname) 369 371 uint64_t frequency; 370 372 uint transportid; 371 373 uint dvb_networkid; 374 QString dvb_msystem; 375 QString dvb_rolloff; 372 376 373 377 if (!ChannelUtil::GetTuningParams( 374 378 mplexid, modulation, frequency, 375 transportid, dvb_networkid, si_std)) 379 transportid, dvb_networkid, 380 dvb_msystem, dvb_rolloff, si_std)) 376 381 { 377 382 VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneMultiplex(): " + 378 383 QString("Could not find tuning parameters for multiplex %1.") -
mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp
diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp index 592969a..bf26a82 100644
a b QString SatelliteDeliverySystemDescriptor::toString() const 369 369 QString str = QString("SatelliteDeliverySystemDescriptor: "); 370 370 371 371 str.append(QString("Frequency: %1\n").arg(FrequencyHz())); 372 str.append(QString(" Mod=%1, SymbR=%2, FECInner=%3, Orbit=%4, Pol=%5") 372 str.append(QString(" ModSys=%1, Mod=%2, RollOff=%3. SymbR=%4, FECInner=%5, Orbit=%6, Pol=%7") 373 .arg(ModulationSystemString()) 373 374 .arg(ModulationString()) 375 .arg(RollOffString()) 374 376 .arg(SymbolRateHz()) 375 377 .arg(FECInnerString()) 376 378 .arg(OrbitalPositionString()) -
mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h index 4128176..f0bba31 100644
a b class SatelliteDeliverySystemDescriptor : public MPEGDescriptor 745 745 bool IsLinearPolarization() const { return !((_data[8]>>6)&0x1); } 746 746 bool IsHorizontalLeftPolarization() const { return (_data[8]>>5)&0x1; } 747 747 bool IsVerticalRightPolarization() const { return !((_data[8]>>5)&0x1); } 748 // modulation 5 8.3 748 // rolloff 2 8.3 749 uint RollOff() const { return (_data[8]>>3)&0x3; } 750 QString RollOffString() const 751 { 752 static QString ps[] = { "0.35", "0.20", "0.25", "AUTO" }; 753 return ps[Polarization()]; 754 } 755 // modulation system 3 8.5 756 enum 757 { 758 kModulationSystemDVBS = 0x0, 759 kModulationSystemDVBS2 = 0x1, 760 }; 761 uint ModulationSystem() const { return _data[8]>>2&0x1; } 762 QString ModulationSystemString() const 763 { 764 static QString mss[] = { "dvbs", "dvbs2" }; 765 return (mss[ModulationSystem()]); 766 } 767 // modulation 4 8.6 768 749 769 enum 750 770 { 751 771 kModulationQPSK_NS = 0x0, // Non standard QPSK for Bell ExpressVu … … class SatelliteDeliverySystemDescriptor : public MPEGDescriptor 753 773 kModulation8PSK = 0x2, 754 774 kModulationQAM16 = 0x3, 755 775 }; 756 uint Modulation() const { return _data[8]&0x 1f; }776 uint Modulation() const { return _data[8]&0x7; } 757 777 QString ModulationString() const 758 778 { 759 779 static QString ms[] = { "qpsk", "qpsk", "8psk", "qam_16" }; … … class SatelliteDeliverySystemDescriptor : public MPEGDescriptor 779 799 kInnerFEC_5_6_ConvolutionCodeRate = 0x4, 780 800 kInnerFEC_7_8_ConvolutionCodeRate = 0x5, 781 801 kInnerFEC_8_9_ConvolutionCodeRate = 0x6, 802 kInnerFEC_3_5_ConvolutionCodeRate = 0x7, 803 kInnerFEC_4_5_ConvolutionCodeRate = 0x8, 804 kInnerFEC_9_10_ConvolutionCodeRate = 0x9, 805 kInnerFEC_Auto = 0xA, 782 806 kInnerFEC_None = 0xF, 783 807 }; 784 808 uint FECInner() const { return _data[12] & 0xf; } … … static QString coderate_inner(uint cr) 1756 1780 { 1757 1781 switch (cr) 1758 1782 { 1759 case 0x0: return " auto"; // not actually defined in spec1783 case 0x0: return "none"; // not actually defined in spec 1760 1784 case 0x1: return "1/2"; 1761 1785 case 0x2: return "2/3"; 1762 1786 case 0x3: return "3/4"; 1763 1787 case 0x4: return "5/6"; 1764 1788 case 0x5: return "7/8"; 1765 case 0x8: return "8/9"; 1789 case 0x6: return "8/9"; 1790 case 0x7: return "3/5"; 1791 case 0x8: return "4/5"; 1792 case 0x9: return "9/10"; 1766 1793 case 0xf: return "none"; 1767 1794 default: return "auto"; // not actually defined in spec 1768 1795 } -
mythtv/libs/libmythtv/scanwizard.cpp
diff --git a/mythtv/libs/libmythtv/scanwizard.cpp b/mythtv/libs/libmythtv/scanwizard.cpp index c912160..a0843e3 100644
a b void ScanWizard::SetPage(const QString &pageTitle) 98 98 start_chan = configPane->GetStartChan(); 99 99 parse_type = DTVTunerType::kTunerTypeQPSK; 100 100 } 101 else if (scantype == ScanTypeSetting::NITAddScan_DVBS2) 102 { 103 start_chan = configPane->GetStartChan(); 104 parse_type = DTVTunerType::kTunerTypeDVB_S2; 105 } 101 106 else if (scantype == ScanTypeSetting::NITAddScan_QAM) 102 107 { 103 108 start_chan = configPane->GetStartChan(); … … void ScanWizard::SetPage(const QString &pageTitle) 139 144 start_chan["coderate_hp"], start_chan["coderate_lp"], 140 145 start_chan["constellation"], start_chan["trans_mode"], 141 146 start_chan["guard_interval"], start_chan["hierarchy"], 142 start_chan["modulation"], start_chan["bandwidth"])) 147 start_chan["modulation"], start_chan["bandwidth"], 148 start_chan["msystem"], start_chan["rolloff"])) 143 149 { 144 150 MythPopupBox::showOkPopup( 145 151 gContext->GetMainWindow(), tr("ScanWizard"), -
mythtv/libs/libmythtv/scanwizardhelpers.cpp
diff --git a/mythtv/libs/libmythtv/scanwizardhelpers.cpp b/mythtv/libs/libmythtv/scanwizardhelpers.cpp index 6eaf97e..0faf71d 100644
a b void ScanTypeSetting::SetInput(const QString &cardids_inputname) 455 455 addSelection(tr("Import channels.conf"), 456 456 QString::number(DVBUtilsImport)); 457 457 break; 458 case CardUtil::DVBS2: 459 addSelection(tr("Full Scan (Tuned)"), 460 QString::number(NITAddScan_DVBS2)); 461 addSelection(tr("Import channels.conf"), 462 QString::number(DVBUtilsImport)); 463 break; 458 464 case CardUtil::QAM: 459 465 addSelection(tr("Full Scan (Tuned)"), 460 466 QString::number(NITAddScan_QAM)); … … ScanOptionalConfig::ScanOptionalConfig(ScanTypeSetting *_scan_type) : 574 580 paneQAM); 575 581 addTarget(QString::number(ScanTypeSetting::NITAddScan_QPSK), 576 582 paneQPSK); 583 addTarget(QString::number(ScanTypeSetting::NITAddScan_DVBS2), 584 paneDVBS2); 577 585 addTarget(QString::number(ScanTypeSetting::NITAddScan_OFDM), 578 586 paneOFDM); 579 587 addTarget(QString::number(ScanTypeSetting::FullScan_ATSC), … … QMap<QString,QString> ScanOptionalConfig::GetStartChan(void) const 766 774 startChan["modulation"] = "qpsk"; 767 775 startChan["polarity"] = pane->polarity(); 768 776 } 777 else if (ScanTypeSetting::NITAddScan_DVBS2 == st) 778 { 779 const DVBS2Pane *pane = paneDVBS2; 780 781 startChan["std"] = "dvb"; 782 startChan["frequency"] = pane->frequency(); 783 startChan["inversion"] = pane->inversion(); 784 startChan["symbolrate"] = pane->symbolrate(); 785 startChan["fec"] = pane->fec(); 786 startChan["msystem"] = pane->msystem(); 787 startChan["modulation"] = pane->modulation(); 788 startChan["polarity"] = pane->polarity(); 789 startChan["rolloff"] = pane->rolloff(); 790 } 769 791 else if (ScanTypeSetting::NITAddScan_QAM == st) 770 792 { 771 793 const QAMPane *pane = paneQAM; -
mythtv/libs/libmythtv/scanwizardhelpers.h
diff --git a/mythtv/libs/libmythtv/scanwizardhelpers.h b/mythtv/libs/libmythtv/scanwizardhelpers.h index ba68ebf..3e4b2be 100644
a b class ScanTypeSetting : public ComboBoxSetting, public TransientStorage 243 243 // seen in the Network Information Tables to the scan. 244 244 NITAddScan_OFDM, 245 245 NITAddScan_QPSK, 246 NITAddScan_DVBS2, 246 247 NITAddScan_QAM, 247 248 // Scan of all transports already in the database 248 249 FullTransportScan, … … class ScanOptionalConfig : public TriggeredConfigurationGroup 274 275 QString GetATSCFormat(const QString&) const; 275 276 QString GetFrequencyStandard(void) const; 276 277 QString GetModulation(void) const; 278 QString GetRollOff(void) const; 277 279 QString GetFrequencyTable(void) const; 278 280 bool DoIgnoreSignalTimeout(void) const; 279 281 QString GetFilename(void) const; … … class ScanModulationSetting: public ComboBoxSetting 510 512 { 511 513 addSelection(QObject::tr("Auto"),"auto",true); 512 514 addSelection("QPSK","qpsk"); 513 #ifdef FE_GET_EXTENDED_INFO514 515 addSelection("8PSK","8psk"); 515 #endif516 516 addSelection("QAM 16","qam_16"); 517 517 addSelection("QAM 32","qam_32"); 518 518 addSelection("QAM 64","qam_64"); … … class ScanModulation: public ScanModulationSetting, public TransientStorage 531 531 }; 532 532 }; 533 533 534 class ScanModulationSystemSetting: public ComboBoxSetting 535 { 536 public: 537 ScanModulationSystemSetting(Storage *_storage) : ComboBoxSetting(_storage) 538 { 539 addSelection("DVB-S","dvbs",true); 540 addSelection("DVB-S2","dvbs2"); 541 }; 542 }; 543 544 class ScanModulationSystem: public ScanModulationSystemSetting, public TransientStorage 545 { 546 public: 547 ScanModulationSystem() : ScanModulationSystemSetting(this) 548 { 549 setLabel(QObject::tr("Modul. System")); 550 setHelpText(QObject::tr("Modulation System (Default: DVB-S)")); 551 }; 552 }; 553 554 class ScanRollOffSetting: public ComboBoxSetting 555 { 556 public: 557 ScanRollOffSetting(Storage *_storage) : ComboBoxSetting(_storage) 558 { 559 addSelection(QObject::tr("Auto"),"auto"); 560 addSelection("0.35","0.35",true); 561 addSelection("0.20","0.20"); 562 addSelection("0.25","0.25"); 563 }; 564 }; 565 566 class ScanRollOff: public ScanRollOffSetting, public TransientStorage 567 { 568 public: 569 ScanRollOff() : ScanRollOffSetting(this) 570 { 571 setLabel(QObject::tr("RollOff")); 572 setHelpText(QObject::tr("RollOff (Default: 0.35)")); 573 }; 574 }; 575 534 576 class ScanConstellation: public ScanModulationSetting, 535 577 public TransientStorage 536 578 { … … class ScanFecSetting: public ComboBoxSetting 552 594 addSelection("1/2"); 553 595 addSelection("2/3"); 554 596 addSelection("3/4"); 597 addSelection("3/5"); 555 598 addSelection("4/5"); 556 599 addSelection("5/6"); 557 600 addSelection("6/7"); 558 601 addSelection("7/8"); 559 602 addSelection("8/9"); 603 addSelection("9/10"); 560 604 } 561 605 }; 562 606 … … class DVBS2Pane : public HorizontalConfigurationGroup 692 736 left->addChild( pfrequency = new ScanFrequency()); 693 737 left->addChild( ppolarity = new ScanPolarity()); 694 738 left->addChild( psymbolrate = new ScanSymbolRate()); 695 right->addChild(pfec = new ScanFec()); 739 left->addChild(pfec = new ScanFec()); 740 right->addChild(pmsystem = new ScanModulationSystem()); 696 741 right->addChild(pmodulation = new ScanModulation()); 697 742 right->addChild(pinversion = new ScanInversion()); 743 right->addChild(prolloff = new ScanRollOff()); 698 744 addChild(left); 699 745 addChild(right); 700 746 } … … class DVBS2Pane : public HorizontalConfigurationGroup 704 750 QString inversion(void) const { return pinversion->getValue(); } 705 751 QString fec(void) const { return pfec->getValue(); } 706 752 QString polarity(void) const { return ppolarity->getValue(); } 753 QString msystem(void) const { return pmsystem->getValue(); } 707 754 QString modulation(void) const { return pmodulation->getValue(); } 755 QString rolloff(void) const { return prolloff->getValue(); } 708 756 709 757 protected: 710 758 ScanFrequency *pfrequency; … … class DVBS2Pane : public HorizontalConfigurationGroup 713 761 ScanFec *pfec; 714 762 ScanPolarity *ppolarity; 715 763 ScanModulation *pmodulation; 764 ScanModulationSystem *pmsystem; 765 ScanRollOff *prolloff; 716 766 }; 717 767 718 768 class QPSKPane : public HorizontalConfigurationGroup -
mythtv/libs/libmythtv/scanwizardscanner.cpp
diff --git a/mythtv/libs/libmythtv/scanwizardscanner.cpp b/mythtv/libs/libmythtv/scanwizardscanner.cpp index 1190baa..ae5be77 100644
a b void ScanWizardScanner::Scan( 364 364 } 365 365 else if ((ScanTypeSetting::NITAddScan_OFDM == scantype) || 366 366 (ScanTypeSetting::NITAddScan_QPSK == scantype) || 367 (ScanTypeSetting::NITAddScan_DVBS2 == scantype) || 367 368 (ScanTypeSetting::NITAddScan_QAM == scantype)) 368 369 { 369 370 VERBOSE(VB_SIPARSER, LOC + "ScanTransports()"); … … void ScanWizardScanner::PreScanCommon(int scantype, 490 491 QString sub_type = CardUtil::ProbeDVBType(device).toUpper(); 491 492 bool need_nit = (("QAM" == sub_type) || 492 493 ("QPSK" == sub_type) || 494 ("DVB_S2" == sub_type) || 493 495 ("OFDM" == sub_type)); 494 496 495 497 // Ugh, Some DVB drivers don't fully support signal monitoring... -
mythtv/libs/libmythtv/siscan.cpp
diff --git a/mythtv/libs/libmythtv/siscan.cpp b/mythtv/libs/libmythtv/siscan.cpp index d7d5fff..116e2e9 100644
a b bool SIScan::ScanTransportsStartingOn(int sourceid, 903 903 nextIt = transport_scan_items_it_t( scanTransports.end() ); 904 904 905 905 DTVMultiplex tuning; 906 906 DTVModulation modulation; 907 DTVModulationSystem msystem; 907 908 DTVTunerType type; 908 909 909 910 if (std == "dvb") 910 911 { 911 ok = type.Parse(mod); 912 if (!modulation.Parse(*(startChan.find("modulation")))) 913 { 914 VERBOSE(VB_IMPORTANT, LOC + "Wrong modulation."); 915 return false; 916 } 917 918 if (modulation == DTVModulation::kModulationQPSK) 919 { 920 type = DTVTunerType::kTunerTypeQPSK; 921 ok = true; 922 if (startChan.find("msystem") != startChan.end()) 923 { 924 if (!msystem.Parse(*(startChan.find("msystem")))) 925 { 926 VERBOSE(VB_IMPORTANT, LOC + "Wrong modulation system."); 927 return false; 928 } 929 if (msystem == DTVModulationSystem::kModulationSystemDVBS2) 930 type = DTVTunerType::kTunerTypeDVB_S2; 931 } 932 } 933 else if (modulation == DTVModulation::kModulation8PSK) 934 { 935 type = DTVTunerType::kTunerTypeDVB_S2; 936 ok = true; 937 } 938 else 939 ok = type.Parse(mod); 912 940 } 913 941 else if (std == "atsc") 914 942 { … … bool SIScan::ScanTransportsStartingOn(int sourceid, 926 954 startChan["coderate_hp"], startChan["coderate_lp"], 927 955 startChan["constellation"], startChan["trans_mode"], 928 956 startChan["guard_interval"], startChan["hierarchy"], 929 startChan["modulation"], startChan["bandwidth"]); 957 startChan["modulation"], startChan["bandwidth"], 958 startChan["msystem"], startChan["rolloff"]); 930 959 } 931 960 932 961 if (ok) … … uint64_t SIScan::FindBestMplexFreq( 1566 1595 const uint transportid, const uint networkid) 1567 1596 { 1568 1597 uint64_t db_freq; 1569 QString tmp_modulation ;1598 QString tmp_modulation, tmp_msystem, tmp_rolloff; 1570 1599 QString tmp_si_std; 1571 1600 uint tmp_transportid, tmp_networkid; 1572 1601 int mplexid; … … uint64_t SIScan::FindBestMplexFreq( 1580 1609 1581 1610 if (!ChannelUtil::GetTuningParams( 1582 1611 (uint)mplexid, tmp_modulation, 1583 db_freq, tmp_transportid, tmp_networkid, tmp_si_std)) 1612 db_freq, tmp_transportid, tmp_networkid, 1613 tmp_msystem, tmp_rolloff, tmp_si_std)) 1584 1614 { 1585 1615 return tuning_freq; 1586 1616 } -
mythtv/libs/libmythtv/transporteditor.cpp
diff --git a/mythtv/libs/libmythtv/transporteditor.cpp b/mythtv/libs/libmythtv/transporteditor.cpp index 29e83a2..0b7eb7a 100644
a b void TransportList::fillSelections(void) 98 98 MSqlQuery query(MSqlQuery::InitCon()); 99 99 query.prepare( 100 100 "SELECT mplexid, modulation, frequency, " 101 " symbolrate, networkid, transportid, constellation "101 " symbolrate, networkid, transportid, constellation, msystem " 102 102 "FROM dtv_multiplex, videosource " 103 103 "WHERE dtv_multiplex.sourceid = :SOURCEID AND " 104 104 " dtv_multiplex.sourceid = videosource.sourceid " … … void TransportList::fillSelections(void) 129 129 QString tid = query.value(5).toUInt() ? 130 130 QString("tid %1").arg(query.value(5).toUInt(), 5) : ""; 131 131 132 QString hz = (CardUtil::QPSK == cardtype) ? "kHz" : "Hz"; 132 QString hz = (CardUtil::QPSK == cardtype || 133 CardUtil::DVBS2 == cardtype) ? "kHz" : "Hz"; 133 134 134 135 QString type = ""; 135 136 if (CardUtil::OFDM == cardtype) 136 137 type = "(DVB-T)"; 137 138 if (CardUtil::QPSK == cardtype) 138 139 type = "(DVB-S)"; 140 if (CardUtil::DVBS2 == cardtype) 141 type = (query.value(7).toString() == "dvbs2")?"(DVB-S2)":"DVB-S"; 142 139 143 if (CardUtil::QAM == cardtype) 140 144 type = "(DVB-C)"; 141 145 … … class SignalPolarity : public ComboBoxSetting, public MuxDBStorage 487 491 }; 488 492 }; 489 493 494 class DVBS2ModulationSystem: public ComboBoxSetting, public MuxDBStorage 495 { 496 public: 497 DVBS2ModulationSystem(const MultiplexID *id) : 498 ComboBoxSetting(this), MuxDBStorage(this, id, "msystem") 499 { 500 setLabel(QObject::tr("Modulation system")); 501 setHelpText(QObject::tr("Modulation system (Default: DVB-S)\n" 502 "Standard selection: DVB-S/DVB-S2")); 503 addSelection(QObject::tr("DVB-S"), "dvbs"); 504 addSelection(QObject::tr("DVB-S2"), "dvbs2"); 505 }; 506 }; 507 490 508 class Modulation : public ComboBoxSetting, public MuxDBStorage 491 509 { 492 510 public: … … Modulation::Modulation(const MultiplexID *id, uint nType) : 506 524 // no modulation options 507 525 setVisible(false); 508 526 } 527 if (CardUtil::QPSK == nType) 528 { 529 addSelection("QPSK", "qpsk"); 530 } 531 if (CardUtil::DVBS2 == nType) 532 { 533 addSelection("QPSK", "qpsk"); 534 addSelection("8PSK", "8psk"); 535 } 509 536 else if ((CardUtil::QAM == nType) || (CardUtil::OFDM == nType)) 510 537 { 511 538 addSelection(QObject::tr("QAM Auto"), "auto"); … … class DVBForwardErrorCorrectionSelector : public ComboBoxSetting 576 603 addSelection("1/2"); 577 604 addSelection("2/3"); 578 605 addSelection("3/4"); 606 addSelection("3/5"); 579 607 addSelection("4/5"); 580 608 addSelection("5/6"); 581 609 addSelection("6/7"); 582 610 addSelection("7/8"); 583 611 addSelection("8/9"); 612 addSelection("9/10"); 584 613 }; 585 614 }; 586 615 … … class DVBForwardErrorCorrection : 597 626 }; 598 627 }; 599 628 629 class DVBS2RollOff: public ComboBoxSetting, public MuxDBStorage 630 { 631 public: 632 DVBS2RollOff(const MultiplexID *id) : 633 ComboBoxSetting(this), MuxDBStorage(this, id, "rolloff") 634 { 635 setLabel(QObject::tr("Roll-off")); 636 setHelpText(QObject::tr("Roll-off (Default: 0.35)")); 637 addSelection(QObject::tr("0.35"), "0.35"); 638 addSelection(QObject::tr("0.20"), "0.20"); 639 addSelection(QObject::tr("0.25"), "0.25"); 640 addSelection(QObject::tr("Auto"), "auto"); 641 }; 642 }; 643 600 644 class DVBTCoderateLP : 601 645 public DVBForwardErrorCorrectionSelector, public MuxDBStorage 602 646 { … … TransportPage::TransportPage(const MultiplexID *_id, uint nType) : 715 759 right->addChild(new DVBForwardErrorCorrection(id)); 716 760 right->addChild(new SignalPolarity(id)); 717 761 } 762 else if (CardUtil::DVBS2 == nType) 763 { 764 left->addChild(new DTVStandard(id, true, false)); 765 left->addChild(new Frequency(id, true)); 766 left->addChild(new DVBSymbolRate(id)); 767 left->addChild(new DVBInversion(id)); 768 left->addChild(new SignalPolarity(id)); 769 770 right = new VerticalConfigurationGroup(false, true, false, false); 771 right->addChild(new DVBS2ModulationSystem(id)); 772 right->addChild(new Modulation(id, nType)); 773 right->addChild(new DVBForwardErrorCorrection(id)); 774 right->addChild(new DVBS2RollOff(id)); 775 } 718 776 else if (CardUtil::QAM == nType) 719 777 { 720 778 left->addChild(new DTVStandard(id, true, false)); -
mythtv/libs/libmythtv/v4lchannel.cpp
diff --git a/mythtv/libs/libmythtv/v4lchannel.cpp b/mythtv/libs/libmythtv/v4lchannel.cpp index 1c93e85..236b267 100644
a b bool V4LChannel::SetChannelByString(const QString &channum) 453 453 454 454 // Fetch tuning data from the database. 455 455 QString tvformat, modulation, freqtable, freqid, dtv_si_std; 456 QString msystem, rolloff; 456 457 int finetune; 457 458 uint64_t frequency; 458 459 int mpeg_prog_num; … … bool V4LChannel::SetChannelByString(const QString &channum) 463 464 tvformat, modulation, freqtable, freqid, 464 465 finetune, frequency, 465 466 dtv_si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid, 467 msystem, rolloff, 466 468 mplexid, commfree)) 467 469 { 468 470 return false; … … bool V4LChannel::TuneMultiplex(uint mplexid, QString inputname) 738 740 uint64_t frequency; 739 741 uint transportid; 740 742 uint dvb_networkid; 743 QString dvb_msystem; 744 QString dvb_rolloff; 741 745 742 746 if (!ChannelUtil::GetTuningParams( 743 747 mplexid, modulation, frequency, 744 transportid, dvb_networkid, si_std)) 748 transportid, dvb_networkid, 749 dvb_msystem, dvb_rolloff, si_std)) 745 750 { 746 751 VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneMultiplex(): " + 747 752 QString("Could not find tuning parameters for multiplex %1.") -
mythtv/libs/libmythtv/videosource.cpp
diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp index a823d50..c289466 100644
a b void DVBConfigurationGroup::probeCard(const QString &videodevice) 2929 2929 signal_timeout->setValue(60000); 2930 2930 channel_timeout->setValue(62500); 2931 2931 break; 2932 case CardUtil::DVBS2: 2933 cardtype->setValue("DVB-S2"); 2934 cardname->setValue(frontend_name); 2935 signal_timeout->setValue(60000); 2936 channel_timeout->setValue(62500); 2937 break; 2932 2938 case CardUtil::QAM: 2933 2939 cardtype->setValue("DVB-C"); 2934 2940 cardname->setValue(frontend_name);