00001 #ifndef DVBCAM_H 00002 #define DVBCAM_H 00003 00004 #include <deque> 00005 using namespace std; 00006 00007 #include <QWaitCondition> 00008 #include <QRunnable> 00009 #include <QString> 00010 #include <QMutex> 00011 00012 #include "mpegtables.h" 00013 00014 #include "dvbtypes.h" 00015 00016 class ChannelBase; 00017 class cCiHandler; 00018 class MThread; 00019 class DVBCam; 00020 00021 typedef QMap<const ChannelBase*, ProgramMapTable*> pmt_list_t; 00022 00023 class DVBCam : public QRunnable 00024 { 00025 public: 00026 DVBCam(const QString &device); 00027 ~DVBCam(); 00028 00029 bool Start(void); 00030 bool Stop(void); 00031 bool IsRunning(void) const 00032 { 00033 QMutexLocker locker(&ciHandlerLock); 00034 return ciHandlerRunning; 00035 } 00036 00037 void SetPMT(const ChannelBase *chan, const ProgramMapTable *pmt); 00038 void SetTimeOffset(double offset_in_seconds); 00039 00040 private: 00041 void run(void); // QRunnable 00042 void HandleUserIO(void); 00043 void HandlePMT(void); 00044 00045 void SendPMT(const ProgramMapTable &pmt, uint cplm); 00046 00047 QString device; 00048 int numslots; 00049 00050 mutable QMutex ciHandlerLock; 00051 QWaitCondition ciHandlerWait; 00052 bool ciHandlerDoRun; 00053 bool ciHandlerRunning; 00054 cCiHandler *ciHandler; 00055 MThread *ciHandlerThread; 00056 00057 QMutex pmt_lock; 00058 pmt_list_t PMTList; 00059 pmt_list_t PMTAddList; 00060 bool have_pmt; 00061 bool pmt_sent; 00062 bool pmt_updated; 00063 bool pmt_added; 00064 }; 00065 00066 #endif // DVBCAM_H 00067
1.6.3