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. | |
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 |
| Checks tuning for problems, and tries to fix them. | |
| 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 | |
Provides interface to the tuning hardware when using DVB drivers.
Definition at line 29 of file dvbchannel.h.
typedef DVBChannel* DVBChannel::DVBChannelP [private] |
Definition at line 101 of file dvbchannel.h.
typedef const DVBChannel* DVBChannel::DVBChannelCP [private] |
Definition at line 105 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 99 of file dvbchannel.cpp.
| bool DVBChannel::Open | ( | void | ) | [inline, virtual] |
Opens the channel changing hardware for use.
Implements ChannelBase.
Definition at line 35 of file dvbchannel.h.
| void DVBChannel::Close | ( | void | ) | [inline, virtual] |
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 502 of file dvbchannel.cpp.
Referenced by DVBSignalMonitor::HandleSTT(), DVBSignalMonitor::HandleTDT(), and DVBRecorder::UpdateCAMTimeOffset().
| void DVBChannel::SetSlowTuning | ( | uint | how_slow_in_ms | ) | [inline] |
Definition at line 43 of file dvbchannel.h.
| bool DVBChannel::IsOpen | ( | void | ) | const [virtual] |
Reports whether channel is already open.
Implements ChannelBase.
Definition at line 291 of file dvbchannel.cpp.
Referenced by Init().
| int DVBChannel::GetFd | ( | void | ) | const [inline, virtual] |
Returns file descriptor, -1 if it does not exist.
Reimplemented from ChannelBase.
Definition at line 48 of file dvbchannel.h.
| bool DVBChannel::IsTuningParamsProbeSupported | ( | void | ) | const |
Returns true iff tuning info probing is working.
Definition at line 834 of file dvbchannel.cpp.
Referenced by IsTuningParamsProbeSupported().
| QString DVBChannel::GetDevice | ( | void | ) | const [inline, virtual] |
Returns String representing device, useful for debugging.
Reimplemented from ChannelBase.
Definition at line 51 of file dvbchannel.h.
| QString DVBChannel::GetCardNum | ( | void | ) | const [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 824 of file dvbchannel.cpp.
| bool DVBChannel::IsMaster | ( | void | ) | const [virtual] |
Returns true if this is the first of a number of multi-rec devs.
Reimplemented from DTVChannel.
Definition at line 1147 of file dvbchannel.cpp.
| bool DVBChannel::HasCRCBug | ( | void | ) | const [inline] |
Returns true iff we have a faulty DVB driver that munges PMT.
Definition at line 58 of file dvbchannel.h.
| uint DVBChannel::GetMinSignalMonitorDelay | ( | void | ) | const [inline] |
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 966 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 975 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 1003 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 1032 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 1061 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 1087 of file dvbchannel.cpp.
Referenced by GetUncorrectedBlockCount(), and DVBSignalMonitor::UpdateValues().
| bool DVBChannel::SwitchToInput | ( | const QString & | inputname, | |
| const QString & | chan | |||
| ) | [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.
| bool DVBChannel::Tune | ( | const DTVMultiplex & | tuning, | |
| QString | inputname | |||
| ) | [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 509 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 638 of file dvbchannel.cpp.
| bool DVBChannel::Retune | ( | void | ) | [virtual] |
Reimplemented from ChannelBase.
Definition at line 819 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 880 of file dvbchannel.cpp.
Referenced by ProbeTuningParams().
| bool DVBChannel::Open | ( | DVBChannel * | who | ) | [private] |
Definition at line 173 of file dvbchannel.cpp.
| void DVBChannel::Close | ( | DVBChannel * | who | ) | [private] |
Definition at line 134 of file dvbchannel.cpp.
| int DVBChannel::GetChanID | ( | void | ) | const [private, virtual] |
Returns Channel ID.
Reimplemented from ChannelBase.
Definition at line 938 of file dvbchannel.cpp.
| void DVBChannel::CheckOptions | ( | DTVMultiplex & | tuning | ) | const [private, virtual] |
Checks tuning for problems, and tries to fix them.
Reimplemented from DTVChannel.
Definition at line 351 of file dvbchannel.cpp.
| void DVBChannel::CheckFrequency | ( | uint64_t | frequency | ) | const [private] |
Checks tuning frequency.
Definition at line 338 of file dvbchannel.cpp.
Referenced by CheckOptions(), and Tune().
| bool DVBChannel::CheckModulation | ( | DTVModulation | modulation | ) | const [private] |
Return true iff modulation is supported modulation on the frontend.
Definition at line 469 of file dvbchannel.cpp.
Referenced by CheckOptions().
| bool DVBChannel::CheckCodeRate | ( | DTVCodeRate | rate | ) | const [private] |
Return true iff rate is supported rate on the frontend.
Definition at line 450 of file dvbchannel.cpp.
Referenced by CheckOptions().
| DVBChannel * DVBChannel::GetMasterLock | ( | void | ) | [private] |
Definition at line 1112 of file dvbchannel.cpp.
Referenced by Close(), GetBitErrorRate(), GetMasterLock(), GetSignalStrength(), GetSNR(), GetUncorrectedBlockCount(), HasLock(), IsMaster(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
| void DVBChannel::ReturnMasterLock | ( | DVBChannelP & | dvbm | ) | [static, private] |
Definition at line 1122 of file dvbchannel.cpp.
Referenced by Close(), GetBitErrorRate(), GetMasterLock(), GetSignalStrength(), GetSNR(), GetUncorrectedBlockCount(), HasLock(), IsMaster(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
| const DVBChannel * DVBChannel::GetMasterLock | ( | void | ) | const [private] |
Definition at line 1129 of file dvbchannel.cpp.
| static void DVBChannel::ReturnMasterLock | ( | DVBChannelCP & | dvbm | ) | [static, private] |
IsOpenMap DVBChannel::is_open [private] |
Definition at line 110 of file dvbchannel.h.
Referenced by Close(), IsOpen(), Open(), and ~DVBChannel().
DiSEqCDev DVBChannel::diseqc_dev [private] |
Definition at line 113 of file dvbchannel.h.
Referenced by Open().
DiSEqCDevSettings DVBChannel::diseqc_settings [private] |
Definition at line 114 of file dvbchannel.h.
Referenced by GetRotor(), and Tune().
DiSEqCDevTree* DVBChannel::diseqc_tree [private] |
Definition at line 115 of file dvbchannel.h.
Referenced by CheckOptions(), Close(), GetRotor(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
DVBCam* DVBChannel::dvbcam [private] |
Used to decrypt encrypted streams.
Definition at line 116 of file dvbchannel.h.
Referenced by Close(), DVBChannel(), Open(), SetPMT(), SetTimeOffset(), and ~DVBChannel().
QString DVBChannel::frontend_name [private] |
Definition at line 119 of file dvbchannel.h.
Referenced by GetFrontendName(), and Open().
uint64_t DVBChannel::capabilities [private] |
Definition at line 120 of file dvbchannel.h.
Referenced by CheckCodeRate(), CheckModulation(), CheckOptions(), Open(), and Tune().
uint64_t DVBChannel::ext_modulations [private] |
Definition at line 121 of file dvbchannel.h.
Referenced by Open().
uint64_t DVBChannel::frequency_minimum [private] |
Definition at line 122 of file dvbchannel.h.
Referenced by CheckFrequency(), and Open().
uint64_t DVBChannel::frequency_maximum [private] |
Definition at line 123 of file dvbchannel.h.
Referenced by CheckFrequency(), and Open().
uint DVBChannel::symbol_rate_minimum [private] |
Definition at line 124 of file dvbchannel.h.
Referenced by CheckOptions(), and Open().
uint DVBChannel::symbol_rate_maximum [private] |
Definition at line 125 of file dvbchannel.h.
Referenced by CheckOptions(), and Open().
QMutex DVBChannel::tune_lock [mutable, private] |
Definition at line 128 of file dvbchannel.h.
Referenced by Tune().
QMutex DVBChannel::hw_lock [mutable, private] |
Definition at line 129 of file dvbchannel.h.
Referenced by Close(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
DTVMultiplex DVBChannel::desired_tuning [private] |
Last tuning options Tune() attempted to send to hardware.
Definition at line 131 of file dvbchannel.h.
DTVMultiplex DVBChannel::prev_tuning [private] |
Last tuning options Tune() succesfully sent to hardware.
Definition at line 133 of file dvbchannel.h.
Referenced by Tune().
uint DVBChannel::last_lnb_dev_id [private] |
Definition at line 135 of file dvbchannel.h.
Referenced by Tune().
uint DVBChannel::tuning_delay [private] |
Extra delay to add for broken drivers.
Definition at line 137 of file dvbchannel.h.
Referenced by SetSlowTuning(), and Tune().
uint DVBChannel::sigmon_delay [private] |
Minimum delay between FE_LOCK checks.
Definition at line 138 of file dvbchannel.h.
Referenced by DVBChannel(), and GetMinSignalMonitorDelay().
bool DVBChannel::first_tune [private] |
Used to force hardware reset.
Definition at line 139 of file dvbchannel.h.
int DVBChannel::fd_frontend [private] |
File descriptor for tuning hardware.
Definition at line 142 of file dvbchannel.h.
Referenced by Close(), GetBitErrorRate(), GetFd(), GetSignalStrength(), GetSNR(), GetUncorrectedBlockCount(), HasLock(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().
QString DVBChannel::device [private] |
DVB Device.
Definition at line 143 of file dvbchannel.h.
Referenced by DVBChannel(), GetMasterLock(), Open(), and ~DVBChannel().
bool DVBChannel::has_crc_bug [private] |
true iff our driver munges PMT
Definition at line 144 of file dvbchannel.h.
Referenced by DVBChannel(), and HasCRCBug().
1.6.3