MythTV  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AnalogSignalMonitor Class Reference

#include <analogsignalmonitor.h>

Inheritance diagram for AnalogSignalMonitor:
Inheritance graph
[legend]
Collaboration diagram for AnalogSignalMonitor:
Collaboration graph
[legend]

Public Member Functions

 AnalogSignalMonitor (int db_cardnum, V4LChannel *_channel, bool _release_stream, uint64_t _flags=kSigMon_WaitForSig)
 
void UpdateValues (void) override
 This should be overridden to actually do signal monitoring. More...
 
- Public Member Functions inherited from SignalMonitor
virtual ~SignalMonitor ()
 Stops monitoring thread. More...
 
virtual void Start ()
 Start signal monitoring thread. More...
 
virtual void Stop ()
 Stop signal monitoring thread. More...
 
virtual void AddFlags (uint64_t _flags)
 
virtual void RemoveFlags (uint64_t _flags)
 
bool HasFlags (uint64_t _flags) const
 
bool HasAnyFlag (uint64_t _flags) const
 
uint64_t GetFlags (void) const
 
virtual bool HasExtraSlowTuning (void) const
 
bool GetNotifyFrontend () const
 Returns whether or not a SIGNAL MythEvent is being sent regularly to the frontend. More...
 
int GetUpdateRate () const
 Returns milliseconds between signal monitoring events. More...
 
virtual QStringList GetStatusList (void) const
 Returns QStringList containing all signals and their current values. More...
 
bool HasSignalLock (void) const
 Returns true iff scriptStatus.IsGood() and signalLock.IsGood() return true. More...
 
virtual bool IsAllGood (void) const
 
bool IsErrored (void) const
 
void SetNotifyFrontend (bool notify)
 Enables or disables frontend notification of the current signal value. More...
 
void SetMonitoring (TVRec *parent, bool EITscan, bool monitor)
 Indicate if table monitoring is needed. More...
 
void SetUpdateRate (int msec)
 Sets the number of milliseconds between signal monitoring attempts in the signal monitoring thread. More...
 
void AddListener (SignalMonitorListener *listener)
 
void RemoveListener (SignalMonitorListener *listener)
 
void SendMessage (SignalMonitorMessageType type, const SignalMonitorValue &val)
 
void SendMessageAllGood (void)
 
virtual void EmitStatus (void)
 

Private Member Functions

bool VerifyHDPVRaudio (int videofd)
 
bool handleHDPVR (int videofd)
 

Private Attributes

bool m_usingv4l2 {false}
 
QString m_card
 
QString m_driver
 
uint32_t m_version {0}
 
uint m_width {0}
 
int m_stable_time {2000}
 
uint m_lock_cnt {0}
 
MythTimer m_timer
 
int m_log_idx {40}
 

Additional Inherited Members

- Static Public Member Functions inherited from SignalMonitor
static bool IsRequired (const QString &cardtype)
 Returns true iff the card type supports signal monitoring. More...
 
static bool IsSupported (const QString &cardtype)
 
static SignalMonitorInit (const QString &cardtype, int db_cardnum, ChannelBase *channel, bool release_stream)
 
- Static Public Attributes inherited from SignalMonitor
static const uint64_t kDTVSigMon_PATSeen = 0x0000000001ULL
 We've seen a PAT, which maps MPEG program numbers to pids where we find PMTs. More...
 
static const uint64_t kDTVSigMon_PMTSeen = 0x0000000002ULL
 We've seen a PMT, which maps program to audio, video and other stream PIDs. More...
 
static const uint64_t kDTVSigMon_MGTSeen = 0x0000000004ULL
 We've seen a MGT, which tells us on which PIDs to find VCT and other ATSC tables. More...
 
static const uint64_t kDTVSigMon_VCTSeen = 0x0000000008ULL
 We've seen a VCT, which maps ATSC Channels to MPEG program numbers, and provides additional data. More...
 
static const uint64_t kDTVSigMon_TVCTSeen = 0x0000000010ULL
 We've seen a TVCT, the terrestrial version of the VCT. More...
 
static const uint64_t kDTVSigMon_CVCTSeen = 0x0000000020ULL
 We've seen a CVCT, the cable version of the VCT. More...
 
static const uint64_t kDTVSigMon_NITSeen = 0x0000000040ULL
 We've seen a NIT, which tells us where to find SDT and other DVB tables. More...
 
static const uint64_t kDTVSigMon_SDTSeen = 0x0000000080ULL
 We've seen a SDT, which maps DVB Channels to MPEG program numbers, and provides additional data. More...
 
static const uint64_t kFWSigMon_PowerSeen = 0x0000000100ULL
 We've seen the FireWire STB power state. More...
 
static const uint64_t kDTVSigMon_CryptSeen = 0x0000000200ULL
 We've seen something indicating whether the data stream is encrypted. More...
 
static const uint64_t kDTVSigMon_PATMatch = 0x0000001000ULL
 We've seen a PAT matching our requirements. More...
 
static const uint64_t kDTVSigMon_PMTMatch = 0x0000002000ULL
 We've seen a PMT matching our requirements. More...
 
static const uint64_t kDTVSigMon_MGTMatch = 0x0000004000ULL
 We've seen an MGT matching our requirements. More...
 
static const uint64_t kDTVSigMon_VCTMatch = 0x0000008000ULL
 We've seen a VCT matching our requirements. More...
 
static const uint64_t kDTVSigMon_TVCTMatch = 0x0000010000ULL
 We've seen a TVCT matching our requirements. More...
 
static const uint64_t kDTVSigMon_CVCTMatch = 0x0000020000ULL
 We've seen a CVCT matching our requirements. More...
 
static const uint64_t kDTVSigMon_NITMatch = 0x0000040000ULL
 We've seen an NIT matching our requirements. More...
 
static const uint64_t kDTVSigMon_SDTMatch = 0x0000080000ULL
 We've seen an SDT matching our requirements. More...
 
static const uint64_t kFWSigMon_PowerMatch = 0x0000100000ULL
 We've seen a FireWire STB power state matching our requirements. More...
 
static const uint64_t kDTVSigMon_CryptMatch = 0x0000200000ULL
 We've seen unencrypted data in data stream. More...
 
static const uint64_t kDTVSigMon_WaitForPAT = 0x0001000000ULL
 
static const uint64_t kDTVSigMon_WaitForPMT = 0x0002000000ULL
 
static const uint64_t kDTVSigMon_WaitForMGT = 0x0004000000ULL
 
static const uint64_t kDTVSigMon_WaitForVCT = 0x0008000000ULL
 
static const uint64_t kDTVSigMon_WaitForNIT = 0x0010000000ULL
 
static const uint64_t kDTVSigMon_WaitForSDT = 0x0020000000ULL
 
static const uint64_t kSigMon_WaitForSig = 0x0040000000ULL
 
static const uint64_t kFWSigMon_WaitForPower = 0x0080000000ULL
 
static const uint64_t kDTVSigMon_WaitForCrypt =0x0100000000ULL
 
static const uint64_t kDTVSigMon_WaitForAll = 0x01FF000000ULL
 
static const uint64_t kDVBSigMon_WaitForSNR = 0x1000000000ULL
 Wait for the Signal to Noise Ratio to rise above a threshold. More...
 
static const uint64_t kDVBSigMon_WaitForBER = 0x2000000000ULL
 Wait for the Bit Error Rate to fall below a threshold. More...
 
static const uint64_t kDVBSigMon_WaitForUB = 0x4000000000ULL
 Wait for uncorrected FEC blocks to fall below a threshold. More...
 
static const uint64_t kDVBSigMon_WaitForPos = 0x8000000000ULL
 Wait for rotor to complete turning the antenna. More...
 
- Protected Member Functions inherited from SignalMonitor
 SignalMonitor (int _inputid, ChannelBase *_channel, bool _release_stream, uint64_t wait_for_mask)
 Initializes signal lock and signal values. More...
 
 SignalMonitor (int, ChannelBase *, uint64_t, bool)=delete
 
void run (void) override
 Basic signal monitoring loop. More...
 
- Protected Member Functions inherited from MThread
int exec (void)
 Enters the qt event loop. call exit or quit to exit thread. More...
 
 MThread (const QString &objectName)
 Standard constructor. More...
 
 MThread (const QString &objectName, QRunnable *runnable)
 Use this constructor if you want the default run() method to run the QRunnable's run() method instead of entering the Qt event loop. More...
 
virtual ~MThread ()
 
void RunProlog (void)
 Sets up a thread, call this if you reimplement run(). More...
 
void RunEpilog (void)
 Cleans up a thread's resources, call this if you reimplement run(). More...
 
QThread * qthread (void)
 Returns the thread, this will always return the same pointer no matter how often you restart the thread. More...
 
void setObjectName (const QString &name)
 
QString objectName (void) const
 
void setPriority (QThread::Priority priority)
 
QThread::Priority priority (void) const
 
bool isFinished (void) const
 
bool isRunning (void) const
 
void setStackSize (uint stackSize)
 
uint stackSize (void) const
 
void exit (int retcode=0)
 Use this to exit from the thread if you are using a Qt event loop. More...
 
void start (QThread::Priority=QThread::InheritPriority)
 Tell MThread to start running the thread in the near future. More...
 
void terminate (void)
 Kill a thread unsafely. More...
 
void quit (void)
 calls exit(0) More...
 
bool wait (unsigned long time=ULONG_MAX)
 Wait for the MThread to exit, with a maximum timeout. More...
 
- Static Protected Member Functions inherited from MThread
static void setTerminationEnabled (bool enabled=true)
 
static void sleep (unsigned long time)
 
static void msleep (unsigned long time)
 
static void usleep (unsigned long time)
 
static void ThreadSetup (const QString &)
 This is to be called on startup in those few threads that haven't been ported to MThread. More...
 
static void ThreadCleanup (void)
 This is to be called on exit in those few threads that haven't been ported to MThread. More...
 
static void Cleanup (void)
 This will print out all the running threads, call exit(1) on each and then wait up to 5 seconds total for all the threads to exit. More...
 
static void GetAllThreadNames (QStringList &list)
 
static void GetAllRunningThreadNames (QStringList &list)
 
- Protected Attributes inherited from SignalMonitor
ChannelBasem_channel {nullptr}
 
TVRecm_pParent {nullptr}
 
int m_inputid
 
volatile uint64_t m_flags
 
bool m_release_stream
 
int m_update_rate {25}
 
uint m_minimum_update_rate {5}
 
bool m_update_done {false}
 
bool m_notify_frontend {true}
 
bool m_tablemon {false}
 
bool m_eit_scan {false}
 
QString m_error
 
SignalMonitorValue m_signalLock
 
SignalMonitorValue m_signalStrength
 
SignalMonitorValue m_scriptStatus
 
vector< SignalMonitorListener * > m_listeners
 
QMutex m_startStopLock
 
QWaitCondition m_startStopWait
 
volatile bool m_running {false}
 
volatile bool m_exit {false}
 
QMutex m_statusLock {QMutex::Recursive}
 
QMutex m_listenerLock
 
- Protected Attributes inherited from MThread
MThreadInternalm_thread {nullptr}
 
QRunnable * m_runnable {nullptr}
 
bool m_prolog_executed {true}
 
bool m_epilog_executed {true}
 
- Static Protected Attributes inherited from MThread
static const int kDefaultStartTimeout
 

Detailed Description

Definition at line 12 of file analogsignalmonitor.h.

Constructor & Destructor Documentation

◆ AnalogSignalMonitor()

AnalogSignalMonitor::AnalogSignalMonitor ( int  db_cardnum,
V4LChannel _channel,
bool  _release_stream,
uint64_t  _flags = kSigMon_WaitForSig 
)

Definition at line 20 of file analogsignalmonitor.cpp.

Member Function Documentation

◆ UpdateValues()

void AnalogSignalMonitor::UpdateValues ( void  )
overridevirtual

This should be overridden to actually do signal monitoring.

Reimplemented from SignalMonitor.

Definition at line 160 of file analogsignalmonitor.cpp.

◆ VerifyHDPVRaudio()

bool AnalogSignalMonitor::VerifyHDPVRaudio ( int  videofd)
private

Definition at line 39 of file analogsignalmonitor.cpp.

Referenced by handleHDPVR().

◆ handleHDPVR()

bool AnalogSignalMonitor::handleHDPVR ( int  videofd)
private

Definition at line 115 of file analogsignalmonitor.cpp.

Referenced by UpdateValues().

Member Data Documentation

◆ m_usingv4l2

bool AnalogSignalMonitor::m_usingv4l2 {false}
private

Definition at line 25 of file analogsignalmonitor.h.

Referenced by AnalogSignalMonitor(), and UpdateValues().

◆ m_card

QString AnalogSignalMonitor::m_card
private

Definition at line 26 of file analogsignalmonitor.h.

Referenced by AnalogSignalMonitor().

◆ m_driver

QString AnalogSignalMonitor::m_driver
private

Definition at line 27 of file analogsignalmonitor.h.

Referenced by AnalogSignalMonitor(), and UpdateValues().

◆ m_version

uint32_t AnalogSignalMonitor::m_version {0}
private

Definition at line 28 of file analogsignalmonitor.h.

Referenced by AnalogSignalMonitor().

◆ m_width

uint AnalogSignalMonitor::m_width {0}
private

Definition at line 29 of file analogsignalmonitor.h.

Referenced by handleHDPVR().

◆ m_stable_time

int AnalogSignalMonitor::m_stable_time {2000}
private

Definition at line 30 of file analogsignalmonitor.h.

Referenced by handleHDPVR().

◆ m_lock_cnt

uint AnalogSignalMonitor::m_lock_cnt {0}
private

Definition at line 31 of file analogsignalmonitor.h.

Referenced by handleHDPVR().

◆ m_timer

MythTimer AnalogSignalMonitor::m_timer
private

Definition at line 32 of file analogsignalmonitor.h.

Referenced by handleHDPVR().

◆ m_log_idx

int AnalogSignalMonitor::m_log_idx {40}
private

Definition at line 33 of file analogsignalmonitor.h.

Referenced by handleHDPVR().


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