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  ~FirewireTableMonitorThread() override { 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 *pat) override; // DTVSignalMonitor
43  void HandlePMT(uint pnum, const ProgramMapTable *pmt) override; // DTVSignalMonitor
44 
45  void Stop(void) override; // SignalMonitor
46 
47  protected:
50  ~FirewireSignalMonitor() override;
51 
52  void UpdateValues(void) override; // SignalMonitor
53 
54  void RunTableMonitor(void);
55 
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_stbNeedsRetune {true};
68  bool m_stbNeedsToWaitForPat {false};
69  bool m_stbNeedsToWaitForPower {false};
72 
73  vector<unsigned char> m_buffer;
74 
75  static QMap<void*,uint> s_patKeys;
76  static QMutex s_patKeysLock;
77 };
78 
79 #endif // FIREWIRESIGNALMONITOR_H
FirewireSignalMonitor::m_buffer
vector< unsigned char > m_buffer
Definition: firewiresignalmonitor.h:73
FirewireSignalMonitor::s_patKeysLock
static QMutex s_patKeysLock
Definition: firewiresignalmonitor.h:76
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:14
FirewireSignalMonitor
Definition: firewiresignalmonitor.h:35
FirewireSignalMonitor::kPowerTimeout
static const uint kPowerTimeout
Definition: firewiresignalmonitor.h:61
FirewireTableMonitorThread
Definition: firewiresignalmonitor.h:24
ProgramMapTable
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:667
firewiredevice.h
TSDataListener
Definition: streamlisteners.h:53
FirewireSignalMonitor::FirewireSignalMonitor
FirewireSignalMonitor(void)
FirewireSignalMonitor::FirewireSignalMonitor
FirewireSignalMonitor(const FirewireSignalMonitor &)
hardwareprofile.config.p
p
Definition: config.py:33
FirewireTableMonitorThread::~FirewireTableMonitorThread
~FirewireTableMonitorThread() override
Definition: firewiresignalmonitor.h:28
FirewireChannel
FirewireChannel Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV un...
Definition: firewirechannel.h:15
FirewireSignalMonitor::m_stbWaitForPatTimer
MythTimer m_stbWaitForPatTimer
Definition: firewiresignalmonitor.h:70
uint
unsigned int uint
Definition: compat.h:140
ProgramAssociationTable
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:590
FirewireSignalMonitor::kBufferTimeout
static const uint kBufferTimeout
Definition: firewiresignalmonitor.h:62
FirewireSignalMonitor::s_patKeys
static QMap< void *, uint > s_patKeys
Definition: firewiresignalmonitor.h:75
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
mthread.h
DTVSignalMonitor
This class is intended to detect the presence of needed tables.
Definition: dtvsignalmonitor.h:20
FirewireTableMonitorThread::m_parent
FirewireSignalMonitor * m_parent
Definition: firewiresignalmonitor.h:31
FirewireSignalMonitor::m_stbWaitForPowerTimer
MythTimer m_stbWaitForPowerTimer
Definition: firewiresignalmonitor.h:71
FirewireTableMonitorThread::FirewireTableMonitorThread
FirewireTableMonitorThread(FirewireSignalMonitor *p)
Definition: firewiresignalmonitor.h:26
dtvsignalmonitor.h
FirewireSignalMonitor::SupportsTSMonitoring
bool SupportsTSMonitoring(void)