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  virtual ~DTVSignalMonitor();
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) {}
48  virtual void GetRotorStatus(bool &was_moving, bool &is_moving)
49  { was_moving = is_moving = false; }
50  virtual void SetRotorValue(int) {}
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_stream_data; }
62  ATSCStreamData *GetATSCStreamData();
64  DVBStreamData *GetDVBStreamData();
66  ScanStreamData *GetScanStreamData();
67 
69  const MPEGStreamData *GetStreamData() const { return m_stream_data; }
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*) override; // MPEGStreamListener
81  void HandleCAT(const ConditionalAccessTable*) override {} // MPEGStreamListener
82  void HandlePMT(uint, const ProgramMapTable*) override; // MPEGStreamListener
83  void HandleEncryptionStatus(uint, bool enc_status) override; // MPEGStreamListener
84 
85  // ATSC Main
86  void HandleSTT(const SystemTimeTable*) override; // ATSCMainStreamListener
87  void HandleVCT(uint /*tsid*/, const VirtualChannelTable*) override {} // ATSCMainStreamListener
88  void HandleMGT(const MasterGuideTable*) override; // ATSCMainStreamListener
89 
90  // ATSC Aux
91  void HandleTVCT(uint, const TerrestrialVirtualChannelTable*) override; // ATSCAuxStreamListener
92  void HandleCVCT(uint, const CableVirtualChannelTable*) override; // ATSCAuxStreamListener
93  void HandleRRT(const RatingRegionTable*) override {} // ATSCAuxStreamListener
94  void HandleDCCT(const DirectedChannelChangeTable*) override {} // ATSCAuxStreamListener
96  const DirectedChannelChangeSelectionCodeTable*) override {} // ATSCAuxStreamListener
97 
98  // DVB Main
99  void HandleTDT(const TimeDateTable*) override; // DVBMainStreamListener
100  void HandleNIT(const NetworkInformationTable*) override; // DVBMainStreamListener
101  void HandleSDT(uint, const ServiceDescriptionTable*) override; // DVBMainStreamListener
102 
103  void IgnoreEncrypted(bool ignore) { m_ignore_encrypted = ignore; }
104 
105  protected:
106  DTVChannel *GetDTVChannel(void);
107  void UpdateMonitorValues(void);
108  void UpdateListeningForEIT(void);
109 
110  protected:
111  MPEGStreamData *m_stream_data {nullptr};
112  vector<uint> m_eit_pids;
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_seen_table_crc;
141 
142  bool m_ignore_encrypted {false};
143 };
144 
145 #endif // DTVSIGNALMONITOR_H
No one has had time to decode this table yet...
Definition: atsctables.h:781
uint GetTransportID(void) const
virtual void SetRotorTarget(float)
Sets rotor target pos from 0.0 to 1.0.
uint GetDetectedTransportID(void) const
virtual void SetRotorValue(int)
This table tells the decoder on which PIDs to find A/V data.
Definition: dvbtables.h:101
SignalMonitorValue m_seenSDT
int GetServiceID(void) const
This table gives the current DVB stream time.
Definition: dvbtables.h:373
unsigned int uint
Definition: compat.h:140
uint GetDetectedNetworkID(void) const
SignalMonitorValue m_seenPAT
SignalMonitorValue m_matchingCrypt
QList< uint64_t > m_seen_table_crc
void HandleDCCSCT(const DirectedChannelChangeSelectionCodeTable *) override
virtual void GetRotorStatus(bool &was_moving, bool &is_moving)
SignalMonitorValue m_matchingNIT
int GetMinorChannel() const
void HandleVCT(uint, const VirtualChannelTable *) override
SignalMonitorValue m_matchingMGT
void HandleRRT(const RatingRegionTable *) override
vector< uint > m_eit_pids
This table contains information about the cable channels transmitted on this multiplex.
Definition: atsctables.h:415
Class providing a generic interface to digital tuning hardware.
Definition: dtvchannel.h:34
No one has had time to decode this table yet...
Definition: atsctables.h:748
SignalMonitorValue m_matchingPAT
The CAT is used to transmit additional ConditionalAccessDescriptor instances, in addition to the ones...
Definition: mpegtables.h:818
No one has had time to decode this table yet...
Definition: atsctables.h:764
#define minor(X)
Definition: compat.h:138
MPEGStreamData * GetStreamData()
Returns the MPEG stream data if it exists.
SignalMonitorValue m_seenMGT
SignalMonitorValue m_matchingSDT
void HandleDCCT(const DirectedChannelChangeTable *) override
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:579
SignalMonitorValue m_seenVCT
SignalMonitorValue m_seenNIT
const MPEGStreamData * GetStreamData() const
Returns the MPEG stream data if it exists.
This class is intended to detect the presence of needed tables.
Signal monitoring base class.
Definition: signalmonitor.h:32
int GetMajorChannel() const
SignalMonitorValue m_seenPMT
This table tells the decoder on which PIDs to find other tables, and their sizes and each table's cur...
Definition: atsctables.h:74
SignalMonitorValue m_seenCrypt
SignalMonitorValue m_matchingVCT
This table contains information about the channels transmitted on this multiplex.
Definition: atsctables.h:189
SignalMonitorValue m_matchingPMT
uint GetNetworkID(void) const
This table tells the decoder on which PIDs to find other tables.
Definition: dvbtables.h:21
This table contains the GPS time at the time of transmission.
Definition: atsctables.h:683
This table contains information about the terrestrial channels transmitted on this multiplex.
Definition: atsctables.h:346
Encapsulates data about ATSC stream and emits events for most tables.
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:656
void IgnoreEncrypted(bool ignore)
int GetProgramNumber() const
void HandleCAT(const ConditionalAccessTable *) override
Encapsulates data about MPEG stream and emits events for each table.