|
MythTV
0.27pre
|
Provides interface to the tuning hardware when using DVB drivers. More...
#include <dvbchannel.h>


Public Member Functions | |
| DVBChannel (const QString &device, TVRec *parent=NULL) | |
| ~DVBChannel () | |
| bool | Open (void) |
| Opens the channel changing hardware for use. | |
| void | Close (void) |
| Closes the channel changing hardware to use. | |
| bool | Init (QString &inputname, QString &startchannel, bool setchan) |
| void | SetPMT (const ProgramMapTable *) |
| Tells the Conditional Access Module which streams we wish to decode. | |
| void | SetTimeOffset (double offset) |
| Tells the Conditional Access Module the offset from the computers utc time to dvb time. | |
| void | SetSlowTuning (uint how_slow_in_ms) |
| bool | IsOpen (void) const |
| Reports whether channel is already open. | |
| int | GetFd (void) const |
| Returns file descriptor, -1 if it does not exist. | |
| bool | IsTuningParamsProbeSupported (void) const |
| Returns true iff tuning info probing is working. | |
| QString | GetDevice (void) const |
| Returns String representing device, useful for debugging. | |
| QString | GetCardNum (void) const |
| Returns DVB device number, used to construct filenames for DVB devices. | |
| QString | GetFrontendName (void) const |
| Returns frontend name as reported by driver. | |
| bool | IsMaster (void) const |
| Returns true if this is the first of a number of multi-rec devs. | |
| bool | HasCRCBug (void) const |
| Returns true iff we have a faulty DVB driver that munges PMT. | |
| uint | GetMinSignalMonitorDelay (void) const |
| const DiSEqCDevRotor * | GetRotor (void) const |
| Returns rotor object if it exists, NULL otherwise. | |
| bool | HasLock (bool *ok=NULL) const |
| Returns true iff we have a signal carrier lock. | |
| double | GetSignalStrength (bool *ok=NULL) const |
| Returns signal strength in the range [0.0..1.0] (non-calibrated). | |
| double | GetSNR (bool *ok=NULL) const |
| Returns signal/noise in the range [0..1.0]. | |
| double | GetBitErrorRate (bool *ok=NULL) const |
| Returns # of corrected bits since last call. First call undefined. | |
| double | GetUncorrectedBlockCount (bool *ok=NULL) const |
| Returns # of uncorrected blocks since last call. First call undefined. | |
| bool | SwitchToInput (const QString &inputname, const QString &chan) |
| bool | SwitchToInput (int newcapchannel, bool setstarting) |
| Switches to another input on hardware, and sets the channel is setstarting is true. | |
| bool | Tune (const DTVMultiplex &tuning, QString inputname) |
| This performs the actual frequency tuning and in some cases input switching. | |
| bool | Tune (const DTVMultiplex &tuning, uint inputid, bool force_reset=false, bool same_input=false) |
| Tunes the card to a frequency but does not deal with PIDs. | |
| bool | Retune (void) |
| bool | ProbeTuningParams (DTVMultiplex &tuning) const |
| Fetches DTVMultiplex params from driver. | |
Public Member Functions inherited from DTVChannel | |
| DTVChannel (TVRec *parent) | |
| virtual | ~DTVChannel () |
| virtual bool | SetChannelByString (const QString &chan) |
| virtual bool | TuneMultiplex (uint mplexid, QString inputname) |
| To be used by the channel scanner and possibly the EIT scanner. | |
| virtual bool | Tune (const IPTVTuningData &) |
| Performs IPTV Tuning. Only implemented by IPTVChannel. | |
| virtual bool | EnterPowerSavingMode (void) |
| Enters power saving mode if the card supports it. | |
| virtual bool | Tune (const QString &freqid, int finetune) |
| This tunes on the frequency Identification parameter for hardware that supports it. | |
| virtual bool | Tune (uint64_t frequency, QString inputname) |
| int | GetProgramNumber (void) const |
| Returns program number in PAT, -1 if unknown. | |
| uint | GetMajorChannel (void) const |
| Returns major channel, 0 if unknown. | |
| uint | GetMinorChannel (void) const |
| Returns minor channel, 0 if unknown. | |
| uint | GetOriginalNetworkID (void) const |
| Returns DVB original_network_id, 0 if unknown. | |
| uint | GetTransportID (void) const |
| Returns DVB transport_stream_id, 0 if unknown. | |
| QString | GetSIStandard (void) const |
| Returns PSIP table standard: MPEG, DVB, ATSC, or OpenCable. | |
| QString | GetSuggestedTuningMode (bool is_live_tv) const |
| Returns suggested tuning mode: "mpeg", "dvb", or "atsc". | |
| QString | GetTuningMode (void) const |
| Returns tuning mode last set by SetTuningMode(). | |
| virtual vector< DTVTunerType > | GetTunerTypes (void) const |
| Returns a vector of supported tuning types. | |
| void | GetCachedPids (pid_cache_t &pid_cache) const |
| Returns cached MPEG PIDs for last tuned channel. | |
| void | RegisterForMaster (const QString &key) |
| void | DeregisterForMaster (const QString &key) |
| virtual bool | IsPIDTuningSupported (void) const |
| virtual bool | IsIPTV (void) const |
| bool | HasGeneratedPAT (void) const |
| bool | HasGeneratedPMT (void) const |
| const ProgramAssociationTable * | GetGeneratedPAT (void) const |
| const ProgramMapTable * | GetGeneratedPMT (void) const |
| void | SetTuningMode (const QString &tuningmode) |
| Sets tuning mode: "mpeg", "dvb", "atsc", etc. | |
| void | SaveCachedPids (const pid_cache_t &pid_cache) const |
| Saves MPEG PIDs to cache to database. | |
Public Member Functions inherited from ChannelBase | |
| ChannelBase (TVRec *parent) | |
| virtual | ~ChannelBase (void) |
| virtual bool | IsTunable (const QString &input, const QString &channum) const |
| virtual void | SetFormat (const QString &) |
| virtual int | SetFreqTable (const QString &) |
| virtual void | SetFd (int fd) |
| Sets file descriptor. | |
| virtual bool | IsExternalChannelChangeSupported (void) |
| virtual uint | GetNextChannel (uint chanid, ChannelChangeDirection direction) const |
| virtual uint | GetNextChannel (const QString &channum, ChannelChangeDirection direction) const |
| virtual int | GetInputByName (const QString &input) const |
| Returns number of named input, returns -1 if not found. | |
| virtual QString | GetInputByNum (int capchannel) const |
| Returns name of numbered input, returns null if not found. | |
| virtual QString | GetCurrentName (void) const |
| virtual int | GetChanID (void) const |
| virtual int | GetCurrentInputNum (void) const |
| virtual QString | GetCurrentInput (void) const |
| virtual int | GetNextInputNum (void) const |
| virtual QString | GetNextInput (void) const |
| virtual QString | GetNextInputStartChan (void) |
| virtual uint | GetCurrentSourceID (void) const |
| virtual uint | GetSourceID (int inputID) const |
| virtual uint | GetInputCardID (int inputNum) const |
| virtual ChannelInfoList | GetChannels (int inputNum) const |
| virtual ChannelInfoList | GetChannels (const QString &inputname) const |
| virtual vector< InputInfo > | GetFreeInputs (const vector< uint > &excluded_cards) const |
| Returns the recorders available inputs. | |
| virtual QStringList | GetConnectedInputs (void) const |
| Returns names of connected inputs. | |
| bool | IsCommercialFree (void) const |
| Returns true iff commercial detection is not required. | |
| virtual void | Renumber (uint srcid, const QString &oldChanNum, const QString &newChanNum) |
| Changes a channum if we have it cached anywhere. | |
| virtual bool | SwitchToInput (const QString &input) |
| virtual bool | InitializeInputs (void) |
| Fills in input map from DB. | |
| virtual void | StoreInputChannels (void) |
| Saves current channel as the default channel for the current input. | |
| virtual bool | InitPictureAttributes (void) |
| virtual int | GetPictureAttribute (PictureAttribute) const |
| virtual int | ChangePictureAttribute (PictureAdjustType, PictureAttribute, bool up) |
| bool | CheckChannel (const QString &channum, QString &inputName) const |
| void | SetCardID (uint _cardid) |
| virtual uint | GetCardID (void) const |
| Returns card id. | |
Private Types | |
| typedef DVBChannel * | DVBChannelP |
| typedef const DVBChannel * | DVBChannelCP |
Private Member Functions | |
| bool | Open (DVBChannel *) |
| void | Close (DVBChannel *) |
| int | GetChanID (void) const |
| Returns Channel ID. | |
| void | CheckOptions (DTVMultiplex &t) const |
| void | CheckFrequency (uint64_t frequency) const |
| Checks tuning frequency. | |
| bool | CheckModulation (DTVModulation modulation) const |
| Return true iff modulation is supported modulation on the frontend. | |
| bool | CheckCodeRate (DTVCodeRate rate) const |
| Return true iff rate is supported rate on the frontend. | |
| DVBChannel * | GetMasterLock (void) |
| const DVBChannel * | GetMasterLock (void) const |
Static Private Member Functions | |
| static void | ReturnMasterLock (DVBChannelP &dvbm) |
| static void | ReturnMasterLock (DVBChannelCP &dvbm) |
Private Attributes | |
| IsOpenMap | is_open |
| DiSEqCDev | diseqc_dev |
| DiSEqCDevSettings | diseqc_settings |
| DiSEqCDevTree * | diseqc_tree |
| DVBCam * | dvbcam |
| Used to decrypt encrypted streams. | |
| QString | frontend_name |
| uint64_t | capabilities |
| uint64_t | ext_modulations |
| uint64_t | frequency_minimum |
| uint64_t | frequency_maximum |
| uint | symbol_rate_minimum |
| uint | symbol_rate_maximum |
| QMutex | tune_lock |
| QMutex | hw_lock |
| DTVMultiplex | desired_tuning |
| Last tuning options Tune() attempted to send to hardware. | |
| DTVMultiplex | prev_tuning |
| Last tuning options Tune() succesfully sent to hardware. | |
| uint | last_lnb_dev_id |
| uint | tuning_delay |
| Extra delay to add for broken drivers. | |
| uint | sigmon_delay |
| Minimum delay between FE_LOCK checks. | |
| bool | first_tune |
| Used to force hardware reset. | |
| int | fd_frontend |
| File descriptor for tuning hardware. | |
| QString | device |
| DVB Device. | |
| bool | has_crc_bug |
| true iff our driver munges PMT | |
Additional Inherited Members | |
Public Types inherited from DTVChannel | |
| typedef DTVChannel * | DTVChannelP |
Static Public Member Functions inherited from DTVChannel | |
| static DTVChannel * | GetMasterLock (const QString &key) |
| static void | ReturnMasterLock (DTVChannelP &) |
Protected Types inherited from DTVChannel | |
| typedef QMap< QString, QList < DTVChannel * > > | MasterMap |
Protected Member Functions inherited from DTVChannel | |
| void | SetSIStandard (const QString &) |
| Sets PSIP table standard: MPEG, DVB, ATSC, or OpenCable. | |
| void | SetDTVInfo (uint atsc_major, uint atsc_minor, uint dvb_orig_netid, uint mpeg_tsid, int mpeg_pnum) |
| void | ClearDTVInfo (void) |
| virtual void | CheckOptions (DTVMultiplex &tuning) const |
| Checks tuning for problems, and tries to fix them. | |
| virtual void | HandleScriptEnd (bool ok) |
Static Protected Member Functions inherited from ChannelBase | |
| static void | StoreInputChannels (const InputMap &) |
| Sets starting channel for the each input in the input map. | |
Protected Attributes inherited from DTVChannel | |
| QMutex | dtvinfo_lock |
| DTVTunerType | tunerType |
| QString | sistandard |
| PSIP table standard: MPEG, DVB, ATSC, OpenCable. | |
| QString | tuningMode |
| int | currentProgramNum |
| uint | currentATSCMajorChannel |
| uint | currentATSCMinorChannel |
| uint | currentTransportID |
| uint | currentOriginalNetworkID |
| ProgramAssociationTable * | genPAT |
| This is a generated PAT for RAW pid tuning. | |
| ProgramMapTable * | genPMT |
| This is a generated PMT for RAW pid tuning. | |
Static Protected Attributes inherited from DTVChannel | |
| static QReadWriteLock | master_map_lock |
| static MasterMap | master_map |
Provides interface to the tuning hardware when using DVB drivers.
Definition at line 29 of file dvbchannel.h.
|
private |
Definition at line 103 of file dvbchannel.h.
|
private |
Definition at line 107 of file dvbchannel.h.
| DVBChannel::DVBChannel | ( | const QString & | device, |
| TVRec * | parent = NULL |
||
| ) |
Definition at line 65 of file dvbchannel.cpp.
| DVBChannel::~DVBChannel | ( | ) |
Definition at line 101 of file dvbchannel.cpp.
Opens the channel changing hardware for use.
Implements ChannelBase.
Definition at line 35 of file dvbchannel.h.
Closes the channel changing hardware to use.
Implements ChannelBase.
Definition at line 36 of file dvbchannel.h.
Referenced by Close(), Open(), and ~DVBChannel().
Reimplemented from ChannelBase.
Definition at line 297 of file dvbchannel.cpp.
| void DVBChannel::SetPMT | ( | const ProgramMapTable * | pmt | ) |
Tells the Conditional Access Module which streams we wish to decode.
Definition at line 492 of file dvbchannel.cpp.
Referenced by DVBSignalMonitor::HandlePMT(), DVBRecorder::SetCAMPMT(), and ChannelScanSM::TestNextProgramEncryption().
| void DVBChannel::SetTimeOffset | ( | double | offset | ) |
Tells the Conditional Access Module the offset from the computers utc time to dvb time.
Definition at line 504 of file dvbchannel.cpp.
Referenced by DVBSignalMonitor::HandleSTT(), DVBSignalMonitor::HandleTDT(), and DVBRecorder::UpdateCAMTimeOffset().
Definition at line 43 of file dvbchannel.h.
Reports whether channel is already open.
Implements ChannelBase.
Definition at line 291 of file dvbchannel.cpp.
Referenced by Init().
Returns file descriptor, -1 if it does not exist.
Reimplemented from ChannelBase.
Definition at line 48 of file dvbchannel.h.
Returns true iff tuning info probing is working.
Definition at line 836 of file dvbchannel.cpp.
Referenced by IsTuningParamsProbeSupported().
|
inlinevirtual |
Returns String representing device, useful for debugging.
Reimplemented from ChannelBase.
Definition at line 51 of file dvbchannel.h.
|
inline |
Returns DVB device number, used to construct filenames for DVB devices.
Definition at line 53 of file dvbchannel.h.
Referenced by DVBSignalMonitor::DVBSignalMonitor().
| QString DVBChannel::GetFrontendName | ( | void | ) | const |
Returns frontend name as reported by driver.
Definition at line 826 of file dvbchannel.cpp.
Returns true if this is the first of a number of multi-rec devs.
Reimplemented from DTVChannel.
Definition at line 1146 of file dvbchannel.cpp.
Returns true iff we have a faulty DVB driver that munges PMT.
Definition at line 58 of file dvbchannel.h.
Definition at line 59 of file dvbchannel.h.
Referenced by DVBSignalMonitor::DVBSignalMonitor().
| const DiSEqCDevRotor * DVBChannel::GetRotor | ( | void | ) | const |
Returns rotor object if it exists, NULL otherwise.
Definition at line 965 of file dvbchannel.cpp.
Referenced by ChannelScanSM::ChannelScanSM(), DVBSignalMonitor::GetRotorStatus(), ChannelScanSM::HasTimedOut(), DVBStreamHandler::RetuneMonitor(), and DVBSignalMonitor::UpdateValues().
Returns true iff we have a signal carrier lock.
Definition at line 974 of file dvbchannel.cpp.
Referenced by DVBSignalMonitor::DVBSignalMonitor(), HasLock(), and DVBSignalMonitor::UpdateValues().
| double DVBChannel::GetSignalStrength | ( | bool * | ok = NULL | ) | const |
Returns signal strength in the range [0.0..1.0] (non-calibrated).
Definition at line 1002 of file dvbchannel.cpp.
Referenced by GetSignalStrength(), and DVBSignalMonitor::UpdateValues().
| double DVBChannel::GetSNR | ( | bool * | ok = NULL | ) | const |
Returns signal/noise in the range [0..1.0].
Some drivers report the actual ratio, while others report the dB, but in this case some weak signals may report a very high S/N since negative dB are not supported by MythTV or the 4.0 version of the DVB API due to the large number of drivers that ignored the fact that this was a signed number in the 3.0 API.
Definition at line 1031 of file dvbchannel.cpp.
Referenced by GetSNR(), and DVBSignalMonitor::UpdateValues().
| double DVBChannel::GetBitErrorRate | ( | bool * | ok = NULL | ) | const |
Returns # of corrected bits since last call. First call undefined.
Definition at line 1060 of file dvbchannel.cpp.
Referenced by GetBitErrorRate(), and DVBSignalMonitor::UpdateValues().
| double DVBChannel::GetUncorrectedBlockCount | ( | bool * | ok = NULL | ) | const |
Returns # of uncorrected blocks since last call. First call undefined.
Definition at line 1086 of file dvbchannel.cpp.
Referenced by GetUncorrectedBlockCount(), and DVBSignalMonitor::UpdateValues().
|
virtual |
Reimplemented from ChannelBase.
Definition at line 305 of file dvbchannel.cpp.
Switches to another input on hardware, and sets the channel is setstarting is true.
Reimplemented from ChannelBase.
Definition at line 324 of file dvbchannel.cpp.
|
virtual |
This performs the actual frequency tuning and in some cases input switching.
In rare cases such as ASI this does nothing since all the channels are in the same MPTS stream on the same input. But generally you will need to implement this when adding support for new hardware.
Implements DTVChannel.
Definition at line 511 of file dvbchannel.cpp.
| bool DVBChannel::Tune | ( | const DTVMultiplex & | tuning, |
| uint | inputid, | ||
| bool | force_reset = false, |
||
| bool | same_input = false |
||
| ) |
Tunes the card to a frequency but does not deal with PIDs.
This is used by DVB Channel Scanner, the EIT Parser, and by TVRec.
| tuning | Info on transport to tune to |
| inputid | Optional, forces specific input (for DiSEqC) |
| force_reset | If true, frequency tuning is done even if it should not be needed. |
| same_input | Optional, doesn't change input (for retuning). |
Definition at line 640 of file dvbchannel.cpp.
Reimplemented from ChannelBase.
Definition at line 821 of file dvbchannel.cpp.
Referenced by DVBStreamHandler::RetuneMonitor().
| bool DVBChannel::ProbeTuningParams | ( | DTVMultiplex & | tuning | ) | const |
Fetches DTVMultiplex params from driver.
Note: Only updates tuning on success.
Definition at line 882 of file dvbchannel.cpp.
Referenced by ProbeTuningParams().
|
private |
Definition at line 175 of file dvbchannel.cpp.
|
private |
Definition at line 136 of file dvbchannel.cpp.
Returns Channel ID.
Definition at line 940 of file dvbchannel.cpp.
|
private |
Definition at line 351 of file dvbchannel.cpp.
|
private |
Checks tuning frequency.
Definition at line 338 of file dvbchannel.cpp.
Referenced by CheckOptions(), and Tune().
|
private |
Return true iff modulation is supported modulation on the frontend.
Definition at line 469 of file dvbchannel.cpp.
Referenced by CheckOptions().
|
private |
Return true iff rate is supported rate on the frontend.
Definition at line 450 of file dvbchannel.cpp.
Referenced by CheckOptions().
|
private |
Definition at line 1111 of file dvbchannel.cpp.
Referenced by Close(), GetBitErrorRate(), GetMasterLock(), GetSignalStrength(), GetSNR(), GetUncorrectedBlockCount(), HasLock(), IsMaster(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
|
staticprivate |
Definition at line 1121 of file dvbchannel.cpp.
Referenced by Close(), GetBitErrorRate(), GetMasterLock(), GetSignalStrength(), GetSNR(), GetUncorrectedBlockCount(), HasLock(), IsMaster(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
|
private |
Definition at line 1128 of file dvbchannel.cpp.
|
staticprivate |
|
private |
Definition at line 112 of file dvbchannel.h.
Referenced by Close(), IsOpen(), Open(), and ~DVBChannel().
|
private |
Definition at line 115 of file dvbchannel.h.
Referenced by Open().
|
private |
Definition at line 116 of file dvbchannel.h.
Referenced by GetRotor(), and Tune().
|
private |
Definition at line 117 of file dvbchannel.h.
Referenced by CheckOptions(), Close(), GetRotor(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
|
private |
Used to decrypt encrypted streams.
Definition at line 118 of file dvbchannel.h.
Referenced by Close(), DVBChannel(), SetPMT(), SetTimeOffset(), and ~DVBChannel().
|
private |
Definition at line 121 of file dvbchannel.h.
Referenced by GetFrontendName(), and Open().
|
private |
Definition at line 122 of file dvbchannel.h.
Referenced by CheckCodeRate(), CheckModulation(), CheckOptions(), Open(), and Tune().
|
private |
Definition at line 123 of file dvbchannel.h.
Referenced by Open().
|
private |
Definition at line 124 of file dvbchannel.h.
Referenced by CheckFrequency(), and Open().
|
private |
Definition at line 125 of file dvbchannel.h.
Referenced by CheckFrequency(), and Open().
|
private |
Definition at line 126 of file dvbchannel.h.
Referenced by CheckOptions(), and Open().
|
private |
Definition at line 127 of file dvbchannel.h.
Referenced by CheckOptions(), and Open().
|
mutableprivate |
Definition at line 130 of file dvbchannel.h.
Referenced by Tune().
|
mutableprivate |
Definition at line 131 of file dvbchannel.h.
Referenced by Close(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
|
private |
Last tuning options Tune() attempted to send to hardware.
Definition at line 133 of file dvbchannel.h.
|
private |
Last tuning options Tune() succesfully sent to hardware.
Definition at line 135 of file dvbchannel.h.
Referenced by Tune().
|
private |
Definition at line 137 of file dvbchannel.h.
Referenced by Tune().
|
private |
Extra delay to add for broken drivers.
Definition at line 139 of file dvbchannel.h.
Referenced by SetSlowTuning(), and Tune().
|
private |
Minimum delay between FE_LOCK checks.
Definition at line 140 of file dvbchannel.h.
Referenced by DVBChannel(), and GetMinSignalMonitorDelay().
|
private |
Used to force hardware reset.
Definition at line 141 of file dvbchannel.h.
|
private |
File descriptor for tuning hardware.
Definition at line 144 of file dvbchannel.h.
Referenced by Close(), GetBitErrorRate(), GetFd(), GetSignalStrength(), GetSNR(), GetUncorrectedBlockCount(), HasLock(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
|
private |
DVB Device.
Definition at line 145 of file dvbchannel.h.
Referenced by DVBChannel(), GetCardNum(), GetDevice(), GetMasterLock(), Open(), and ~DVBChannel().
|
private |
true iff our driver munges PMT
Definition at line 146 of file dvbchannel.h.
Referenced by DVBChannel(), and HasCRCBug().
1.8.1.2