DVBChannel Class Reference

#include <dvbchannel.h>

Inheritance diagram for DVBChannel:

DTVChannel ChannelBase

List of all members.


Detailed Description

Provides interface to the tuning hardware when using DVB drivers.

Bug:
Only supports single input cards.

Definition at line 28 of file dvbchannel.h.


Public Member Functions

 DVBChannel (int cardnum, 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.
int 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.
DTVTunerType GetCardType (void) const
bool IsMaster (void) const
bool HasCRCBug (void) const
 Returns true iff we have a faulty DVB driver that munges PMT.
uint GetMinSignalMonitorDelay (void) const
const DiSEqCDevRotorGetRotor (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.
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 SetChannelByString (const QString &chan)
bool Tune (const DTVMultiplex &tuning, QString inputname)
 To be used by the channel scanner and possibly the EIT scanner.
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 TuneMultiplex (uint mplexid, QString inputname)
 To be used by the channel scanner and possibly the EIT scanner.
bool Retune (void)
bool ProbeTuningParams (DTVMultiplex &tuning) const
 Fetches DTVMultiplex params from driver.
void SaveCachedPids (const pid_cache_t &) const
 Saves MPEG PIDs to cache to database.
void GetCachedPids (pid_cache_t &) const
 Returns cached MPEG PIDs for last tuned channel.

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.
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.

Private Attributes

DVBChannelmaster
IsOpenMap is_open
DiSEqCDev diseqc_dev
DiSEqCDevSettings diseqc_settings
DiSEqCDevTreediseqc_tree
DVBCamdvbcam
 Used to decrypt encrypted streams.
QString frontend_name
DTVTunerType card_type
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.
int cardnum
 DVB Card number.
bool has_crc_bug
 true iff our driver munges PMT
int nextInputID
 Signal an input change.

Constructor & Destructor Documentation

DVBChannel::DVBChannel ( int  cardnum,
TVRec parent = NULL 
)

Definition at line 68 of file dvbchannel.cpp.

DVBChannel::~DVBChannel (  ) 

Definition at line 101 of file dvbchannel.cpp.


Member Function Documentation

bool DVBChannel::Open ( void   )  [inline, virtual]

Opens the channel changing hardware for use.

Implements ChannelBase.

Definition at line 34 of file dvbchannel.h.

Referenced by Init(), and Open().

void DVBChannel::Close ( void   )  [inline, virtual]

Closes the channel changing hardware to use.

Implements ChannelBase.

Definition at line 35 of file dvbchannel.h.

Referenced by Close(), Open(), and ~DVBChannel().

bool DVBChannel::Init ( QString &  inputname,
QString &  startchannel,
bool  setchan 
) [virtual]

Reimplemented from ChannelBase.

Definition at line 300 of file dvbchannel.cpp.

void DVBChannel::SetPMT ( const ProgramMapTable pmt  ) 

Tells the Conditional Access Module which streams we wish to decode.

Definition at line 621 of file dvbchannel.cpp.

Referenced by DVBSignalMonitor::HandlePMT(), and DVBRecorder::HandlePMT().

void DVBChannel::SetTimeOffset ( double  offset  ) 

Tells the Conditional Access Module the offset from the computers utc time to dvb time.

Definition at line 631 of file dvbchannel.cpp.

Referenced by DVBSignalMonitor::HandleSTT(), DVBRecorder::HandleSTT(), DVBSignalMonitor::HandleTDT(), and DVBRecorder::HandleTDT().

void DVBChannel::SetSlowTuning ( uint  how_slow_in_ms  )  [inline]

Definition at line 42 of file dvbchannel.h.

Referenced by TVRec::CreateChannel().

bool DVBChannel::IsOpen ( void   )  const [virtual]

Reports whether channel is already open.

Implements ChannelBase.

Definition at line 294 of file dvbchannel.cpp.

Referenced by Init(), and SetChannelByString().

int DVBChannel::GetFd ( void   )  const [inline, virtual]

Returns file descriptor, -1 if it does not exist.

Reimplemented from ChannelBase.

Definition at line 47 of file dvbchannel.h.

bool DVBChannel::IsTuningParamsProbeSupported ( void   )  const

Returns true iff tuning info probing is working.

Definition at line 812 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 50 of file dvbchannel.h.

int DVBChannel::GetCardNum ( void   )  const [inline]

Returns DVB device number, used to construct filenames for DVB devices.

Definition at line 52 of file dvbchannel.h.

Referenced by DVBSignalMonitor::DVBSignalMonitor(), and GetDevice().

QString DVBChannel::GetFrontendName ( void   )  const

Returns frontend name as reported by driver.

Definition at line 804 of file dvbchannel.cpp.

DTVTunerType DVBChannel::GetCardType ( void   )  const [inline]

Definition at line 55 of file dvbchannel.h.

bool DVBChannel::IsMaster ( void   )  const [inline]

Definition at line 56 of file dvbchannel.h.

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 933 of file dvbchannel.cpp.

Referenced by DVBSignalMonitor::GetRotorStatus(), DVBStreamHandler::RetuneMonitor(), and SIScan::Tune().

bool DVBChannel::HasLock ( bool ok = NULL  )  const

Returns true iff we have a signal carrier lock.

Definition at line 942 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 958 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 976 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 994 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 1009 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 425 of file dvbchannel.cpp.

bool DVBChannel::SwitchToInput ( int  inputNum,
bool  setstarting 
) [virtual]

Switches to another input on hardware, and sets the channel is setstarting is true.

Reimplemented from ChannelBase.

Definition at line 444 of file dvbchannel.cpp.

bool DVBChannel::SetChannelByString ( const QString &  chan  )  [virtual]

Implements ChannelBase.

Definition at line 320 of file dvbchannel.cpp.

Referenced by SwitchToInput().

bool DVBChannel::Tune ( const DTVMultiplex tuning,
QString  inputname 
) [virtual]

To be used by the channel scanner and possibly the EIT scanner.

Implements DTVChannel.

Definition at line 638 of file dvbchannel.cpp.

Referenced by Retune(), SetChannelByString(), Tune(), and TuneMultiplex().

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.

Parameters:
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).
Returns:
true on success, false on failure

Definition at line 666 of file dvbchannel.cpp.

bool DVBChannel::TuneMultiplex ( uint  mplexid,
QString  inputname 
) [virtual]

To be used by the channel scanner and possibly the EIT scanner.

Implements DTVChannel.

Definition at line 309 of file dvbchannel.cpp.

bool DVBChannel::Retune ( void   )  [virtual]

Reimplemented from ChannelBase.

Definition at line 799 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.

Returns:
true on success, false on failure

Definition at line 845 of file dvbchannel.cpp.

Referenced by SIScan::InsertMultiplex(), and ProbeTuningParams().

void DVBChannel::SaveCachedPids ( const pid_cache_t pid_cache  )  const [virtual]

Saves MPEG PIDs to cache to database.

Parameters:
pid_cache List of PIDs with their TableID types to be saved.

Reimplemented from DTVChannel.

Definition at line 919 of file dvbchannel.cpp.

void DVBChannel::GetCachedPids ( pid_cache_t pid_cache  )  const [virtual]

Returns cached MPEG PIDs for last tuned channel.

Parameters:
pid_cache List of PIDs with their TableID types is returned in pid_cache.

Reimplemented from DTVChannel.

Definition at line 926 of file dvbchannel.cpp.

bool DVBChannel::Open ( DVBChannel who  )  [private]

Definition at line 150 of file dvbchannel.cpp.

void DVBChannel::Close ( DVBChannel who  )  [private]

Definition at line 114 of file dvbchannel.cpp.

int DVBChannel::GetChanID ( void   )  const [private, virtual]

Returns Channel ID.

Bug:
This only works if there is only one input on the card.

Reimplemented from ChannelBase.

Definition at line 891 of file dvbchannel.cpp.

Referenced by GetCachedPids(), and SaveCachedPids().

void DVBChannel::CheckOptions ( DTVMultiplex t  )  const [private]

Checks tuning for problems, and tries to fix them.

Definition at line 464 of file dvbchannel.cpp.

Referenced by SetChannelByString(), and TuneMultiplex().

bool DVBChannel::CheckModulation ( DTVModulation  modulation  )  const [private]

Return true iff modulation is supported modulation on the frontend.

Definition at line 592 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 573 of file dvbchannel.cpp.

Referenced by CheckOptions().


Member Data Documentation

Definition at line 108 of file dvbchannel.h.

Referenced by Close(), IsOpen(), and Open().

Definition at line 111 of file dvbchannel.h.

Referenced by Open().

Definition at line 112 of file dvbchannel.h.

Referenced by CheckOptions(), GetRotor(), and Tune().

Used to decrypt encrypted streams.

Definition at line 114 of file dvbchannel.h.

Referenced by Close(), DVBChannel(), Open(), SetPMT(), SetTimeOffset(), and ~DVBChannel().

QString DVBChannel::frontend_name [private]

Definition at line 117 of file dvbchannel.h.

Referenced by GetFrontendName(), and Open().

Definition at line 119 of file dvbchannel.h.

Referenced by CheckCodeRate(), CheckModulation(), CheckOptions(), Open(), and Tune().

Definition at line 120 of file dvbchannel.h.

Referenced by CheckModulation(), and Open().

Definition at line 121 of file dvbchannel.h.

Referenced by CheckOptions(), and Open().

Definition at line 122 of file dvbchannel.h.

Referenced by CheckOptions(), and Open().

Definition at line 123 of file dvbchannel.h.

Referenced by CheckOptions(), and Open().

Definition at line 124 of file dvbchannel.h.

Referenced by CheckOptions(), and Open().

QMutex DVBChannel::tune_lock [mutable, private]

Definition at line 127 of file dvbchannel.h.

Referenced by Tune().

QMutex DVBChannel::hw_lock [mutable, private]

Definition at line 128 of file dvbchannel.h.

Referenced by Close(), IsTuningParamsProbeSupported(), Open(), ProbeTuningParams(), and Tune().

Last tuning options Tune() attempted to send to hardware.

Definition at line 130 of file dvbchannel.h.

Referenced by Retune(), and Tune().

Last tuning options Tune() succesfully sent to hardware.

Definition at line 132 of file dvbchannel.h.

Referenced by Tune().

Definition at line 134 of file dvbchannel.h.

Referenced by Tune().

Extra delay to add for broken drivers.

Definition at line 136 of file dvbchannel.h.

Referenced by SetSlowTuning(), and Tune().

Minimum delay between FE_LOCK checks.

Definition at line 137 of file dvbchannel.h.

Referenced by DVBChannel(), and GetMinSignalMonitorDelay().

Used to force hardware reset.

Definition at line 138 of file dvbchannel.h.

Referenced by Open(), and Tune().

int DVBChannel::fd_frontend [private]

int DVBChannel::cardnum [private]

DVB Card number.

Definition at line 142 of file dvbchannel.h.

Referenced by DVBChannel(), and Open().

true iff our driver munges PMT

Definition at line 143 of file dvbchannel.h.

Referenced by DVBChannel(), and HasCRCBug().

int DVBChannel::nextInputID [private]

Signal an input change.

Definition at line 144 of file dvbchannel.h.

Referenced by Open(), SetChannelByString(), and SwitchToInput().


The documentation for this class was generated from the following files:

Generated on Sat Sep 4 05:16:01 2010 for MythTV by  doxygen 1.5.5