MythTV  master
dvbcam.h
Go to the documentation of this file.
1 #ifndef DVBCAM_H
2 #define DVBCAM_H
3 
4 // Qt
5 #include <QWaitCondition>
6 #include <QRunnable>
7 #include <QString>
8 #include <QMap>
9 #include <QMutex>
10 
11 // MythTV
12 #include "mpegtables.h"
13 #include "dvbtypes.h"
14 
15 class ChannelBase;
16 class cCiHandler;
17 class MThread;
18 class DVBCam;
19 
20 using pmt_list_t = QMap<const ChannelBase*, ProgramMapTable*>;
21 
22 class DVBCam : public QRunnable
23 {
24  public:
25  explicit DVBCam(QString device);
26  ~DVBCam() override;
27 
28  bool Start(void);
29  bool Stop(void);
30  bool IsRunning(void) const
31  {
32  QMutexLocker locker(&m_ciHandlerLock);
33  return m_ciHandlerRunning;
34  }
35 
36  void SetPMT(const ChannelBase *chan, const ProgramMapTable *pmt);
37  void SetTimeOffset(double offset_in_seconds);
38 
39  private:
40  void run(void) override; // QRunnable
41  void HandleUserIO(void);
42  void HandlePMT(void);
43  void RemoveDuplicateServices(void);
44  void SendPMT(const ProgramMapTable &pmt, uint cplm);
45 
46  QString m_device;
47  int m_numslots {0};
48 
49  mutable QMutex m_ciHandlerLock;
50  QWaitCondition m_ciHandlerWait;
51  bool m_ciHandlerDoRun {false};
52  bool m_ciHandlerRunning {false};
53  cCiHandler *m_ciHandler {nullptr};
55 
56  QMutex m_pmtLock;
59  bool m_havePmt {false};
60  bool m_pmtSent {false};
61  bool m_pmtUpdated {false};
62  bool m_pmtAdded {false};
63 };
64 
65 #endif // DVBCAM_H
66 
DVBCam::m_numslots
int m_numslots
Definition: dvbcam.h:47
ProgramMapTable
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:692
DVBCam::Stop
bool Stop(void)
Definition: dvbcam.cpp:119
DVBCam::m_pmtList
pmt_list_t m_pmtList
Definition: dvbcam.h:57
DVBCam::HandleUserIO
void HandleUserIO(void)
Definition: dvbcam.cpp:154
DVBCam::m_pmtUpdated
bool m_pmtUpdated
Definition: dvbcam.h:61
DVBCam::IsRunning
bool IsRunning(void) const
Definition: dvbcam.h:30
DVBCam::SetTimeOffset
void SetTimeOffset(double offset_in_seconds)
Definition: dvbcam.cpp:374
DVBCam
Definition: dvbcam.h:22
DVBCam::~DVBCam
~DVBCam() override
Definition: dvbcam.cpp:82
DVBCam::m_pmtAddList
pmt_list_t m_pmtAddList
Definition: dvbcam.h:58
dvbtypes.h
ChannelBase
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:31
DVBCam::run
void run(void) override
Definition: dvbcam.cpp:312
DVBCam::Start
bool Start(void)
Definition: dvbcam.cpp:87
DVBCam::m_havePmt
bool m_havePmt
Definition: dvbcam.h:59
DVBCam::m_ciHandlerLock
QMutex m_ciHandlerLock
Definition: dvbcam.h:49
DVBCam::m_ciHandlerWait
QWaitCondition m_ciHandlerWait
Definition: dvbcam.h:50
mpegtables.h
DVBCam::m_pmtSent
bool m_pmtSent
Definition: dvbcam.h:60
uint
unsigned int uint
Definition: compat.h:140
DVBCam::m_device
QString m_device
Definition: dvbcam.h:46
DVBCam::RemoveDuplicateServices
void RemoveDuplicateServices(void)
Definition: dvbcam.cpp:207
DVBCam::m_ciHandlerDoRun
bool m_ciHandlerDoRun
Definition: dvbcam.h:51
DVBCam::SendPMT
void SendPMT(const ProgramMapTable &pmt, uint cplm)
Definition: dvbcam.cpp:396
DVBCam::m_ciHandlerThread
MThread * m_ciHandlerThread
Definition: dvbcam.h:54
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
DVBCam::SetPMT
void SetPMT(const ChannelBase *chan, const ProgramMapTable *pmt)
Definition: dvbcam.cpp:341
pmt_list_t
QMap< const ChannelBase *, ProgramMapTable * > pmt_list_t
Definition: dvbcam.h:20
DVBCam::HandlePMT
void HandlePMT(void)
Definition: dvbcam.cpp:258
DVBCam::DVBCam
DVBCam(QString device)
Definition: dvbcam.cpp:63
DVBCam::m_pmtAdded
bool m_pmtAdded
Definition: dvbcam.h:62
cCiHandler
Definition: dvbci.h:146
DVBCam::m_ciHandlerRunning
bool m_ciHandlerRunning
Definition: dvbcam.h:52
DVBCam::m_pmtLock
QMutex m_pmtLock
Definition: dvbcam.h:56
DVBCam::m_ciHandler
cCiHandler * m_ciHandler
Definition: dvbcam.h:53