MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
HLSReader Class Reference

#include <HLSReader.h>

Collaboration diagram for HLSReader:
Collaboration graph
[legend]

Public Types

typedef QMap< QString, HLSRecStream * > StreamContainer
 
typedef QList< HLSRecSegmentSegmentContainer
 

Public Member Functions

 HLSReader (void)=default
 
 ~HLSReader (void)
 
bool Open (const QString &m3u, int bitrate_index=0)
 
void Close (bool quiet=false)
 
int Read (uint8_t *buffer, int len)
 
void Throttle (bool val)
 
bool IsThrottled (void) const
 
bool IsOpen (const QString &url) const
 
bool FatalError (void) const
 
bool LoadMetaPlaylists (MythSingleDownload &downloader)
 
void ResetStream (void)
 
void ResetSequence (void)
 
QString StreamURL (void) const
 

Static Public Member Functions

static void CancelURL (const QString &url)
 
static void CancelURL (const QStringList &urls)
 
static bool IsValidPlaylist (QTextStream &text)
 

Protected Member Functions

void Cancel (bool quiet=false)
 
bool LoadSegments (MythSingleDownload &downloader)
 
uint PercentBuffered (void) const
 
int TargetDuration (void) const
 
void AllowPlaylistSwitch (void)
 
void PlaylistGood (void)
 
void PlaylistRetrying (void)
 
int PlaylistRetryCount (void) const
 

Private Member Functions

bool ParseM3U8 (const QByteArray &buffer, HLSRecStream *stream=nullptr)
 
void DecreaseBitrate (int progid)
 
void IncreaseBitrate (int progid)
 
bool LoadSegments (HLSRecStream &hlsstream)
 
int DownloadSegmentData (MythSingleDownload &downloader, HLSRecStream *hls, HLSRecSegment &segment, int playlist_size)
 
void EnableDebugging (void)
 

Private Attributes

QString m_m3u8
 
StreamContainer m_streams
 
SegmentContainer m_segments
 
HLSRecStreamm_curstream {nullptr}
 
int64_t m_cur_seq {-1}
 
int m_bitrate_index {0}
 
bool m_fatal {false}
 
bool m_cancel {false}
 
bool m_throttle {true}
 
bool m_aesmsg {false}
 
HLSPlaylistWorkerm_playlistworker {nullptr}
 
HLSStreamWorkerm_streamworker {nullptr}
 
int m_playlist_size {0}
 
bool m_bandwidthcheck {false}
 
uint m_prebuffer_cnt {10}
 
QMutex m_seq_lock
 
QMutex m_stream_lock
 
QMutex m_throttle_lock
 
QWaitCondition m_throttle_cond
 
bool m_debug {false}
 
int m_debug_cnt {0}
 
int m_slow_cnt {0}
 
QByteArray m_buffer
 
QMutex m_buflock
 

Friends

class HLSStreamWorker
 
class HLSPlaylistWorker
 

Detailed Description

Definition at line 34 of file HLSReader.h.

Member Typedef Documentation

◆ StreamContainer

typedef QMap<QString, HLSRecStream* > HLSReader::StreamContainer

Definition at line 40 of file HLSReader.h.

◆ SegmentContainer

Definition at line 41 of file HLSReader.h.

Constructor & Destructor Documentation

◆ HLSReader()

HLSReader::HLSReader ( void  )
default

◆ ~HLSReader()

HLSReader::~HLSReader ( void  )

Definition at line 29 of file HLSReader.cpp.

Member Function Documentation

◆ Open()

bool HLSReader::Open ( const QString &  m3u,
int  bitrate_index = 0 
)

Definition at line 36 of file HLSReader.cpp.

Referenced by HLSStreamHandler::run().

◆ Close()

void HLSReader::Close ( bool  quiet = false)

Definition at line 134 of file HLSReader.cpp.

Referenced by Open(), and ~HLSReader().

◆ Read()

int HLSReader::Read ( uint8_t *  buffer,
int  len 
)

Definition at line 197 of file HLSReader.cpp.

Referenced by HLSStreamHandler::run().

◆ Throttle()

void HLSReader::Throttle ( bool  val)

Definition at line 183 of file HLSReader.cpp.

Referenced by HLSStreamHandler::run().

◆ IsThrottled()

bool HLSReader::IsThrottled ( void  ) const
inline

Definition at line 50 of file HLSReader.h.

Referenced by HLSStreamHandler::run().

◆ IsOpen()

bool HLSReader::IsOpen ( const QString &  url) const
inline

Definition at line 51 of file HLSReader.h.

Referenced by Open(), and HLSStreamHandler::run().

◆ FatalError()

bool HLSReader::FatalError ( void  ) const
inline

Definition at line 53 of file HLSReader.h.

Referenced by HLSPlaylistWorker::run(), HLSStreamWorker::run(), and HLSStreamHandler::run().

◆ LoadMetaPlaylists()

bool HLSReader::LoadMetaPlaylists ( MythSingleDownload downloader)

Definition at line 620 of file HLSReader.cpp.

Referenced by HLSPlaylistWorker::run().

◆ ResetStream()

void HLSReader::ResetStream ( void  )
inline

Definition at line 56 of file HLSReader.h.

Referenced by HLSPlaylistWorker::run().

◆ ResetSequence()

void HLSReader::ResetSequence ( void  )
inline

Definition at line 58 of file HLSReader.h.

Referenced by ParseM3U8(), and HLSStreamWorker::run().

◆ StreamURL()

QString HLSReader::StreamURL ( void  ) const
inline

Definition at line 60 of file HLSReader.h.

Referenced by ParseM3U8().

◆ CancelURL() [1/2]

static void HLSReader::CancelURL ( const QString &  url)
static

Referenced by Cancel().

◆ CancelURL() [2/2]

static void HLSReader::CancelURL ( const QStringList &  urls)
static

◆ IsValidPlaylist()

bool HLSReader::IsValidPlaylist ( QTextStream &  text)
static

Definition at line 248 of file HLSReader.cpp.

Referenced by IPTVTuningData::IsHLSPlaylist(), and Open().

◆ Cancel()

void HLSReader::Cancel ( bool  quiet = false)
protected

Definition at line 156 of file HLSReader.cpp.

Referenced by Close().

◆ LoadSegments() [1/2]

bool HLSReader::LoadSegments ( MythSingleDownload downloader)
protected

Definition at line 759 of file HLSReader.cpp.

Referenced by HLSStreamWorker::run().

◆ PercentBuffered()

uint HLSReader::PercentBuffered ( void  ) const
protected

Definition at line 861 of file HLSReader.cpp.

Referenced by LoadMetaPlaylists(), and HLSPlaylistWorker::run().

◆ TargetDuration()

int HLSReader::TargetDuration ( void  ) const
inlineprotected

Definition at line 75 of file HLSReader.h.

Referenced by HLSPlaylistWorker::run().

◆ AllowPlaylistSwitch()

void HLSReader::AllowPlaylistSwitch ( void  )
inlineprotected

Definition at line 78 of file HLSReader.h.

Referenced by HLSPlaylistWorker::run().

◆ PlaylistGood()

void HLSReader::PlaylistGood ( void  )
protected

Definition at line 998 of file HLSReader.cpp.

Referenced by HLSPlaylistWorker::run().

◆ PlaylistRetrying()

void HLSReader::PlaylistRetrying ( void  )
protected

Definition at line 1005 of file HLSReader.cpp.

Referenced by HLSPlaylistWorker::run().

◆ PlaylistRetryCount()

int HLSReader::PlaylistRetryCount ( void  ) const
protected

Definition at line 1012 of file HLSReader.cpp.

Referenced by HLSPlaylistWorker::run().

◆ ParseM3U8()

bool HLSReader::ParseM3U8 ( const QByteArray &  buffer,
HLSRecStream stream = nullptr 
)
private

Definition at line 281 of file HLSReader.cpp.

Referenced by LoadMetaPlaylists(), and Open().

◆ DecreaseBitrate()

void HLSReader::DecreaseBitrate ( int  progid)
private

Definition at line 687 of file HLSReader.cpp.

Referenced by LoadMetaPlaylists().

◆ IncreaseBitrate()

void HLSReader::IncreaseBitrate ( int  progid)
private

Definition at line 723 of file HLSReader.cpp.

Referenced by LoadMetaPlaylists().

◆ LoadSegments() [2/2]

bool HLSReader::LoadSegments ( HLSRecStream hlsstream)
private

◆ DownloadSegmentData()

int HLSReader::DownloadSegmentData ( MythSingleDownload downloader,
HLSRecStream hls,
HLSRecSegment segment,
int  playlist_size 
)
private

Definition at line 869 of file HLSReader.cpp.

Referenced by LoadSegments().

◆ EnableDebugging()

void HLSReader::EnableDebugging ( void  )
private

Friends And Related Function Documentation

◆ HLSStreamWorker

friend class HLSStreamWorker
friend

Definition at line 36 of file HLSReader.h.

Referenced by Open().

◆ HLSPlaylistWorker

friend class HLSPlaylistWorker
friend

Definition at line 37 of file HLSReader.h.

Referenced by Open().

Member Data Documentation

◆ m_m3u8

QString HLSReader::m_m3u8
private

Definition at line 98 of file HLSReader.h.

Referenced by Open(), and ParseM3U8().

◆ m_streams

StreamContainer HLSReader::m_streams
private

Definition at line 99 of file HLSReader.h.

Referenced by Close(), DecreaseBitrate(), IncreaseBitrate(), Open(), and ParseM3U8().

◆ m_segments

SegmentContainer HLSReader::m_segments
private

Definition at line 100 of file HLSReader.h.

Referenced by Cancel(), LoadMetaPlaylists(), LoadSegments(), ParseM3U8(), and PercentBuffered().

◆ m_curstream

HLSRecStream* HLSReader::m_curstream {nullptr}
private

◆ m_cur_seq

int64_t HLSReader::m_cur_seq {-1}
private

Definition at line 102 of file HLSReader.h.

Referenced by LoadSegments(), and ParseM3U8().

◆ m_bitrate_index

int HLSReader::m_bitrate_index {0}
private

Definition at line 103 of file HLSReader.h.

Referenced by LoadSegments(), Open(), and ParseM3U8().

◆ m_fatal

bool HLSReader::m_fatal {false}
private

Definition at line 105 of file HLSReader.h.

Referenced by DownloadSegmentData(), and Open().

◆ m_cancel

bool HLSReader::m_cancel {false}
private

Definition at line 106 of file HLSReader.h.

Referenced by Cancel(), LoadMetaPlaylists(), LoadSegments(), Open(), ParseM3U8(), and Read().

◆ m_throttle

bool HLSReader::m_throttle {true}
private

Definition at line 107 of file HLSReader.h.

Referenced by LoadSegments(), and Throttle().

◆ m_aesmsg

bool HLSReader::m_aesmsg {false}
private

Definition at line 109 of file HLSReader.h.

Referenced by ParseM3U8().

◆ m_playlistworker

HLSPlaylistWorker* HLSReader::m_playlistworker {nullptr}
private

Definition at line 111 of file HLSReader.h.

Referenced by Cancel(), Close(), and Open().

◆ m_streamworker

HLSStreamWorker* HLSReader::m_streamworker {nullptr}
private

Definition at line 112 of file HLSReader.h.

Referenced by Cancel(), Close(), LoadMetaPlaylists(), Open(), and ParseM3U8().

◆ m_playlist_size

int HLSReader::m_playlist_size {0}
private

Definition at line 114 of file HLSReader.h.

Referenced by LoadMetaPlaylists(), LoadSegments(), ParseM3U8(), and PercentBuffered().

◆ m_bandwidthcheck

bool HLSReader::m_bandwidthcheck {false}
private

Definition at line 115 of file HLSReader.h.

Referenced by LoadMetaPlaylists(), LoadSegments(), and ParseM3U8().

◆ m_prebuffer_cnt

uint HLSReader::m_prebuffer_cnt {10}
private

Definition at line 116 of file HLSReader.h.

Referenced by LoadSegments(), and Throttle().

◆ m_seq_lock

QMutex HLSReader::m_seq_lock
private

Definition at line 117 of file HLSReader.h.

Referenced by LoadSegments(), and ParseM3U8().

◆ m_stream_lock

QMutex HLSReader::m_stream_lock
mutableprivate

◆ m_throttle_lock

QMutex HLSReader::m_throttle_lock
private

Definition at line 119 of file HLSReader.h.

Referenced by Cancel(), LoadSegments(), and Throttle().

◆ m_throttle_cond

QWaitCondition HLSReader::m_throttle_cond
private

Definition at line 120 of file HLSReader.h.

Referenced by Cancel(), LoadSegments(), and Throttle().

◆ m_debug

bool HLSReader::m_debug {false}
private

Definition at line 121 of file HLSReader.h.

Referenced by DownloadSegmentData(), EnableDebugging(), LoadSegments(), and ParseM3U8().

◆ m_debug_cnt

int HLSReader::m_debug_cnt {0}
private

Definition at line 122 of file HLSReader.h.

Referenced by EnableDebugging(), and ParseM3U8().

◆ m_slow_cnt

int HLSReader::m_slow_cnt {0}
private

Definition at line 125 of file HLSReader.h.

Referenced by DownloadSegmentData().

◆ m_buffer

QByteArray HLSReader::m_buffer
private

Definition at line 126 of file HLSReader.h.

Referenced by DownloadSegmentData(), and Read().

◆ m_buflock

QMutex HLSReader::m_buflock
private

Definition at line 127 of file HLSReader.h.

Referenced by DownloadSegmentData(), and Read().


The documentation for this class was generated from the following files: