MythTV  master
dtvsignalmonitor.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #ifndef DTVSIGNALMONITOR_H
4 #define DTVSIGNALMONITOR_H
5 
6 #include <vector>
7 using namespace std;
8 
9 #include "signalmonitor.h"
10 #include "signalmonitorvalue.h"
11 #include "streamlisteners.h"
12 
13 class DTVChannel;
14 
16  public MPEGStreamListener,
18  public ATSCAuxStreamListener,
20 {
21  public:
22  DTVSignalMonitor(int db_cardnum,
23  DTVChannel *_channel,
24  bool _release_stream,
25  uint64_t wait_for_mask);
26  ~DTVSignalMonitor() override;
27 
28  public:
29  QStringList GetStatusList(void) const override; // SignalMonitor
30 
31  void SetChannel(int major, int minor);
32  int GetMajorChannel() const { return m_majorChannel; }
33  int GetMinorChannel() const { return m_minorChannel; }
34 
35  void SetProgramNumber(int progNum);
36  int GetProgramNumber() const { return m_programNumber; }
37 
38  void SetDVBService(uint network_id, uint transport_id, int service_id);
39  uint GetTransportID(void) const { return m_transportID; }
40  uint GetNetworkID(void) const { return m_networkID; }
41  int GetServiceID(void) const { return m_programNumber; }
42 
43  uint GetDetectedNetworkID(void) const { return m_detectedNetworkID; }
44  uint GetDetectedTransportID(void) const { return m_detectedTransportID; }
45 
47  virtual void SetRotorTarget(float /*target*/) {}
48  virtual void GetRotorStatus(bool &was_moving, bool &is_moving)
49  { was_moving = is_moving = false; }
50  virtual void SetRotorValue(int /*val*/) {}
51 
52  void AddFlags(uint64_t _flags) override; // SignalMonitor
53  void RemoveFlags(uint64_t _flags) override; // SignalMonitor
54 
57  virtual void SetStreamData(MPEGStreamData* data);
58 
60  MPEGStreamData *GetStreamData() { return m_streamData; }
62  ATSCStreamData *GetATSCStreamData();
64  DVBStreamData *GetDVBStreamData();
66  ScanStreamData *GetScanStreamData();
67 
69  const MPEGStreamData *GetStreamData() const { return m_streamData; }
71  const ATSCStreamData *GetATSCStreamData() const;
73  const DVBStreamData *GetDVBStreamData() const;
75  const ScanStreamData *GetScanStreamData() const;
76 
77  bool IsAllGood(void) const override; // SignalMonitor
78 
79  // MPEG
80  void HandlePAT(const ProgramAssociationTable *pat) override; // MPEGStreamListener
81  void HandleCAT(const ConditionalAccessTable */*cat*/) override {} // MPEGStreamListener
82  void HandlePMT(uint program_num, const ProgramMapTable *pmt) override; // MPEGStreamListener
83  void HandleEncryptionStatus(uint pnum, bool enc_status) override; // MPEGStreamListener
84 
85  // ATSC Main
86  void HandleSTT(const SystemTimeTable *stt) override; // ATSCMainStreamListener
87  void HandleVCT(uint /*tsid*/, const VirtualChannelTable */*vct*/) override {} // ATSCMainStreamListener
88  void HandleMGT(const MasterGuideTable *mgt) override; // ATSCMainStreamListener
89 
90  // ATSC Aux
91  void HandleTVCT(uint pid, const TerrestrialVirtualChannelTable *tvct) override; // ATSCAuxStreamListener
92  void HandleCVCT(uint pid, const CableVirtualChannelTable *cvct) override; // ATSCAuxStreamListener
93  void HandleRRT(const RatingRegionTable */*rrt*/) override {} // ATSCAuxStreamListener
94  void HandleDCCT(const DirectedChannelChangeTable */*dcct*/) override {} // ATSCAuxStreamListener
96  const DirectedChannelChangeSelectionCodeTable */*dccsct*/) override {} // ATSCAuxStreamListener
97 
98  // DVB Main
99  void HandleTDT(const TimeDateTable *tdt) override; // DVBMainStreamListener
100  void HandleNIT(const NetworkInformationTable *nit) override; // DVBMainStreamListener
101  void HandleSDT(uint tsid, const ServiceDescriptionTable *sdt) override; // DVBMainStreamListener
102 
103  void IgnoreEncrypted(bool ignore) { m_ignoreEncrypted = ignore; }
104 
105  protected:
106  DTVChannel *GetDTVChannel(void);
107  void UpdateMonitorValues(void);
108  void UpdateListeningForEIT(void);
109 
110  protected:
111  MPEGStreamData *m_streamData {nullptr};
112  vector<uint> m_eitPids;
127 
128  // ATSC tuning info
129  int m_majorChannel {-1};
130  int m_minorChannel {-1};
131  // DVB tuning info
132  uint m_networkID {0};
133  uint m_transportID {0};
134  // DVB scanning info
135  uint m_detectedNetworkID {0};
136  uint m_detectedTransportID {0};
137  // MPEG/DVB/ATSC tuning info
138  int m_programNumber {-1};
139  // table_id & CRC of tables already seen
140  QList<uint64_t> m_seenTableCrc;
141 
142  bool m_ignoreEncrypted {false};
143 };
144 
145 #endif // DTVSIGNALMONITOR_H
VirtualChannelTable
This table contains information about the channels transmitted on this multiplex.
Definition: atsctables.h:190
ATSCMainStreamListener
Definition: streamlisteners.h:113
DTVSignalMonitor::m_matchingMGT
SignalMonitorValue m_matchingMGT
Definition: dtvsignalmonitor.h:122
DirectedChannelChangeTable
No one has had time to decode this table yet...
Definition: atsctables.h:756
TimeDateTable
This table gives the current DVB stream time.
Definition: dvbtables.h:375
DTVSignalMonitor::GetMajorChannel
int GetMajorChannel() const
Definition: dtvsignalmonitor.h:32
RatingRegionTable
No one has had time to decode this table yet...
Definition: atsctables.h:740
DTVSignalMonitor::m_matchingPMT
SignalMonitorValue m_matchingPMT
Definition: dtvsignalmonitor.h:121
DTVSignalMonitor::m_seenVCT
SignalMonitorValue m_seenVCT
Definition: dtvsignalmonitor.h:116
ProgramMapTable
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:667
DTVSignalMonitor::m_seenMGT
SignalMonitorValue m_seenMGT
Definition: dtvsignalmonitor.h:115
DTVSignalMonitor::HandleCAT
void HandleCAT(const ConditionalAccessTable *) override
Definition: dtvsignalmonitor.h:81
signalmonitor.h
DTVSignalMonitor::GetStreamData
MPEGStreamData * GetStreamData()
Returns the MPEG stream data if it exists.
Definition: dtvsignalmonitor.h:60
signalmonitorvalue.h
DTVSignalMonitor::GetStreamData
const MPEGStreamData * GetStreamData() const
Returns the MPEG stream data if it exists.
Definition: dtvsignalmonitor.h:69
DTVSignalMonitor::m_matchingSDT
SignalMonitorValue m_matchingSDT
Definition: dtvsignalmonitor.h:125
streamlisteners.h
DirectedChannelChangeSelectionCodeTable
No one has had time to decode this table yet...
Definition: atsctables.h:773
ScanStreamData
Definition: scanstreamdata.h:14
DTVSignalMonitor::SetRotorValue
virtual void SetRotorValue(int)
Definition: dtvsignalmonitor.h:50
DTVSignalMonitor::HandleDCCT
void HandleDCCT(const DirectedChannelChangeTable *) override
Definition: dtvsignalmonitor.h:94
DTVSignalMonitor::m_seenSDT
SignalMonitorValue m_seenSDT
Definition: dtvsignalmonitor.h:118
minor
#define minor(X)
Definition: compat.h:138
DTVSignalMonitor::m_seenCrypt
SignalMonitorValue m_seenCrypt
Definition: dtvsignalmonitor.h:119
DTVSignalMonitor::m_seenTableCrc
QList< uint64_t > m_seenTableCrc
Definition: dtvsignalmonitor.h:140
MPEGStreamListener
Definition: streamlisteners.h:82
DTVSignalMonitor::m_seenPAT
SignalMonitorValue m_seenPAT
Definition: dtvsignalmonitor.h:113
ATSCStreamData
Encapsulates data about ATSC stream and emits events for most tables.
Definition: atscstreamdata.h:29
ATSCAuxStreamListener
Definition: streamlisteners.h:123
MPEGStreamData
Encapsulates data about MPEG stream and emits events for each table.
Definition: mpegstreamdata.h:86
ServiceDescriptionTable
This table tells the decoder on which PIDs to find A/V data.
Definition: dvbtables.h:102
DTVSignalMonitor::GetDetectedTransportID
uint GetDetectedTransportID(void) const
Definition: dtvsignalmonitor.h:44
DVBStreamData
Definition: dvbstreamdata.h:33
DTVSignalMonitor::m_matchingVCT
SignalMonitorValue m_matchingVCT
Definition: dtvsignalmonitor.h:123
SignalMonitorValue
Definition: signalmonitorvalue.h:15
DTVSignalMonitor::m_matchingCrypt
SignalMonitorValue m_matchingCrypt
Definition: dtvsignalmonitor.h:126
DTVSignalMonitor::HandleVCT
void HandleVCT(uint, const VirtualChannelTable *) override
Definition: dtvsignalmonitor.h:87
uint
unsigned int uint
Definition: compat.h:140
DTVSignalMonitor::GetNetworkID
uint GetNetworkID(void) const
Definition: dtvsignalmonitor.h:40
ProgramAssociationTable
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:590
DTVSignalMonitor::GetTransportID
uint GetTransportID(void) const
Definition: dtvsignalmonitor.h:39
DTVSignalMonitor::GetProgramNumber
int GetProgramNumber() const
Definition: dtvsignalmonitor.h:36
SignalMonitor
Signal monitoring base class.
Definition: signalmonitor.h:33
DTVSignalMonitor::GetRotorStatus
virtual void GetRotorStatus(bool &was_moving, bool &is_moving)
Definition: dtvsignalmonitor.h:48
MasterGuideTable
This table tells the decoder on which PIDs to find other tables, and their sizes and each table's cur...
Definition: atsctables.h:75
DVBMainStreamListener
Definition: streamlisteners.h:173
DTVSignalMonitor::IgnoreEncrypted
void IgnoreEncrypted(bool ignore)
Definition: dtvsignalmonitor.h:103
DTVSignalMonitor::m_matchingNIT
SignalMonitorValue m_matchingNIT
Definition: dtvsignalmonitor.h:124
DTVSignalMonitor::HandleDCCSCT
void HandleDCCSCT(const DirectedChannelChangeSelectionCodeTable *) override
Definition: dtvsignalmonitor.h:95
DTVSignalMonitor::m_eitPids
vector< uint > m_eitPids
Definition: dtvsignalmonitor.h:112
DTVSignalMonitor::HandleRRT
void HandleRRT(const RatingRegionTable *) override
Definition: dtvsignalmonitor.h:93
DTVSignalMonitor::GetMinorChannel
int GetMinorChannel() const
Definition: dtvsignalmonitor.h:33
TerrestrialVirtualChannelTable
This table contains information about the terrestrial channels transmitted on this multiplex.
Definition: atsctables.h:346
ConditionalAccessTable
The CAT is used to transmit additional ConditionalAccessDescriptor instances, in addition to the ones...
Definition: mpegtables.h:830
DTVSignalMonitor::SetRotorTarget
virtual void SetRotorTarget(float)
Sets rotor target pos from 0.0 to 1.0.
Definition: dtvsignalmonitor.h:47
DTVSignalMonitor
This class is intended to detect the presence of needed tables.
Definition: dtvsignalmonitor.h:20
CableVirtualChannelTable
This table contains information about the cable channels transmitted on this multiplex.
Definition: atsctables.h:415
DTVSignalMonitor::GetDetectedNetworkID
uint GetDetectedNetworkID(void) const
Definition: dtvsignalmonitor.h:43
SystemTimeTable
This table contains the GPS time at the time of transmission.
Definition: atsctables.h:679
DTVChannel
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:35
DTVSignalMonitor::m_matchingPAT
SignalMonitorValue m_matchingPAT
Definition: dtvsignalmonitor.h:120
DTVSignalMonitor::GetServiceID
int GetServiceID(void) const
Definition: dtvsignalmonitor.h:41
DTVSignalMonitor::m_seenNIT
SignalMonitorValue m_seenNIT
Definition: dtvsignalmonitor.h:117
DTVSignalMonitor::m_seenPMT
SignalMonitorValue m_seenPMT
Definition: dtvsignalmonitor.h:114
NetworkInformationTable
This table tells the decoder on which PIDs to find other tables.
Definition: dvbtables.h:22