Ticket #7003: 7003-v2.patch
File 7003-v2.patch, 39.6 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/dtvconfparserhelpers.h
72 72 static const DTVParamHelperStruct parseTable[]; 73 73 74 74 public: 75 enum75 typedef enum 76 76 { 77 kTunerTypeQPSK = 0,78 kTunerType QAM = 1,79 kTunerType OFDM = 2,80 kTunerType ATSC = 3,81 kTunerTypeDVB _S2 = (1 << 5),82 kTunerType Unknown = (1 << 31),83 };77 // Modulations which may be supported 78 kTunerTypeDVBS1 = 0x00, // QPSK 79 kTunerTypeDVBS2 = 0x20, // QPSK, 8PSK, 16APSK, 32APSK 80 kTunerTypeDVBC = 0x01, // QAM-64, QAM-256 81 kTunerTypeDVBT = 0x02, // OFDM 82 kTunerTypeATSC = 0x03, // 8-VSB, 16-VSB, QAM-16, QAM-64, QAM-256, QPSK 83 kTunerTypeUnknown = 0x80000000, 84 84 85 // Note: Just because some cards sold in different regions support the same 86 // modulation scheme does not mean that they decode the same signals, there 87 // are also region specific FEC algorithms and the tuner which precedes the 88 // demodulator may be limited to frequencies used in that specific market. 89 // The tuner may also be bandwidth limited to 6 or 7 Mhz, so it could not 90 // support the 8 Mhz channels used in some contries, and/or the ADC which 91 // sits between the tuner and the demodulator may be bandwidth limited. 92 // While often the same hardware could physically support more than it 93 // is designed for the card/device maker does not write the firmware 94 // but licenses blocks of it and so only selects the pieces absolutely 95 // necessary for their market segment. Some ATSC cards only supported 96 // 8-VSB, newer cards don't support the unpopular 16-VSB, no consumer 97 // card supports the QAM-16 or QPSK used for USA Cable PSIP, etc. 98 // DVB-S cards also generally support DiSEqC signaling, and future 99 // ATSC cards may support similar but incompatible signalling for 100 // pointable antennas. 101 // 102 // Note 2: These values are keyed to the Linux DVB driver values, in 103 // reality some hardware does support multiple formats and this should 104 // be a mask. Also the transmission schemes used in Asia and South 105 // America are not represented here. 106 } my_enum; 107 108 bool operator==(const my_enum& v) const { return value == (int) v; } 109 85 110 DTVTunerType(int _default = kTunerTypeUnknown) 86 111 : DTVParamHelper(_default) { initStr(); } 87 112 … … 90 115 91 116 bool IsFECVariable(void) const 92 117 { 93 return ((kTunerType QPSK== value) ||94 (kTunerType QAM== value) ||95 (kTunerTypeDVB _S2 == value));118 return ((kTunerTypeDVBC == value) || 119 (kTunerTypeDVBS1 == value) || 120 (kTunerTypeDVBS2 == value)); 96 121 } 97 122 98 123 bool IsModulationVariable(void) const 99 124 { 100 return (( DTVTunerType::kTunerTypeQAM== value) ||101 ( DTVTunerType::kTunerTypeATSC== value) ||102 ( DTVTunerType::kTunerTypeDVB_S2 == value));125 return ((kTunerTypeDVBC == value) || 126 (kTunerTypeATSC == value) || 127 (kTunerTypeDVBS2 == value)); 103 128 } 104 129 130 bool IsDiSEqCSupported(void) const 131 { 132 return ((kTunerTypeDVBS1 == value) || 133 (kTunerTypeDVBS2 == value)); 134 } 135 105 136 QString toString() const { return toString(value); } 106 137 107 138 static void initStr(void); -
libs/libmythtv/channelscan/channelscan_sm.h
46 46 #include "streamlisteners.h" 47 47 #include "scanmonitor.h" 48 48 #include "signalmonitorlistener.h" 49 #include "dtvconfparserhelpers.h" // for DTVTunerType 49 50 50 51 class MSqlQuery; 51 52 … … 114 115 void SetSourceID(int _SourceID) { sourceID = _SourceID; } 115 116 void SetSignalTimeout(uint val) { signalTimeout = val; } 116 117 void SetChannelTimeout(uint val) { channelTimeout = val; } 118 void SetScanDTVTunerType(DTVTunerType t) { scanDTVTunerType = t; } 117 119 118 120 uint GetSignalTimeout(void) const { return signalTimeout; } 119 121 uint GetChannelTimeout(void) const { return channelTimeout; } … … 147 149 private: 148 150 // some useful gets 149 151 DTVChannel *GetDTVChannel(void); 152 const DTVChannel *GetDTVChannel(void) const; 150 153 V4LChannel *GetV4LChannel(void); 151 154 HDHRChannel *GetHDHRChannel(void); 152 155 DVBChannel *GetDVBChannel(void); … … 162 165 bool Tune(const transport_scan_items_it_t transport); 163 166 uint InsertMultiplex(const transport_scan_items_it_t transport); 164 167 void ScanTransport(const transport_scan_items_it_t transport); 168 DTVTunerType GuessDTVTunerType(DTVTunerType) const; 165 169 166 170 /// \brief Updates Transport Scan progress bar 167 171 inline void UpdateScanPercentCompleted(void); … … 203 207 bool m_test_decryption; 204 208 bool extend_scan_list; 205 209 210 // Optional info 211 DTVTunerType scanDTVTunerType; 212 206 213 // State 207 214 bool scanning; 208 215 bool threadExit; -
libs/libmythtv/channelscan/channelimporter.cpp
667 667 if (!transports.empty()) 668 668 tuner_type = transports[0].tuner_type; 669 669 670 bool is_dvbs = 671 (DTVTunerType::kTunerTypeQPSK == tuner_type) || 672 (DTVTunerType::kTunerTypeDVB_S2 == tuner_type); 670 bool is_dvbs = ((DTVTunerType::kTunerTypeDVBS1 == tuner_type) || 671 (DTVTunerType::kTunerTypeDVBS2 == tuner_type)); 673 672 674 673 uint freq_mult = (is_dvbs) ? 1 : 1000; 675 674 … … 761 760 tuner_type = transports[0].tuner_type; 762 761 763 762 bool is_dvbs = 764 (DTVTunerType::kTunerType QPSK== tuner_type) ||765 (DTVTunerType::kTunerTypeDVB _S2 == tuner_type);763 (DTVTunerType::kTunerTypeDVBS1 == tuner_type) || 764 (DTVTunerType::kTunerTypeDVBS2 == tuner_type); 766 765 767 766 uint freq_mult = (is_dvbs) ? 1 : 1000; 768 767 -
libs/libmythtv/channelscan/channelscan_sm.cpp
31 31 #include <pthread.h> 32 32 #include <unistd.h> 33 33 34 // C++ includes 35 #include <algorithm> 36 using namespace std; 37 34 38 // Qt includes 35 39 #include <QMutex> 36 40 … … 145 149 inputname(_inputname), 146 150 m_test_decryption(test_decryption), 147 151 extend_scan_list(false), 152 // Optional state 153 scanDTVTunerType(DTVTunerType::kTunerTypeUnknown), 148 154 // State 149 155 scanning(false), 150 156 threadExit(false), … … 487 493 return false; 488 494 } 489 495 496 DTVTunerType ChannelScanSM::GuessDTVTunerType(DTVTunerType type) const 497 { 498 if (scanDTVTunerType != DTVTunerType::kTunerTypeUnknown) 499 type = scanDTVTunerType; 500 501 const DTVChannel *chan = GetDTVChannel(); 502 503 if (!chan) 504 return type; 505 506 vector<DTVTunerType> tts = chan->GetTunerTypes(); 507 508 for (uint i = 0; i < tts.size(); ++i) 509 { 510 if (tts[i] == type) 511 return type; 512 } 513 514 if (tts.size() > 0) 515 return tts[0]; 516 517 return type; 518 } 519 490 520 void ChannelScanSM::UpdateScanTransports(const NetworkInformationTable *nit) 491 521 { 492 522 for (uint i = 0; i < nit->TransportStreamCount(); ++i) … … 508 538 uint64_t frequency = 0; 509 539 const MPEGDescriptor desc(list[j]); 510 540 uint tag = desc.DescriptorTag(); 541 DTVTunerType tt = DTVTunerType::kTunerTypeUnknown; 511 542 512 543 switch (tag) 513 544 { 514 case DescriptorID::terrestrial_delivery_system: 515 { 516 const TerrestrialDeliverySystemDescriptor cd(desc); 517 frequency = cd.FrequencyHz(); 518 break; 545 case DescriptorID::terrestrial_delivery_system: 546 { 547 const TerrestrialDeliverySystemDescriptor cd(desc); 548 frequency = cd.FrequencyHz(); 549 tt = DTVTunerType::kTunerTypeDVBT; 550 break; 551 } 552 case DescriptorID::satellite_delivery_system: 553 { 554 const SatelliteDeliverySystemDescriptor cd(desc); 555 frequency = cd.FrequencyHz()/1000; 556 tt = DTVTunerType::kTunerTypeDVBS1; 557 break; 558 } 559 case DescriptorID::cable_delivery_system: 560 { 561 const CableDeliverySystemDescriptor cd(desc); 562 frequency = cd.FrequencyHz(); 563 tt = DTVTunerType::kTunerTypeDVBC; 564 break; 565 } 566 default: 567 VERBOSE(VB_CHANSCAN, LOC + 568 "unknown delivery system descriptor"); 569 continue; 519 570 } 520 case DescriptorID::satellite_delivery_system:521 {522 const SatelliteDeliverySystemDescriptor cd(desc);523 frequency = cd.FrequencyHz()/1000;524 break;525 }526 case DescriptorID::cable_delivery_system:527 {528 const CableDeliverySystemDescriptor cd(desc);529 frequency = cd.FrequencyHz();530 break;531 }532 default:533 VERBOSE(VB_CHANSCAN, LOC + "unknown delivery system descriptor");534 continue;535 }536 571 537 572 mplexid = ChannelUtil::GetMplexID(sourceID, frequency, tsid, netid); 573 mplexid = max(0, mplexid); 538 574 575 tt = GuessDTVTunerType(tt); 576 539 577 DTVMultiplex tuning; 540 if (mplexid > 0)578 if (mplexid) 541 579 { 542 if (!tuning.FillFromDB( GetDVBChannel()->GetCardType(), mplexid))580 if (!tuning.FillFromDB(tt, mplexid)) 543 581 continue; 544 582 } 545 else if (!tuning.FillFromDeliverySystemDesc(GetDVBChannel()->GetCardType(), desc)) 583 else if (!tuning.FillFromDeliverySystemDesc(tt, desc)) 584 { 546 585 continue; 586 } 547 587 548 588 extend_transports[id] = tuning; 549 589 break; … … 1126 1166 1127 1167 uint cardid = channel->GetCardID(); 1128 1168 1129 DTVTunerType tuner_type = DTVTunerType::kTunerTypeATSC; 1130 if (GetDVBChannel()) 1131 tuner_type = GetDVBChannel()->GetCardType(); 1169 DTVTunerType tuner_type = GuessDTVTunerType(DTVTunerType::kTunerTypeATSC); 1132 1170 1133 1171 ChannelList::const_iterator it = channelList.begin(); 1134 1172 for (; it != channelList.end(); ++it) 1135 1173 { 1136 QMap<uint,ChannelInsertInfo> pnum_to_dbchan = GetChannelList(it->first, it->second); 1174 QMap<uint,ChannelInsertInfo> pnum_to_dbchan = 1175 GetChannelList(it->first, it->second); 1137 1176 1138 // Insert channels into DB1139 1177 ScanDTVTransport item((*it->first).tuning, tuner_type, cardid); 1140 1178 1141 1179 QMap<uint,ChannelInsertInfo>::iterator dbchan_it; … … 1171 1209 return dynamic_cast<DTVChannel*>(channel); 1172 1210 } 1173 1211 1212 const DTVChannel *ChannelScanSM::GetDTVChannel(void) const 1213 { 1214 return dynamic_cast<const DTVChannel*>(channel); 1215 } 1216 1174 1217 HDHRChannel *ChannelScanSM::GetHDHRChannel(void) 1175 1218 { 1176 1219 #ifdef USING_HDHOMERUN … … 1693 1736 uint sourceid = query.value(0).toUInt(); 1694 1737 QString sistandard = query.value(1).toString(); 1695 1738 uint tsid = query.value(2).toUInt(); 1739 DTVTunerType tt = DTVTunerType::kTunerTypeUnknown; 1696 1740 1697 1741 QString fn = (tsid) ? QString("Transport ID %1").arg(tsid) : 1698 1742 QString("Multiplex #%1").arg(mplexid); 1743 1699 1744 if (query.value(4).toString() == "8vsb") 1700 1745 { 1701 1746 QString chan = QString("%1 Hz").arg(query.value(3).toInt()); … … 1711 1756 } 1712 1757 } 1713 1758 fn = QObject::tr("ATSC Channel %1").arg(chan); 1759 tt = DTVTunerType::kTunerTypeATSC; 1714 1760 } 1715 1761 1762 tt = GuessDTVTunerType(tt); 1763 1716 1764 TransportScanItem item(sourceid, sistandard, fn, mplexid, signalTimeout); 1717 1765 1718 bool ok = false; 1719 if (GetDVBChannel()) 1720 ok = item.tuning.FillFromDB(GetDVBChannel()->GetCardType(), mplexid); 1721 else if (GetHDHRChannel()) 1722 ok = item.tuning.FillFromDB(DTVTunerType::kTunerTypeATSC, mplexid); 1723 1724 if (ok) 1766 if (item.tuning.FillFromDB(tt, mplexid)) 1725 1767 { 1726 1768 VERBOSE(VB_CHANSCAN, LOC + "Adding " + fn); 1727 1769 scanTransports.push_back(item); 1770 return true; 1728 1771 } 1729 else1730 {1731 VERBOSE(VB_CHANSCAN, LOC + "Not adding incomplete transport " + fn);1732 }1733 1772 1734 return ok; 1773 VERBOSE(VB_CHANSCAN, LOC + "Not adding incomplete transport " + fn); 1774 return false; 1735 1775 } 1736 1776 1737 1777 bool ChannelScanSM::ScanTransport(uint mplexid, bool follow_nit) -
libs/libmythtv/channelscan/channelscanner.cpp
376 376 signal_timeout, channel_timeout, inputname, 377 377 do_test_decryption); 378 378 379 // If we know the channel types we can give the signal montior a hint. 380 // Since we unfortunately do not record this info in the DB, we can not 381 // do this for the other scan types and have to guess later on... 382 switch (scantype) 383 { 384 case ScanTypeSetting::FullScan_ATSC: 385 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeATSC); 386 break; 387 case ScanTypeSetting::FullScan_DVBC: 388 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeDVBC); 389 break; 390 case ScanTypeSetting::FullScan_DVBT: 391 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeDVBT); 392 break; 393 case ScanTypeSetting::NITAddScan_DVBT: 394 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeDVBT); 395 break; 396 case ScanTypeSetting::NITAddScan_DVBS: 397 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeDVBS1); 398 break; 399 case ScanTypeSetting::NITAddScan_DVBS2: 400 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeDVBS2); 401 break; 402 case ScanTypeSetting::NITAddScan_DVBC: 403 sigmonScanner->SetScanDTVTunerType(DTVTunerType::kTunerTypeDVBC); 404 break; 405 default: 406 break; 407 } 408 379 409 // Signal Meters are connected here 380 410 SignalMonitor *mon = sigmonScanner->GetSignalMonitor(); 381 411 if (mon) -
libs/libmythtv/dtvconfparserhelpers.cpp
43 43 void DTVTunerType::initStr(void) 44 44 { 45 45 QMutexLocker locker(&dtv_tt_canonical_str_lock); 46 dtv_tt_canonical_str[kTunerTypeQPSK] = "QPSK";47 dtv_tt_canonical_str[kTunerTypeQAM] = "QAM";48 dtv_tt_canonical_str[kTunerTypeOFDM] = "OFDM";49 46 dtv_tt_canonical_str[kTunerTypeATSC] = "ATSC"; 50 dtv_tt_canonical_str[kTunerTypeDVB_S2] = "DVB_S2"; 47 dtv_tt_canonical_str[kTunerTypeDVBT] = "QPSK"; 48 dtv_tt_canonical_str[kTunerTypeDVBC] = "QAM"; 49 dtv_tt_canonical_str[kTunerTypeDVBS1] = "DVBS"; 50 dtv_tt_canonical_str[kTunerTypeDVBS2] = "DVB_S2"; 51 51 dtv_tt_canonical_str[kTunerTypeUnknown] = "UNKNOWN"; 52 52 } 53 53 … … 62 62 63 63 const DTVParamHelperStruct DTVTunerType::parseTable[] = 64 64 { 65 { "QPSK", kTunerType QPSK},66 { "QAM", kTunerType QAM},67 { "OFDM", kTunerType OFDM},65 { "QPSK", kTunerTypeDVBS1 }, 66 { "QAM", kTunerTypeDVBC }, 67 { "OFDM", kTunerTypeDVBT }, 68 68 { "ATSC", kTunerTypeATSC }, 69 { "DVB_S2", kTunerTypeDVB _S2},69 { "DVB_S2", kTunerTypeDVBS2 }, 70 70 { "UNKNOWN", kTunerTypeUnknown }, 71 71 { NULL, kTunerTypeUnknown }, 72 72 }; -
libs/libmythtv/dtvmultiplex.h
78 78 DTVBandwidth bandwidth; 79 79 DTVCodeRate hp_code_rate; ///< High Priority FEC rate 80 80 DTVCodeRate lp_code_rate; ///< Low Priority FEC rate 81 //DTVModulation constellation; ///< Modulation for OFDM, TODO Remove82 81 DTVModulation modulation; 83 82 DTVTransmitMode trans_mode; 84 83 DTVGuardInterval guard_interval; -
libs/libmythtv/hdhrstreamhandler.cpp
562 562 563 563 bool HDHRStreamHandler::Open(void) 564 564 { 565 return Connect(); 565 if (Connect()) 566 { 567 const char *model = hdhomerun_device_get_model_str(_hdhomerun_device); 568 _tuner_types.clear(); 569 if (QString(model).toLower().contains("dvb")) 570 { 571 _tuner_types.push_back(DTVTunerType::kTunerTypeDVBT); 572 _tuner_types.push_back(DTVTunerType::kTunerTypeDVBC); 573 } 574 else 575 { 576 _tuner_types.push_back(DTVTunerType::kTunerTypeATSC); 577 } 578 579 return true; 580 } 581 return false; 566 582 } 567 583 568 584 void HDHRStreamHandler::Close(void) -
libs/libmythtv/hdhrchannel.cpp
35 35 #define LOC_ERR QString("HDHRChan(%1), Error: ").arg(GetDevice()) 36 36 37 37 HDHRChannel::HDHRChannel(TVRec *parent, const QString &device) 38 : DTVChannel(parent), _stream_handler(NULL),39 _device_id(device), _lock(QMutex::Recursive),40 tune_lock(QMutex::Recursive),41 hw_lock(QMutex::Recursive)38 : DTVChannel(parent), 39 _device_id(device), _stream_handler(NULL), 40 _lock(QMutex::Recursive), 41 tune_lock(QMutex::Recursive), hw_lock(QMutex::Recursive) 42 42 { 43 43 } 44 44 … … 58 58 59 59 _stream_handler = HDHRStreamHandler::Get(_device_id); 60 60 61 _tuner_types = _stream_handler->GetTunerTypes(); 62 tunerType = (_tuner_types.empty()) ? 63 DTVTunerType::kTunerTypeUnknown : _tuner_types[0]; 64 61 65 if (!InitializeInputs()) 62 66 { 63 67 Close(); -
libs/libmythtv/dvbchannel.h
8 8 #ifndef DVBCHANNEL_H 9 9 #define DVBCHANNEL_H 10 10 11 #include < qobject.h>12 #include < qstring.h>13 #include < qmap.h>11 #include <QObject> 12 #include <QString> 13 #include <QMap> 14 14 15 15 #include "mythcontext.h" 16 16 #include "mythdbcon.h" 17 17 #include "dtvchannel.h" 18 #include "dtvconfparserhelpers.h" // for DTVTunerType 18 19 #include "streamlisteners.h" 19 20 #include "diseqc.h" 20 21 … … 52 53 QString GetCardNum(void) const { return device; }; 53 54 /// Returns frontend name as reported by driver 54 55 QString GetFrontendName(void) const; 55 DTVTunerType GetCardType(void) const { return card_type; }56 56 bool IsMaster(void) const { return master == NULL; } 57 57 /// Returns true iff we have a faulty DVB driver that munges PMT 58 58 bool HasCRCBug(void) const { return has_crc_bug; } … … 115 115 116 116 // Device info 117 117 QString frontend_name; 118 DTVTunerType card_type;119 118 uint64_t capabilities; 120 119 uint64_t ext_modulations; 121 120 uint64_t frequency_minimum; -
libs/libmythtv/dtvchannel.h
20 20 21 21 // MythTV headers 22 22 #include "channelbase.h" 23 #include "dtvconfparserhelpers.h" // for DTVTunerType 23 24 24 25 typedef pair<uint,uint> pid_cache_item_t; 25 26 typedef vector<pid_cache_item_t> pid_cache_t; … … 75 76 /// \brief Returns tuning mode last set by SetTuningMode(). 76 77 QString GetTuningMode(void) const; 77 78 79 /// \brief Returns a vector of supported tuning types. 80 virtual vector<DTVTunerType> GetTunerTypes(void) const; 81 78 82 /** \brief Returns cached MPEG PIDs for last tuned channel. 79 83 * \param pid_cache List of PIDs with their TableID 80 84 * types is returned in pid_cache. … … 110 114 protected: 111 115 mutable QMutex dtvinfo_lock; 112 116 117 DTVTunerType tunerType; 113 118 QString sistandard; ///< PSIP table standard: MPEG, DVB, ATSC, OpenCable 114 119 QString tuningMode; 115 120 int currentProgramNum; -
libs/libmythtv/dvbchannel.cpp
70 70 // Helper classes 71 71 diseqc_tree(NULL), dvbcam(NULL), 72 72 // Device info 73 frontend_name(QString::null), card_type(DTVTunerType::kTunerTypeUnknown),73 frontend_name(QString::null), 74 74 // Tuning 75 75 tune_lock(), hw_lock(), 76 76 last_lnb_dev_id(-1), … … 166 166 167 167 fd_frontend = master->fd_frontend; 168 168 frontend_name = master->frontend_name; 169 card_type = master->card_type;169 tunerType = master->tunerType; 170 170 capabilities = master->capabilities; 171 171 ext_modulations = master->ext_modulations; 172 172 frequency_minimum = master->frequency_minimum; … … 212 212 } 213 213 214 214 frontend_name = info.name; 215 card_type = info.type;215 tunerType = info.type; 216 216 #if HAVE_FE_CAN_2G_MODULATION 217 if ( card_type == DTVTunerType::kTunerTypeQPSK&&217 if (tunerType == DTVTunerType::kTunerTypeDVBS1 && 218 218 (info.caps & FE_CAN_2G_MODULATION)) 219 card_type = DTVTunerType::kTunerTypeDVB_S2;219 tunerType = DTVTunerType::kTunerTypeDVBS2; 220 220 #endif // HAVE_FE_CAN_2G_MODULATION 221 221 capabilities = info.caps; 222 222 frequency_minimum = info.frequency_min; … … 228 228 .arg(device).arg(frontend_name)); 229 229 230 230 // Turn on the power to the LNB 231 if (card_type == DTVTunerType::kTunerTypeQPSK || 232 card_type == DTVTunerType::kTunerTypeDVB_S2) 231 if (tunerType.IsDiSEqCSupported()) 233 232 { 234 233 diseqc_tree = diseqc_dev.FindTree(GetCardID()); 235 234 if (diseqc_tree) … … 272 271 bool DVBChannel::TuneMultiplex(uint mplexid, QString inputname) 273 272 { 274 273 DTVMultiplex tuning; 275 if (!tuning.FillFromDB( card_type, mplexid))274 if (!tuning.FillFromDB(tunerType, mplexid)) 276 275 return false; 277 276 278 277 CheckOptions(tuning); … … 354 353 355 354 // Initialize basic the tuning parameters 356 355 DTVMultiplex tuning; 357 if (!mplexid || !tuning.FillFromDB( card_type, mplexid))356 if (!mplexid || !tuning.FillFromDB(tunerType, mplexid)) 358 357 { 359 358 VERBOSE(VB_IMPORTANT, loc_err + 360 359 "Failed to initialize multiplex options"); … … 457 456 .arg(frequency_minimum).arg(frequency_maximum)); 458 457 } 459 458 460 if ( card_type.IsFECVariable() &&459 if (tunerType.IsFECVariable() && 461 460 symbol_rate_minimum && symbol_rate_maximum && 462 461 (symbol_rate_minimum <= symbol_rate_maximum) && 463 462 (tuning.symbolrate < symbol_rate_minimum || … … 470 469 .arg(symbol_rate_minimum).arg(symbol_rate_maximum)); 471 470 } 472 471 473 if ( card_type.IsFECVariable() && !CheckCodeRate(tuning.fec))472 if (tunerType.IsFECVariable() && !CheckCodeRate(tuning.fec)) 474 473 { 475 474 VERBOSE(VB_GENERAL, LOC_WARN + "Unsupported fec_inner parameter."); 476 475 } 477 476 478 if ( card_type.IsModulationVariable() && !CheckModulation(tuning.modulation))477 if (tunerType.IsModulationVariable() && !CheckModulation(tuning.modulation)) 479 478 { 480 479 VERBOSE(VB_GENERAL, LOC_WARN + "Unsupported modulation parameter."); 481 480 } 482 481 483 if (DTVTunerType::kTunerType OFDM != card_type)482 if (DTVTunerType::kTunerTypeDVBT != tunerType) 484 483 { 485 484 VERBOSE(VB_CHANNEL, LOC + tuning.toString()); 486 485 return; … … 614 613 uint c = 0; 615 614 struct dtv_properties *cmdseq; 616 615 617 if (tuner_type != DTVTunerType::kTunerTypeDVB _S2&&618 tuner_type != DTVTunerType::kTunerType OFDM&&619 tuner_type != DTVTunerType::kTunerType QAM&&620 tuner_type != DTVTunerType::kTunerType QPSK)616 if (tuner_type != DTVTunerType::kTunerTypeDVBT && 617 tuner_type != DTVTunerType::kTunerTypeDVBC && 618 tuner_type != DTVTunerType::kTunerTypeDVBS1 && 619 tuner_type != DTVTunerType::kTunerTypeDVBS2) 621 620 { 622 621 VERBOSE(VB_IMPORTANT, "Unsupported tuner type " + tuner_type.toString()); 623 622 return NULL; … … 639 638 if (tuning.mod_sys == DTVModulationSystem::kModulationSystem_DVBS2) 640 639 can_fec_auto = false; 641 640 642 if (tuner_type == DTVTunerType::kTunerTypeDVB _S2)641 if (tuner_type == DTVTunerType::kTunerTypeDVBS2) 643 642 { 644 643 cmdseq->props[c].cmd = DTV_DELIVERY_SYSTEM; 645 644 cmdseq->props[c++].u.data = tuning.mod_sys; … … 652 651 cmdseq->props[c].cmd = DTV_INVERSION; 653 652 cmdseq->props[c++].u.data = tuning.inversion; 654 653 655 if (tuner_type == DTVTunerType::kTunerType QPSK||656 tuner_type == DTVTunerType::kTunerTypeDVB _S2 ||657 tuner_type == DTVTunerType::kTunerType QAM)654 if (tuner_type == DTVTunerType::kTunerTypeDVBS1 || 655 tuner_type == DTVTunerType::kTunerTypeDVBS2 || 656 tuner_type == DTVTunerType::kTunerTypeDVBC) 658 657 { 659 658 cmdseq->props[c].cmd = DTV_SYMBOL_RATE; 660 659 cmdseq->props[c++].u.data = tuning.symbolrate; … … 666 665 cmdseq->props[c++].u.data = can_fec_auto ? FEC_AUTO : tuning.fec; 667 666 } 668 667 669 if (tuner_type == DTVTunerType::kTunerType OFDM)668 if (tuner_type == DTVTunerType::kTunerTypeDVBT) 670 669 { 671 670 cmdseq->props[c].cmd = DTV_BANDWIDTH_HZ; 672 671 cmdseq->props[c++].u.data = (8-tuning.bandwidth) * 1000000; … … 706 705 707 706 708 707 /***************************************************************************** 709 Tuning functions for each of the f ourtypes of cards.708 Tuning functions for each of the five types of cards. 710 709 *****************************************************************************/ 711 710 712 711 /** … … 739 738 bool can_fec_auto = false; 740 739 bool reset = (force_reset || first_tune); 741 740 742 bool is_dvbs = (DTVTunerType::kTunerTypeQPSK == card_type || 743 DTVTunerType::kTunerTypeDVB_S2 == card_type); 744 745 bool has_diseqc = (diseqc_tree != NULL); 746 if (is_dvbs && !has_diseqc) 741 if (tunerType.IsDiSEqCSupported() && !diseqc_tree) 747 742 { 748 743 VERBOSE(VB_IMPORTANT, LOC_ERR + 749 744 "DVB-S needs device tree for LNB handling"); … … 765 760 drain_dvb_events(fd_frontend); 766 761 767 762 // send DVB-S setup 768 if ( is_dvbs)763 if (diseqc_tree) 769 764 { 770 765 // configure for new input 771 766 if (!same_input) … … 809 804 tuning.toString()); 810 805 811 806 // DVB-S is in kHz, other DVB is in Hz 807 bool is_dvbs = ((DTVTunerType::kTunerTypeDVBS1 == tunerType) || 808 (DTVTunerType::kTunerTypeDVBS2 == tunerType)); 812 809 int freq_mult = (is_dvbs) ? 1 : 1000; 813 810 QString suffix = (is_dvbs) ? "kHz" : "Hz"; 814 811 815 if (reset || !prev_tuning.IsEqual( card_type, tuning, 500 * freq_mult))812 if (reset || !prev_tuning.IsEqual(tunerType, tuning, 500 * freq_mult)) 816 813 { 817 814 VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 818 815 .arg(intermediate_freq ? intermediate_freq : tuning.frequency) 819 816 .arg(suffix)); 820 817 821 818 #if DVB_API_VERSION >=5 822 if (DTVTunerType::kTunerTypeDVB _S2 == card_type)819 if (DTVTunerType::kTunerTypeDVBS2 == tunerType) 823 820 { 824 821 struct dtv_property p_clear; 825 822 struct dtv_properties cmdseq_clear; … … 836 833 } 837 834 838 835 struct dtv_properties *cmds = dtvmultiplex_to_dtvproperties( 839 card_type, tuning, intermediate_freq, can_fec_auto);836 tunerType, tuning, intermediate_freq, can_fec_auto); 840 837 841 838 if (!cmds) { 842 839 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to convert " … … 869 866 else 870 867 #endif 871 868 { 872 struct dvb_frontend_parameters params = dtvmultiplex_to_dvbparams(card_type, tuning, 873 intermediate_freq, 874 can_fec_auto); 869 struct dvb_frontend_parameters params = dtvmultiplex_to_dvbparams( 870 tunerType, tuning, intermediate_freq, can_fec_auto); 875 871 876 872 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 877 873 { … … 968 964 return false; 969 965 } 970 966 971 if ( card_type == DTVTunerType::kTunerTypeDVB_S2)967 if (tunerType == DTVTunerType::kTunerTypeDVBS2) 972 968 { 973 969 // TODO implement probing of tuning parameters with FE_GET_PROPERTY 974 970 return false; … … 986 982 uint mplex = tuning.mplex; 987 983 QString sistandard = tuning.sistandard; sistandard.detach(); 988 984 989 tuning = dvbparams_to_dtvmultiplex( card_type, params);985 tuning = dvbparams_to_dtvmultiplex(tunerType, params); 990 986 991 987 tuning.mplex = mplex; 992 988 tuning.sistandard = sistandard; … … 1210 1206 params.frequency = tuning.frequency; 1211 1207 params.inversion = (fe_spectral_inversion_t) (int) tuning.inversion; 1212 1208 1213 if (DTVTunerType::kTunerType QPSK== tuner_type)1209 if (DTVTunerType::kTunerTypeDVBS1 == tuner_type) 1214 1210 { 1215 1211 if (tuning.mod_sys == DTVModulationSystem::kModulationSystem_DVBS2) 1216 1212 VERBOSE(VB_IMPORTANT, "DVBChan Error, Tuning of a DVB-S2 transport " … … 1222 1218 : (fe_code_rate_t) (int) tuning.fec; 1223 1219 } 1224 1220 1225 if (DTVTunerType::kTunerTypeDVB _S2 == tuner_type)1221 if (DTVTunerType::kTunerTypeDVBS2 == tuner_type) 1226 1222 { 1227 1223 VERBOSE(VB_IMPORTANT, "DVBChan Error, MythTV was compiled without " 1228 1224 "DVB-S2 headers being present so DVB-S2 tuning will fail."); 1229 1225 } 1230 1226 1231 if (DTVTunerType::kTunerType QAM== tuner_type)1227 if (DTVTunerType::kTunerTypeDVBC == tuner_type) 1232 1228 { 1233 1229 params.u.qam.symbol_rate = tuning.symbolrate; 1234 1230 params.u.qam.fec_inner = (fe_code_rate_t) (int) tuning.fec; 1235 1231 params.u.qam.modulation = (fe_modulation_t) (int) tuning.modulation; 1236 1232 } 1237 1233 1238 if (DTVTunerType::kTunerType OFDM== tuner_type)1234 if (DTVTunerType::kTunerTypeDVBT == tuner_type) 1239 1235 { 1240 1236 params.u.ofdm.bandwidth = 1241 1237 (fe_bandwidth_t) (int) tuning.bandwidth; … … 1270 1266 tuning.frequency = params.frequency; 1271 1267 tuning.inversion = params.inversion; 1272 1268 1273 if ((DTVTunerType::kTunerType QPSK== tuner_type) ||1274 (DTVTunerType::kTunerTypeDVB _S2 == tuner_type))1269 if ((DTVTunerType::kTunerTypeDVBS1 == tuner_type) || 1270 (DTVTunerType::kTunerTypeDVBS2 == tuner_type)) 1275 1271 { 1276 1272 tuning.symbolrate = params.u.qpsk.symbol_rate; 1277 1273 tuning.fec = params.u.qpsk.fec_inner; 1278 1274 } 1279 1275 1280 if (DTVTunerType::kTunerType QAM== tuner_type)1276 if (DTVTunerType::kTunerTypeDVBC == tuner_type) 1281 1277 { 1282 1278 tuning.symbolrate = params.u.qam.symbol_rate; 1283 1279 tuning.fec = params.u.qam.fec_inner; 1284 1280 tuning.modulation = params.u.qam.modulation; 1285 1281 } 1286 1282 1287 if (DTVTunerType::kTunerType OFDM== tuner_type)1283 if (DTVTunerType::kTunerTypeDVBT == tuner_type) 1288 1284 { 1289 1285 tuning.bandwidth = params.u.ofdm.bandwidth; 1290 1286 tuning.hp_code_rate = params.u.ofdm.code_rate_HP; … … 1295 1291 tuning.hierarchy = params.u.ofdm.hierarchy_information; 1296 1292 } 1297 1293 1298 if (DTVTunerType::kTunerTypeATSC == tuner_type)1294 if (DTVTunerType::kTunerTypeATSC == tuner_type) 1299 1295 { 1300 1296 tuning.modulation = params.u.vsb.modulation; 1301 1297 } -
libs/libmythtv/hdhrstreamhandler.h
12 12 #include "util.h" 13 13 #include "DeviceReadBuffer.h" 14 14 #include "mpegstreamdata.h" 15 #include "dtvconfparserhelpers.h" 15 16 16 17 class QString; 17 18 class HDHRStreamHandler; … … 44 45 bool IsRunning(void) const { return _running; } 45 46 void GetTunerStatus(struct hdhomerun_tuner_status_t *status); 46 47 bool IsConnected(void) const; 48 vector<DTVTunerType> GetTunerTypes(void) const { return _tuner_types; } 47 49 48 50 // Commands 49 51 bool TuneChannel(const QString &chanid); … … 91 93 hdhomerun_device_t *_hdhomerun_device; 92 94 uint _tuner; 93 95 QString _devicename; 96 vector<DTVTunerType> _tuner_types; 94 97 95 98 mutable QMutex _start_stop_lock; 96 99 bool _running; -
libs/libmythtv/scanwizard.cpp
93 93 else if (scantype == ScanTypeSetting::NITAddScan_DVBT) 94 94 { 95 95 start_chan = configPane->GetStartChan(); 96 parse_type = DTVTunerType::kTunerType OFDM;96 parse_type = DTVTunerType::kTunerTypeDVBT; 97 97 } 98 98 else if (scantype == ScanTypeSetting::NITAddScan_DVBS) 99 99 { 100 100 start_chan = configPane->GetStartChan(); 101 parse_type = DTVTunerType::kTunerType QPSK;101 parse_type = DTVTunerType::kTunerTypeDVBS1; 102 102 } 103 103 else if (scantype == ScanTypeSetting::NITAddScan_DVBS2) 104 104 { 105 105 start_chan = configPane->GetStartChan(); 106 parse_type = DTVTunerType::kTunerTypeDVB _S2;106 parse_type = DTVTunerType::kTunerTypeDVBS2; 107 107 } 108 108 else if (scantype == ScanTypeSetting::NITAddScan_DVBC) 109 109 { 110 110 start_chan = configPane->GetStartChan(); 111 parse_type = DTVTunerType::kTunerType QAM;111 parse_type = DTVTunerType::kTunerTypeDVBC; 112 112 } 113 113 else if (scantype == ScanTypeSetting::IPTVImport) 114 114 { -
libs/libmythtv/dtvmultiplex.cpp
76 76 return false; 77 77 } 78 78 79 if (DTVTunerType::kTunerType QAM== type)79 if (DTVTunerType::kTunerTypeDVBC == type) 80 80 { 81 81 if (fuzzy) 82 82 return … … 91 91 (modulation == other.modulation); 92 92 } 93 93 94 if (DTVTunerType::kTunerType OFDM== type)94 if (DTVTunerType::kTunerTypeDVBT == type) 95 95 { 96 96 if (fuzzy) 97 97 return … … 121 121 return (modulation == other.modulation); 122 122 } 123 123 124 if ((DTVTunerType::kTunerTypeDVB _S2== type) ||125 (DTVTunerType::kTunerType QPSK== type))124 if ((DTVTunerType::kTunerTypeDVBS1 == type) || 125 (DTVTunerType::kTunerTypeDVBS2 == type)) 126 126 { 127 127 bool ret = 128 128 (symbolrate == other.symbolrate) && … … 261 261 QString _modulation, QString _bandwidth, 262 262 QString _mod_sys, QString _rolloff) 263 263 { 264 if (DTVTunerType::kTunerType OFDM== type)264 if (DTVTunerType::kTunerTypeDVBT == type) 265 265 { 266 266 return ParseDVB_T( 267 267 _frequency, _inversion, _bandwidth, _hp_code_rate, … … 269 269 _hierarchy); 270 270 } 271 271 272 if ((DTVTunerType::kTunerType QPSK== type) ||273 (DTVTunerType::kTunerType QAM== type))272 if ((DTVTunerType::kTunerTypeDVBS1 == type) || 273 (DTVTunerType::kTunerTypeDVBC == type)) 274 274 { 275 275 return ParseDVB_S_and_C( 276 276 _frequency, _inversion, _symbolrate, 277 277 _fec, _modulation, _polarity); 278 278 } 279 279 280 if (DTVTunerType::kTunerTypeDVB_S2 == type) 280 if (DTVTunerType::kTunerTypeDVBS2 == type) 281 { 281 282 return ParseDVB_S2( 282 283 _frequency, _inversion, _symbolrate, 283 284 _fec, _modulation, _polarity, 284 285 _mod_sys, _rolloff); 286 } 285 287 286 288 if (DTVTunerType::kTunerTypeATSC == type) 287 289 return ParseATSC(_frequency, _modulation); … … 350 352 { 351 353 case DescriptorID::terrestrial_delivery_system: 352 354 { 353 if (type != DTVTunerType::kTunerType OFDM)355 if (type != DTVTunerType::kTunerTypeDVBT) 354 356 break; 355 357 356 358 const TerrestrialDeliverySystemDescriptor cd(desc); … … 366 368 { 367 369 const SatelliteDeliverySystemDescriptor cd(desc); 368 370 369 if (type == DTVTunerType::kTunerType QPSK)371 if (type == DTVTunerType::kTunerTypeDVBS1) 370 372 { 371 373 if (cd.ModulationSystem()) 372 374 { … … 374 376 "Ignoring DVB-S2 transponder with DVB-S card"); 375 377 return false; 376 378 } 379 377 380 return ParseDVB_S_and_C( 378 381 QString().number(cd.FrequencyHz()), "auto", 379 382 QString().number(cd.SymbolRateHz()), cd.FECInnerString(), 380 383 cd.ModulationString(), 381 384 cd.PolarizationString()); 382 385 } 383 if (type == DTVTunerType::kTunerTypeDVB_S2) 386 387 if (type == DTVTunerType::kTunerTypeDVBS2) 384 388 { 385 389 return ParseDVB_S2( 386 390 QString().number(cd.FrequencyHz()), "auto", … … 389 393 cd.PolarizationString(), 390 394 cd.ModulationSystemString(), cd.RollOffString()); 391 395 } 396 392 397 break; 393 398 } 394 399 case DescriptorID::cable_delivery_system: 395 400 { 396 if (type != DTVTunerType::kTunerType QAM)401 if (type != DTVTunerType::kTunerTypeDVBC) 397 402 break; 398 403 399 404 const CableDeliverySystemDescriptor cd(desc); -
libs/libmythtv/hdhrchannel.h
38 38 // Gets 39 39 bool IsOpen(void) const; 40 40 QString GetDevice(void) const { return _device_id; } 41 virtual vector<DTVTunerType> GetTunerTypes(void) const { return _tuner_types; } 41 42 42 43 // ATSC/DVB scanning/tuning stuff 43 44 bool TuneMultiplex(uint mplexid, QString inputname); … … 48 49 QString modulation, QString si_std); 49 50 50 51 private: 51 HDHRStreamHandler *_stream_handler; 52 QString _device_id; 53 HDHRStreamHandler *_stream_handler; 54 vector<DTVTunerType> _tuner_types; 52 55 53 QString _device_id;54 55 56 mutable QMutex _lock; 56 57 mutable QMutex tune_lock; 57 58 mutable QMutex hw_lock; -
libs/libmythtv/dtvchannel.cpp
13 13 14 14 DTVChannel::DTVChannel(TVRec *parent) 15 15 : ChannelBase(parent), 16 tunerType(DTVTunerType::kTunerTypeUnknown), 16 17 sistandard("mpeg"), tuningMode(QString::null), 17 18 currentProgramNum(-1), 18 19 currentATSCMajorChannel(0), currentATSCMinorChannel(0), … … 154 155 return tmp; 155 156 } 156 157 158 vector<DTVTunerType> DTVChannel::GetTunerTypes(void) const 159 { 160 vector<DTVTunerType> tts; 161 if (tunerType != DTVTunerType::kTunerTypeUnknown) 162 tts.push_back(tunerType); 163 return tts; 164 } 165 157 166 void DTVChannel::SetTuningMode(const QString &tuning_mode) 158 167 { 159 168 QMutexLocker locker(&dtvinfo_lock);