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
20class MPEGStreamData;
21class 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
static QMap< QString, uint > s_hlshandlers_refcnt
static QMutex s_hlshandlers_lock
static QMap< QString, HLSStreamHandler * > s_hlshandlers
HLSStreamHandler(const HLSStreamHandler &)=delete
static HLSStreamHandler * Get(const IPTVTuningData &tuning, int inputid)
~HLSStreamHandler(void) override
uint8_t * m_readbuffer
HLSStreamHandler & operator=(const HLSStreamHandler &)=delete
static void Return(HLSStreamHandler *&ref, int inputid)
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Encapsulates data about MPEG stream and emits events for each table.