11#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
15#include <QWaitCondition>
28#ifdef HLS_USE_MYTHDOWNLOADMANAGER
54 bool Open(
const QString & m3u,
int bitrate_index = 0);
55 void Close(
bool quiet =
false);
56 qint64 Read(uint8_t* buffer, qint64 len);
57 void Throttle(
bool val);
59 bool IsOpen(
const QString& url)
const
60 {
return m_curstream && m_m3u8 == url; }
65 { QMutexLocker lock(&m_streamLock); m_curstream =
nullptr; }
69 {
return QString(
"%1").arg(m_curstream ? m_curstream->M3U8Url() :
""); }
71#ifdef HLS_USE_MYTHDOWNLOADMANAGER
72 static bool DownloadURL(
const QString &url, QByteArray *buffer);
77 static bool IsValidPlaylist(QTextStream & text);
80 void Cancel(
bool quiet =
false);
82 uint PercentBuffered(
void)
const;
84 {
return (m_curstream ? m_curstream->TargetDuration() : 0s); }
88 void PlaylistGood(
void);
89 void PlaylistRetrying(
void);
90 int PlaylistRetryCount(
void)
const;
93 bool ParseM3U8(
const QByteArray & buffer,
HLSRecStream* stream =
nullptr);
94 void DecreaseBitrate(
int progid);
95 void IncreaseBitrate(
int progid);
102 void EnableDebugging(
void);
110 int64_t m_curSeq {-1};
111 int m_bitrateIndex {0};
113 bool m_fatal {
false};
115 bool m_throttle {
true};
117 bool m_aesMsg {
false};
122 int m_playlistSize {0};
123 bool m_bandwidthCheck {
false};
135 bool m_debug {
false};
void AllowPlaylistSwitch(void)
QWaitCondition m_throttleCond
StreamContainer m_streams
bool IsThrottled(void) const
QVector< HLSRecSegment > SegmentContainer
static void CancelURL(const QStringList &urls)
bool IsOpen(const QString &url) const
static void CancelURL(const QString &url)
SegmentContainer m_segments
std::chrono::seconds TargetDuration(void) const
QString StreamURL(void) const
QMap< QString, HLSRecStream * > StreamContainer
bool FatalError(void) const