Go to the documentation of this file.
7 #define LOC QString("%1 playlist: ").arg(m_parent->StreamURL().isEmpty() ? "Worker" : m_parent->StreamURL())
10 :
MThread(
"HLSPlaylist"), m_parent(parent)
12 LOG(VB_RECORD, LOG_DEBUG,
LOC +
"ctor");
17 LOG(VB_RECORD, LOG_DEBUG,
LOC +
"dtor");
22 LOG(VB_RECORD, LOG_INFO,
LOC +
"Cancel -- begin");
28 LOG(VB_RECORD, LOG_INFO,
LOC +
"Cancel -- end");
33 std::chrono::milliseconds wakeup = 1s;
36 LOG(VB_RECORD, LOG_INFO,
LOC +
"run -- begin");
47 std::chrono::milliseconds waittime = std::max(1000ms, wakeup);
48 LOG(VB_RECORD, (waittime > 12s ? LOG_INFO : LOG_DEBUG),
LOC +
49 QString(
"refreshing in %2ms")
50 .arg(waittime.count()));
59 LOG(VB_GENERAL, LOG_CRIT,
LOC +
"Fatal error detected");
64 LOG(VB_RECORD, LOG_INFO,
LOC +
"canceled");
72 LOG(VB_RECORD, LOG_INFO,
LOC +
73 QString(
"Playlist successfully downloaded. Buffered: %1%")
82 LOG(VB_RECORD, LOG_WARNING,
LOC +
83 QString(
"Playlist download failed -- Retry #%1, "
102 LOG(VB_RECORD, LOG_ERR,
LOC +
"Loading playlist failed. "
103 "Perform a complete reset.");
133 downloader->Cancel();
139 LOG(VB_RECORD, LOG_INFO,
LOC +
"run -- end");
bool FatalError(void) const
std::chrono::seconds TargetDuration(void) const
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
int PlaylistRetryCount(void) const
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
QWaitCondition m_waitcond
bool LoadMetaPlaylists(MythSingleDownload &downloader)
void EnableDebugging(void)
uint PercentBuffered(void) const
~HLSPlaylistWorker(void) override
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
const int PLAYLIST_FAILURE
void AllowPlaylistSwitch(void)
void PlaylistRetrying(void)
This is a wrapper around QThread that does several additional things.
HLSPlaylistWorker(HLSReader *parent)
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.