Ticket #7003: 7003-v1.patch
File 7003-v1.patch, 12.6 KB (added by , 15 years ago) |
---|
-
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 … … 535 539 } 536 540 537 541 mplexid = ChannelUtil::GetMplexID(sourceID, frequency, tsid, netid); 542 mplexid = max(0, mplexid); 538 543 544 DTVTunerType tt = DTVTunerType::kTunerTypeOFDM; 545 if (GetDTVChannel()) 546 tt = GetDTVChannel()->GetCardType(); 547 539 548 DTVMultiplex tuning; 540 if (mplexid > 0)549 if (mplexid) 541 550 { 542 if (!tuning.FillFromDB( GetDVBChannel()->GetCardType(), mplexid))551 if (!tuning.FillFromDB(tt, mplexid)) 543 552 continue; 544 553 } 545 else if (!tuning.FillFromDeliverySystemDesc(GetDVBChannel()->GetCardType(), desc)) 554 else if (!tuning.FillFromDeliverySystemDesc(tt, desc)) 555 { 546 556 continue; 557 } 547 558 548 559 extend_transports[id] = tuning; 549 560 break; -
libs/libmythtv/hdhrstreamhandler.cpp
106 106 _hdhomerun_device(NULL), 107 107 _tuner(-1), 108 108 _devicename(devicename), 109 _tuner_type(kHDHRTunerTypeUnknown), 109 110 110 111 _start_stop_lock(QMutex::Recursive), 111 112 _running(false), … … 562 563 563 564 bool HDHRStreamHandler::Open(void) 564 565 { 565 return Connect(); 566 if (Connect()) 567 { 568 const char *model = hdhomerun_device_get_model_str(_hdhomerun_device); 569 bool is_dvb = QString(model).toLower().contains("dvb"); 570 _tuner_type = (is_dvb) ? kHDHRTunerTypeDVBT : kHDHRTunerTypeATSC; 571 return true; 572 } 573 return false; 566 574 } 567 575 568 576 void HDHRStreamHandler::Close(void) -
libs/libmythtv/hdhrchannel.cpp
58 58 59 59 _stream_handler = HDHRStreamHandler::Get(_device_id); 60 60 61 if (!_stream_handler) 62 return false; 63 64 switch (_stream_handler->GetTunerType()) 65 { 66 case kHDHRTunerTypeUnknown: 67 cardType = DTVTunerType::kTunerTypeUnknown; 68 break; 69 case kHDHRTunerTypeATSC: 70 cardType = DTVTunerType::kTunerTypeATSC; 71 break; 72 case kHDHRTunerTypeDVBT: 73 cardType = DTVTunerType::kTunerTypeOFDM; 74 break; 75 } 76 61 77 if (!InitializeInputs()) 62 78 { 63 79 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" 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" 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 DTVTunerType GetCardType(void) const { return cardType; } 80 78 81 /** \brief Returns cached MPEG PIDs for last tuned channel. 79 82 * \param pid_cache List of PIDs with their TableID 80 83 * types is returned in pid_cache. … … 110 113 protected: 111 114 mutable QMutex dtvinfo_lock; 112 115 116 DTVTunerType cardType; 113 117 QString sistandard; ///< PSIP table standard: MPEG, DVB, ATSC, OpenCable 114 118 QString tuningMode; 115 119 int currentProgramNum; -
libs/libmythtv/hdhrstreamhandler.h
27 27 #endif 28 28 29 29 typedef QMap<uint,int> FilterMap; 30 typedef enum HDHRTunerType { 31 kHDHRTunerTypeUnknown, 32 kHDHRTunerTypeATSC, 33 kHDHRTunerTypeDVBT 34 } HDHRTunerType; 30 35 31 36 //#define RETUNE_TIMEOUT 5000 32 37 … … 44 49 bool IsRunning(void) const { return _running; } 45 50 void GetTunerStatus(struct hdhomerun_tuner_status_t *status); 46 51 bool IsConnected(void) const; 52 HDHRTunerType GetTunerType(void) const { return _tuner_type; } 47 53 48 54 // Commands 49 55 bool TuneChannel(const QString &chanid); … … 91 97 hdhomerun_device_t *_hdhomerun_device; 92 98 uint _tuner; 93 99 QString _devicename; 100 HDHRTunerType _tuner_type; 94 101 95 102 mutable QMutex _start_stop_lock; 96 103 bool _running; -
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 cardType = master->cardType; 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 cardType = info.type; 216 216 #if HAVE_FE_CAN_2G_MODULATION 217 if (card _type == DTVTunerType::kTunerTypeQPSK &&217 if (cardType == DTVTunerType::kTunerTypeQPSK && 218 218 (info.caps & FE_CAN_2G_MODULATION)) 219 card _type = DTVTunerType::kTunerTypeDVB_S2;219 cardType = DTVTunerType::kTunerTypeDVB_S2; 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 (cardType == DTVTunerType::kTunerTypeQPSK || 232 cardType == DTVTunerType::kTunerTypeDVB_S2) 233 233 { 234 234 diseqc_tree = diseqc_dev.FindTree(GetCardID()); 235 235 if (diseqc_tree) … … 272 272 bool DVBChannel::TuneMultiplex(uint mplexid, QString inputname) 273 273 { 274 274 DTVMultiplex tuning; 275 if (!tuning.FillFromDB(card _type, mplexid))275 if (!tuning.FillFromDB(cardType, mplexid)) 276 276 return false; 277 277 278 278 CheckOptions(tuning); … … 354 354 355 355 // Initialize basic the tuning parameters 356 356 DTVMultiplex tuning; 357 if (!mplexid || !tuning.FillFromDB(card _type, mplexid))357 if (!mplexid || !tuning.FillFromDB(cardType, mplexid)) 358 358 { 359 359 VERBOSE(VB_IMPORTANT, loc_err + 360 360 "Failed to initialize multiplex options"); … … 457 457 .arg(frequency_minimum).arg(frequency_maximum)); 458 458 } 459 459 460 if (card _type.IsFECVariable() &&460 if (cardType.IsFECVariable() && 461 461 symbol_rate_minimum && symbol_rate_maximum && 462 462 (symbol_rate_minimum <= symbol_rate_maximum) && 463 463 (tuning.symbolrate < symbol_rate_minimum || … … 470 470 .arg(symbol_rate_minimum).arg(symbol_rate_maximum)); 471 471 } 472 472 473 if (card _type.IsFECVariable() && !CheckCodeRate(tuning.fec))473 if (cardType.IsFECVariable() && !CheckCodeRate(tuning.fec)) 474 474 { 475 475 VERBOSE(VB_GENERAL, LOC_WARN + "Unsupported fec_inner parameter."); 476 476 } 477 477 478 if (card _type.IsModulationVariable() && !CheckModulation(tuning.modulation))478 if (cardType.IsModulationVariable() && !CheckModulation(tuning.modulation)) 479 479 { 480 480 VERBOSE(VB_GENERAL, LOC_WARN + "Unsupported modulation parameter."); 481 481 } 482 482 483 if (DTVTunerType::kTunerTypeOFDM != card _type)483 if (DTVTunerType::kTunerTypeOFDM != cardType) 484 484 { 485 485 VERBOSE(VB_CHANNEL, LOC + tuning.toString()); 486 486 return; … … 739 739 bool can_fec_auto = false; 740 740 bool reset = (force_reset || first_tune); 741 741 742 bool is_dvbs = (DTVTunerType::kTunerTypeQPSK == card _type ||743 DTVTunerType::kTunerTypeDVB_S2 == card _type);742 bool is_dvbs = (DTVTunerType::kTunerTypeQPSK == cardType || 743 DTVTunerType::kTunerTypeDVB_S2 == cardType); 744 744 745 745 bool has_diseqc = (diseqc_tree != NULL); 746 746 if (is_dvbs && !has_diseqc) … … 812 812 int freq_mult = (is_dvbs) ? 1 : 1000; 813 813 QString suffix = (is_dvbs) ? "kHz" : "Hz"; 814 814 815 if (reset || !prev_tuning.IsEqual(card _type, tuning, 500 * freq_mult))815 if (reset || !prev_tuning.IsEqual(cardType, tuning, 500 * freq_mult)) 816 816 { 817 817 VERBOSE(VB_CHANNEL, LOC + QString("Tune(): Tuning to %1%2") 818 818 .arg(intermediate_freq ? intermediate_freq : tuning.frequency) 819 819 .arg(suffix)); 820 820 821 821 #if DVB_API_VERSION >=5 822 if (DTVTunerType::kTunerTypeDVB_S2 == card _type)822 if (DTVTunerType::kTunerTypeDVB_S2 == cardType) 823 823 { 824 824 struct dtv_property p_clear; 825 825 struct dtv_properties cmdseq_clear; … … 836 836 } 837 837 838 838 struct dtv_properties *cmds = dtvmultiplex_to_dtvproperties( 839 card _type, tuning, intermediate_freq, can_fec_auto);839 cardType, tuning, intermediate_freq, can_fec_auto); 840 840 841 841 if (!cmds) { 842 842 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to convert " … … 869 869 else 870 870 #endif 871 871 { 872 struct dvb_frontend_parameters params = dtvmultiplex_to_dvbparams(card_type, tuning, 873 intermediate_freq, 874 can_fec_auto); 872 struct dvb_frontend_parameters params = dtvmultiplex_to_dvbparams( 873 cardType, tuning, intermediate_freq, can_fec_auto); 875 874 876 875 if (ioctl(fd_frontend, FE_SET_FRONTEND, ¶ms) < 0) 877 876 { … … 968 967 return false; 969 968 } 970 969 971 if (card _type == DTVTunerType::kTunerTypeDVB_S2)970 if (cardType == DTVTunerType::kTunerTypeDVB_S2) 972 971 { 973 972 // TODO implement probing of tuning parameters with FE_GET_PROPERTY 974 973 return false; … … 986 985 uint mplex = tuning.mplex; 987 986 QString sistandard = tuning.sistandard; sistandard.detach(); 988 987 989 tuning = dvbparams_to_dtvmultiplex(card _type, params);988 tuning = dvbparams_to_dtvmultiplex(cardType, params); 990 989 991 990 tuning.mplex = mplex; 992 991 tuning.sistandard = sistandard; -
libs/libmythtv/dtvchannel.cpp
13 13 14 14 DTVChannel::DTVChannel(TVRec *parent) 15 15 : ChannelBase(parent), 16 cardType(DTVTunerType::kTunerTypeUnknown), 16 17 sistandard("mpeg"), tuningMode(QString::null), 17 18 currentProgramNum(-1), 18 19 currentATSCMajorChannel(0), currentATSCMinorChannel(0),