MythTV  master
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
HLSStream Class Reference
Collaboration diagram for HLSStream:
Collaboration graph
[legend]

Public Member Functions

 HLSStream (const int mid, const uint64_t bitrate, QString uri)
 
 HLSStream (const HLSStream &rhs, bool copy=true)
 
 ~HLSStream ()
 
HLSStreamoperator= (const HLSStream &rhs)
 
bool operator< (const HLSStream &b) const
 
bool operator> (const HLSStream &b) const
 
uint64_t Size (bool force=false)
 Return the estimated size of the stream in bytes if a segment hasn't been downloaded, its size is estimated according to the bandwidth of the stream. More...
 
std::chrono::seconds Duration (void)
 
void Clear (void)
 
int NumSegments (void) const
 
void AppendSegment (HLSSegment *segment)
 
HLSSegmentGetSegment (const int wanted) const
 
HLSSegmentFindSegment (const int id, int *segnum=nullptr) const
 
void AddSegment (const std::chrono::seconds duration, const QString &title, const QString &uri)
 
void RemoveSegment (HLSSegment *segment, bool willdelete=true)
 
void RemoveSegment (int segnum, bool willdelete=true)
 
void RemoveListSegments (QHash< HLSSegment *, bool > &table)
 
int DownloadSegmentData (int segnum, uint64_t &bandwidth, int stream)
 
int Id (void) const
 
int Version (void) const
 
void SetVersion (int x)
 
int StartSequence (void) const
 
void SetStartSequence (int x)
 
std::chrono::seconds TargetDuration (void) const
 
void SetTargetDuration (std::chrono::seconds x)
 
uint64_t Bitrate (void) const
 
bool Cache (void) const
 
void SetCache (bool x)
 
bool Live (void) const
 
void SetLive (bool x)
 
void Lock (void)
 
void Unlock (void)
 
QString Url (void) const
 
void UpdateWith (const HLSStream &upd)
 
void Cancel (void)
 

Static Public Member Functions

static bool IsGreater (const HLSStream *s1, const HLSStream *s2)
 

Private Attributes

int m_id {0}
 
int m_version {1}
 
int m_startsequence {0}
 
std::chrono::seconds m_targetduration {-1s}
 
uint64_t m_bitrate {0LL}
 
uint64_t m_size {0LL}
 
std::chrono::seconds m_duration {0s}
 
bool m_live {true}
 
QList< HLSSegment * > m_segments
 
QString m_url
 
QMutex m_lock
 
bool m_cache {true}
 

Detailed Description

Definition at line 396 of file httplivestreambuffer.cpp.

Constructor & Destructor Documentation

◆ HLSStream() [1/2]

HLSStream::HLSStream ( const int  mid,
const uint64_t  bitrate,
QString  uri 
)
inline

Definition at line 399 of file httplivestreambuffer.cpp.

◆ HLSStream() [2/2]

HLSStream::HLSStream ( const HLSStream rhs,
bool  copy = true 
)
inline

Definition at line 409 of file httplivestreambuffer.cpp.

◆ ~HLSStream()

HLSStream::~HLSStream ( )
inline

Definition at line 422 of file httplivestreambuffer.cpp.

Member Function Documentation

◆ operator=()

HLSStream& HLSStream::operator= ( const HLSStream rhs)
inline

Definition at line 428 of file httplivestreambuffer.cpp.

◆ IsGreater()

static bool HLSStream::IsGreater ( const HLSStream s1,
const HLSStream s2 
)
inlinestatic

Definition at line 451 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::OpenFile().

◆ operator<()

bool HLSStream::operator< ( const HLSStream b) const
inline

Definition at line 456 of file httplivestreambuffer.cpp.

◆ operator>()

bool HLSStream::operator> ( const HLSStream b) const
inline

Definition at line 461 of file httplivestreambuffer.cpp.

◆ Size()

uint64_t HLSStream::Size ( bool  force = false)
inline

Return the estimated size of the stream in bytes if a segment hasn't been downloaded, its size is estimated according to the bandwidth of the stream.

Definition at line 471 of file httplivestreambuffer.cpp.

◆ Duration()

std::chrono::seconds HLSStream::Duration ( void  )
inline

Definition at line 498 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::SizeMedia().

◆ Clear()

void HLSStream::Clear ( void  )
inline

Definition at line 504 of file httplivestreambuffer.cpp.

◆ NumSegments()

int HLSStream::NumSegments ( void  ) const
inline

◆ AppendSegment()

void HLSStream::AppendSegment ( HLSSegment segment)
inline

Definition at line 514 of file httplivestreambuffer.cpp.

Referenced by AddSegment(), HLSStream(), and PlaylistWorker::UpdatePlaylist().

◆ GetSegment()

HLSSegment* HLSStream::GetSegment ( const int  wanted) const
inline

◆ FindSegment()

HLSSegment* HLSStream::FindSegment ( const int  id,
int *  segnum = nullptr 
) const
inline

Definition at line 530 of file httplivestreambuffer.cpp.

Referenced by PlaylistWorker::UpdatePlaylist().

◆ AddSegment()

void HLSStream::AddSegment ( const std::chrono::seconds  duration,
const QString &  title,
const QString &  uri 
)
inline

Definition at line 552 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::ParseM3U8().

◆ RemoveSegment() [1/2]

void HLSStream::RemoveSegment ( HLSSegment segment,
bool  willdelete = true 
)
inline

Definition at line 565 of file httplivestreambuffer.cpp.

Referenced by RemoveListSegments(), and HLSRingBuffer::SanitizeStreams().

◆ RemoveSegment() [2/2]

void HLSStream::RemoveSegment ( int  segnum,
bool  willdelete = true 
)
inline

Definition at line 587 of file httplivestreambuffer.cpp.

◆ RemoveListSegments()

void HLSStream::RemoveListSegments ( QHash< HLSSegment *, bool > &  table)
inline

Definition at line 600 of file httplivestreambuffer.cpp.

Referenced by PlaylistWorker::UpdatePlaylist().

◆ DownloadSegmentData()

int HLSStream::DownloadSegmentData ( int  segnum,
uint64_t &  bandwidth,
int  stream 
)
inline

Definition at line 610 of file httplivestreambuffer.cpp.

Referenced by StreamWorker::run().

◆ Id()

int HLSStream::Id ( void  ) const
inline

◆ Version()

int HLSStream::Version ( void  ) const
inline

◆ SetVersion()

void HLSStream::SetVersion ( int  x)
inline

Definition at line 709 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::ParseM3U8().

◆ StartSequence()

int HLSStream::StartSequence ( void  ) const
inline

◆ SetStartSequence()

void HLSStream::SetStartSequence ( int  x)
inline

◆ TargetDuration()

std::chrono::seconds HLSStream::TargetDuration ( void  ) const
inline

◆ SetTargetDuration()

void HLSStream::SetTargetDuration ( std::chrono::seconds  x)
inline

Definition at line 725 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::ParseTargetDuration().

◆ Bitrate()

uint64_t HLSStream::Bitrate ( void  ) const
inline

◆ Cache()

bool HLSStream::Cache ( void  ) const
inline

Definition at line 733 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::SafeRead().

◆ SetCache()

void HLSStream::SetCache ( bool  x)
inline

Definition at line 737 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::ParseAllowCache().

◆ Live()

bool HLSStream::Live ( void  ) const
inline

◆ SetLive()

void HLSStream::SetLive ( bool  x)
inline

Definition at line 745 of file httplivestreambuffer.cpp.

Referenced by HLSRingBuffer::ParseEndList().

◆ Lock()

void HLSStream::Lock ( void  )
inline

◆ Unlock()

void HLSStream::Unlock ( void  )
inline

◆ Url()

QString HLSStream::Url ( void  ) const
inline

Definition at line 757 of file httplivestreambuffer.cpp.

Referenced by PlaylistWorker::Cancel(), and HLSRingBuffer::ParseM3U8().

◆ UpdateWith()

void HLSStream::UpdateWith ( const HLSStream upd)
inline

Definition at line 761 of file httplivestreambuffer.cpp.

Referenced by PlaylistWorker::UpdatePlaylist().

◆ Cancel()

void HLSStream::Cancel ( void  )
inline

Definition at line 768 of file httplivestreambuffer.cpp.

Referenced by StreamWorker::Cancel().

Member Data Documentation

◆ m_id

int HLSStream::m_id {0}
private

Definition at line 853 of file httplivestreambuffer.cpp.

Referenced by DownloadSegmentData(), Id(), and operator=().

◆ m_version

int HLSStream::m_version {1}
private

Definition at line 854 of file httplivestreambuffer.cpp.

Referenced by operator=(), SetVersion(), and Version().

◆ m_startsequence

int HLSStream::m_startsequence {0}
private

◆ m_targetduration

std::chrono::seconds HLSStream::m_targetduration {-1s}
private

Definition at line 856 of file httplivestreambuffer.cpp.

Referenced by operator=(), SetTargetDuration(), TargetDuration(), and UpdateWith().

◆ m_bitrate

uint64_t HLSStream::m_bitrate {0LL}
private

Definition at line 857 of file httplivestreambuffer.cpp.

Referenced by Bitrate(), DownloadSegmentData(), and operator=().

◆ m_size

uint64_t HLSStream::m_size {0LL}
private

Definition at line 858 of file httplivestreambuffer.cpp.

Referenced by operator=(), and Size().

◆ m_duration

std::chrono::seconds HLSStream::m_duration {0s}
private

Definition at line 860 of file httplivestreambuffer.cpp.

Referenced by AddSegment(), Duration(), operator=(), and RemoveSegment().

◆ m_live

bool HLSStream::m_live {true}
private

Definition at line 861 of file httplivestreambuffer.cpp.

Referenced by Live(), operator=(), and SetLive().

◆ m_segments

QList<HLSSegment*> HLSStream::m_segments
private

◆ m_url

QString HLSStream::m_url
private

Definition at line 864 of file httplivestreambuffer.cpp.

Referenced by AddSegment(), operator=(), and Url().

◆ m_lock

QMutex HLSStream::m_lock
private

◆ m_cache

bool HLSStream::m_cache {true}
private

Definition at line 866 of file httplivestreambuffer.cpp.

Referenced by Cache(), operator=(), SetCache(), and UpdateWith().


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