MythTV  master
firewiresignalmonitor.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #ifndef _FIREWIRESIGNALMONITOR_H_
4 #define _FIREWIRESIGNALMONITOR_H_
5 
6 // C++ headers
7 #include <vector>
8 using namespace std;
9 
10 // Qt headers
11 #include <QMutex>
12 #include <QMap>
13 
14 // MythTV headers
15 #include "dtvsignalmonitor.h"
16 #include "firewiredevice.h"
17 #include "mthread.h"
18 
19 class FirewireChannel;
20 
22 
24 {
25  public:
27  MThread("FirewireTableMonitor"), m_parent(p) { start(); }
28  virtual ~FirewireTableMonitorThread() { wait(); m_parent = nullptr; }
29  void run(void) override; // MThread
30  private:
32 };
33 
35 {
37  public:
38  FirewireSignalMonitor(int db_cardnum, FirewireChannel *_channel,
39  bool _release_stream,
40  uint64_t _flags = kFWSigMon_WaitForPower);
41 
42  void HandlePAT(const ProgramAssociationTable*) override; // DTVSignalMonitor
43  void HandlePMT(uint, const ProgramMapTable*) override; // DTVSignalMonitor
44 
45  void Stop(void) override; // SignalMonitor
46 
47  protected:
50  virtual ~FirewireSignalMonitor();
51 
52  void UpdateValues(void) override; // SignalMonitor
53 
54  void RunTableMonitor(void);
55 
56  bool SupportsTSMonitoring(void);
57 
58  void AddData(const unsigned char *data, uint len) override; // TSDataListener
59 
60  public:
61  static const uint kPowerTimeout;
62  static const uint kBufferTimeout;
63 
64  protected:
65  volatile bool m_dtvMonitorRunning {false};
66  FirewireTableMonitorThread *m_tableMonitorThread {nullptr};
67  bool m_stb_needs_retune {true};
68  bool m_stb_needs_to_wait_for_pat {false};
69  bool m_stb_needs_to_wait_for_power {false};
72 
73  vector<unsigned char> m_buffer;
74 
75  static QMap<void*,uint> s_pat_keys;
76  static QMutex s_pat_keys_lock;
77 };
78 
79 #endif // _FIREWIRESIGNALMONITOR_H_
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:46
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:13
static const uint kPowerTimeout
static const uint kBufferTimeout
FirewireSignalMonitor * m_parent
FirewireChannel Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV un...
unsigned int uint
Definition: compat.h:140
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:579
static QMap< void *, uint > s_pat_keys
This class is intended to detect the presence of needed tables.
FirewireTableMonitorThread(FirewireSignalMonitor *p)
vector< unsigned char > m_buffer
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:656