MythTV  master
hlsstreamhandler.h
Go to the documentation of this file.
1 
8 #ifndef _HLSSTREAMHANDLER_H_
9 #define _HLSSTREAMHANDLER_H_
10 
11 #include <vector>
12 using namespace std;
13 
14 #include <QString>
15 #include <QMutex>
16 #include <QMap>
17 
18 #include "channelutil.h"
19 #include "iptvstreamhandler.h"
20 
21 class MPEGStreamData;
22 class HLSReader;
23 
25 {
26  public:
27  static HLSStreamHandler* Get(const IPTVTuningData& tuning, int inputid);
28  static void Return(HLSStreamHandler* & ref, int inputid);
29 
30  protected:
31  explicit HLSStreamHandler(const IPTVTuningData &tuning, int inputid);
32  virtual ~HLSStreamHandler(void);
33 
34  void run(void) override; // MThread
35 
36  private:
37  HLSStreamHandler(const HLSStreamHandler &) = delete; // not copyable
38  HLSStreamHandler &operator=(const HLSStreamHandler &) = delete; // not copyable
39 
40  protected:
41  HLSReader* m_hls {nullptr};
42  uint8_t* m_readbuffer {nullptr};
43  bool m_throttle {true};
44 
45  // for implementing Get & Return
46  static QMutex s_hlshandlers_lock;
47  static QMap<QString, HLSStreamHandler*> s_hlshandlers;
48  static QMap<QString, uint> s_hlshandlers_refcnt;
49 };
50 
51 #endif // _HLSSTREAMHANDLER_H_
static QMap< QString, uint > s_hlshandlers_refcnt
static int run(MythMediaDevice *dev=nullptr, bool startRandomShow=false)
static QMutex s_hlshandlers_lock
static QMap< QString, HLSStreamHandler * > s_hlshandlers
Encapsulates data about MPEG stream and emits events for each table.