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