MythTV  master
HLSStreamWorker.h
Go to the documentation of this file.
1 #ifndef _HLS_Segment_Worker_h_
2 #define _HLS_Segment_Worker_h_
3 
4 #include <QMap>
5 #include <QWaitCondition>
6 #include <QMutex>
7 
8 #include "mthread.h"
9 
10 class HLSReader;
11 
12 class HLSStreamWorker : public MThread
13 {
14  public:
15  explicit HLSStreamWorker(HLSReader* parent);
16  ~HLSStreamWorker(void);
17 
18  void Cancel(void);
19  void CancelCurrentDownload(void);
20  void Wakeup(void) { QMutexLocker lock(&m_lock); m_waitcond.wakeAll(); }
21 
22  protected:
23  void run() override; // MThread
24 
25  private:
26  void Segment(void);
27 
28  // Class vars
29  HLSReader *m_parent {nullptr};
31  bool m_cancel {false};
32  bool m_wokenup {false};
33  mutable QMutex m_lock;
35  QWaitCondition m_waitcond;
36 };
37 
38 #endif
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:46
QMutex m_downloader_lock
MythSingleDownload * m_downloader
void Segment(void)
HLSStreamWorker(HLSReader *parent)
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
void Wakeup(void)
HLSReader * m_parent
void CancelCurrentDownload(void)
QWaitCondition m_waitcond