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 
13 #include <QString>
14 #include <QMutex>
15 #include <QMap>
16 
17 #include "channelutil.h"
18 #include "iptvstreamhandler.h"
19 
20 class MPEGStreamData;
21 class HLSReader;
22 
24 {
25  public:
26  static HLSStreamHandler* Get(const IPTVTuningData& tuning, int inputid);
27  static void Return(HLSStreamHandler* & ref, int inputid);
28 
29  // Deleted functions should be public.
30  HLSStreamHandler(const HLSStreamHandler &) = delete; // not copyable
31  HLSStreamHandler &operator=(const HLSStreamHandler &) = delete; // not copyable
32 
33  protected:
34  explicit HLSStreamHandler(const IPTVTuningData &tuning, int inputid);
35  ~HLSStreamHandler(void) override;
36 
37  void run(void) override; // MThread
38 
39  protected:
40  HLSReader* m_hls {nullptr};
41  uint8_t* m_readbuffer {nullptr};
42  bool m_throttle {true};
43 
44  // for implementing Get & Return
45  static QMutex s_hlshandlers_lock;
46  static QMap<QString, HLSStreamHandler*> s_hlshandlers;
47  static QMap<QString, uint> s_hlshandlers_refcnt;
48 };
49 
50 #endif // HLSSTREAMHANDLER_H
HLSStreamHandler::HLSStreamHandler
HLSStreamHandler(const HLSStreamHandler &)=delete
HLSStreamHandler
Definition: hlsstreamhandler.h:23
HLSStreamHandler::m_throttle
bool m_throttle
Definition: hlsstreamhandler.h:42
HLSStreamHandler::m_hls
HLSReader * m_hls
Definition: hlsstreamhandler.h:40
MPEGStreamData
Encapsulates data about MPEG stream and emits events for each table.
Definition: mpegstreamdata.h:85
HLSStreamHandler::s_hlshandlers
static QMap< QString, HLSStreamHandler * > s_hlshandlers
Definition: hlsstreamhandler.h:46
IPTVTuningData
Definition: iptvtuningdata.h:21
HLSStreamHandler::s_hlshandlers_refcnt
static QMap< QString, uint > s_hlshandlers_refcnt
Definition: hlsstreamhandler.h:47
HLSStreamHandler::Get
static HLSStreamHandler * Get(const IPTVTuningData &tuning, int inputid)
Definition: hlsstreamhandler.cpp:26
channelutil.h
HLSReader
Definition: HLSReader.h:34
HLSStreamHandler::m_readbuffer
uint8_t * m_readbuffer
Definition: hlsstreamhandler.h:41
HLSStreamHandler::~HLSStreamHandler
~HLSStreamHandler(void) override
Definition: hlsstreamhandler.cpp:108
HLSStreamHandler::Return
static void Return(HLSStreamHandler *&ref, int inputid)
Definition: hlsstreamhandler.cpp:58
HLSStreamHandler::s_hlshandlers_lock
static QMutex s_hlshandlers_lock
Definition: hlsstreamhandler.h:45
HLSStreamHandler::run
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: hlsstreamhandler.cpp:116
IPTVStreamHandler
Definition: iptvstreamhandler.h:79
HLSStreamHandler::operator=
HLSStreamHandler & operator=(const HLSStreamHandler &)=delete
iptvstreamhandler.h