MythTV  master
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
HTTPLiveStream Class Reference

#include <libmythtv/HLS/httplivestream.h>

Collaboration diagram for HTTPLiveStream:
[legend]

Public Member Functions

 HTTPLiveStream (QString srcFile, uint16_t width=640, uint16_t height=480, uint32_t bitrate=800000, uint32_t abitrate=64000, uint16_t maxSegments=0, uint16_t segmentSize=10, uint32_t aobitrate=32000, int32_t srate=-1)
 
 HTTPLiveStream (int streamid)
 
 ~HTTPLiveStream ()
 
bool InitForWrite (void)
 
bool LoadFromDB (void)
 
int GetStreamID (void) const
 
uint16_t GetWidth (void) const
 
uint16_t GetHeight (void) const
 
uint32_t GetBitrate (void) const
 
uint32_t GetAudioBitrate (void) const
 
uint32_t GetAudioOnlyBitrate (void) const
 
uint16_t GetMaxSegments (void) const
 
QString GetSourceFile (void) const
 
QString GetHTMLPageName (void) const
 
QString GetMetaPlaylistName (void) const
 
QString GetPlaylistName (bool audioOnly=false) const
 
uint16_t GetSegmentSize (void) const
 
QString GetFilename (uint16_t segmentNumber=0, bool fileOnly=false, bool audioOnly=false, bool encoded=false) const
 
QString GetCurrentFilename (bool audioOnly=false, bool encoded=false) const
 
void SetOutputVars (void)
 
HTTPLiveStreamStatus GetDBStatus (void) const
 
int AddStream (void)
 
bool AddSegment (void)
 
bool WriteHTML (void)
 
bool WriteMetaPlaylist (void)
 
bool WritePlaylist (bool audioOnly=false, bool writeEndTag=false)
 
bool SaveSegmentInfo (void)
 
bool UpdateSizeInfo (uint16_t width, uint16_t height, uint16_t srcwidth, uint16_t srcheight)
 
bool UpdateStatus (HTTPLiveStreamStatus status)
 
bool UpdateStatusMessage (const QString &message)
 
bool UpdatePercentComplete (int percent)
 
bool CheckStop (void)
 
DTC::LiveStreamInfoStartStream (void)
 
DTC::LiveStreamInfoGetLiveStreamInfo (DTC::LiveStreamInfo *info=nullptr)
 

Static Public Member Functions

static QString StatusToString (HTTPLiveStreamStatus status)
 
static DTC::LiveStreamInfoStopStream (int id)
 
static bool RemoveStream (int id)
 
static DTC::LiveStreamInfoListGetLiveStreamInfoList (const QString &FileName="")
 

Protected Attributes

bool m_writing {false}
 
int m_streamid {-1}
 
QString m_sourceFile
 
QString m_sourceHost
 
uint16_t m_sourceWidth {0}
 
uint16_t m_sourceHeight {0}
 
QString m_outDir
 
QString m_outBase
 
QString m_outBaseEncoded
 
QString m_outFile
 
QString m_outFileEncoded
 
QString m_audioOutFile
 
QString m_audioOutFileEncoded
 
uint16_t m_segmentSize {10}
 
uint16_t m_maxSegments {0}
 
uint16_t m_segmentCount {0}
 
uint16_t m_startSegment {0}
 
uint16_t m_curSegment {0}
 
QString m_httpPrefix
 
QString m_httpPrefixRel
 
uint16_t m_height {480}
 
uint16_t m_width {640}
 
uint32_t m_bitrate {800000}
 
uint32_t m_audioBitrate { 64000}
 
uint32_t m_audioOnlyBitrate { 32000}
 
int32_t m_sampleRate {-1}
 
QDateTime m_created
 
QDateTime m_lastModified
 
uint16_t m_percentComplete {0}
 
QString m_relativeURL
 
QString m_fullURL
 
QString m_statusMessage
 
HTTPLiveStreamStatus m_status {kHLSStatusUndefined}
 

Detailed Description

Definition at line 22 of file httplivestream.h.

Constructor & Destructor Documentation

◆ HTTPLiveStream() [1/2]

HTTPLiveStream::HTTPLiveStream ( QString  srcFile,
uint16_t  width = 640,
uint16_t  height = 480,
uint32_t  bitrate = 800000,
uint32_t  abitrate = 64000,
uint16_t  maxSegments = 0,
uint16_t  segmentSize = 10,
uint32_t  aobitrate = 32000,
int32_t  srate = -1 
)
explicit

Definition at line 97 of file httplivestream.cpp.

Referenced by GetLiveStreamInfoList(), RemoveStream(), and StopStream().

◆ HTTPLiveStream() [2/2]

HTTPLiveStream::HTTPLiveStream ( int  streamid)
explicit

Definition at line 151 of file httplivestream.cpp.

◆ ~HTTPLiveStream()

HTTPLiveStream::~HTTPLiveStream ( )

Definition at line 157 of file httplivestream.cpp.

Member Function Documentation

◆ InitForWrite()

bool HTTPLiveStream::InitForWrite ( void  )

Definition at line 167 of file httplivestream.cpp.

Referenced by Transcode::TranscodeFile().

◆ LoadFromDB()

bool HTTPLiveStream::LoadFromDB ( void  )

Definition at line 683 of file httplivestream.cpp.

Referenced by HTTPLiveStream().

◆ GetStreamID()

int HTTPLiveStream::GetStreamID ( void  ) const
inline

Definition at line 35 of file httplivestream.h.

Referenced by StartStream(), and Transcode::TranscodeFile().

◆ GetWidth()

uint16_t HTTPLiveStream::GetWidth ( void  ) const
inline

Definition at line 36 of file httplivestream.h.

Referenced by Transcode::TranscodeFile().

◆ GetHeight()

uint16_t HTTPLiveStream::GetHeight ( void  ) const
inline

Definition at line 37 of file httplivestream.h.

Referenced by Transcode::TranscodeFile().

◆ GetBitrate()

uint32_t HTTPLiveStream::GetBitrate ( void  ) const
inline

Definition at line 38 of file httplivestream.h.

Referenced by Transcode::TranscodeFile().

◆ GetAudioBitrate()

uint32_t HTTPLiveStream::GetAudioBitrate ( void  ) const
inline

Definition at line 39 of file httplivestream.h.

Referenced by Transcode::TranscodeFile().

◆ GetAudioOnlyBitrate()

uint32_t HTTPLiveStream::GetAudioOnlyBitrate ( void  ) const
inline

Definition at line 40 of file httplivestream.h.

Referenced by Transcode::TranscodeFile().

◆ GetMaxSegments()

uint16_t HTTPLiveStream::GetMaxSegments ( void  ) const
inline

Definition at line 41 of file httplivestream.h.

◆ GetSourceFile()

QString HTTPLiveStream::GetSourceFile ( void  ) const
inline

Definition at line 42 of file httplivestream.h.

Referenced by main(), and Transcode::TranscodeFile().

◆ GetHTMLPageName()

QString HTTPLiveStream::GetHTMLPageName ( void  ) const

Definition at line 341 of file httplivestream.cpp.

◆ GetMetaPlaylistName()

QString HTTPLiveStream::GetMetaPlaylistName ( void  ) const

Definition at line 385 of file httplivestream.cpp.

Referenced by WriteMetaPlaylist().

◆ GetPlaylistName()

QString HTTPLiveStream::GetPlaylistName ( bool  audioOnly = false) const

Definition at line 432 of file httplivestream.cpp.

Referenced by WritePlaylist().

◆ GetSegmentSize()

uint16_t HTTPLiveStream::GetSegmentSize ( void  ) const
inline

Definition at line 46 of file httplivestream.h.

Referenced by Transcode::TranscodeFile().

◆ GetFilename()

QString HTTPLiveStream::GetFilename ( uint16_t  segmentNumber = 0,
bool  fileOnly = false,
bool  audioOnly = false,
bool  encoded = false 
) const

Definition at line 181 of file httplivestream.cpp.

Referenced by AddSegment(), GetCurrentFilename(), and WritePlaylist().

◆ GetCurrentFilename()

QString HTTPLiveStream::GetCurrentFilename ( bool  audioOnly = false,
bool  encoded = false 
) const

Definition at line 202 of file httplivestream.cpp.

Referenced by Transcode::TranscodeFile().

◆ SetOutputVars()

void HTTPLiveStream::SetOutputVars ( void  )

Definition at line 738 of file httplivestream.cpp.

Referenced by HTTPLiveStream(), LoadFromDB(), and UpdateSizeInfo().

◆ GetDBStatus()

HTTPLiveStreamStatus HTTPLiveStream::GetDBStatus ( void  ) const

Definition at line 777 of file httplivestream.cpp.

Referenced by StartStream().

◆ AddStream()

int HTTPLiveStream::AddStream ( void  )

Definition at line 207 of file httplivestream.cpp.

Referenced by HTTPLiveStream().

◆ AddSegment()

bool HTTPLiveStream::AddSegment ( void  )

Definition at line 306 of file httplivestream.cpp.

Referenced by Transcode::TranscodeFile().

◆ WriteHTML()

bool HTTPLiveStream::WriteHTML ( void  )

Definition at line 350 of file httplivestream.cpp.

Referenced by InitForWrite().

◆ WriteMetaPlaylist()

bool HTTPLiveStream::WriteMetaPlaylist ( void  )

Definition at line 394 of file httplivestream.cpp.

Referenced by InitForWrite().

◆ WritePlaylist()

bool HTTPLiveStream::WritePlaylist ( bool  audioOnly = false,
bool  writeEndTag = false 
)

Definition at line 445 of file httplivestream.cpp.

Referenced by AddSegment(), and ~HTTPLiveStream().

◆ SaveSegmentInfo()

bool HTTPLiveStream::SaveSegmentInfo ( void  )

Definition at line 503 of file httplivestream.cpp.

Referenced by AddSegment().

◆ UpdateSizeInfo()

bool HTTPLiveStream::UpdateSizeInfo ( uint16_t  width,
uint16_t  height,
uint16_t  srcwidth,
uint16_t  srcheight 
)

Definition at line 528 of file httplivestream.cpp.

Referenced by Transcode::TranscodeFile().

◆ UpdateStatus()

bool HTTPLiveStream::UpdateStatus ( HTTPLiveStreamStatus  status)

Definition at line 579 of file httplivestream.cpp.

Referenced by InitForWrite(), and Transcode::TranscodeFile().

◆ UpdateStatusMessage()

bool HTTPLiveStream::UpdateStatusMessage ( const QString &  message)

Definition at line 617 of file httplivestream.cpp.

Referenced by InitForWrite(), and Transcode::TranscodeFile().

◆ UpdatePercentComplete()

bool HTTPLiveStream::UpdatePercentComplete ( int  percent)

Definition at line 642 of file httplivestream.cpp.

Referenced by Transcode::TranscodeFile().

◆ StatusToString()

QString HTTPLiveStream::StatusToString ( HTTPLiveStreamStatus  status)
static

Definition at line 667 of file httplivestream.cpp.

Referenced by GetLiveStreamInfo(), and UpdateStatus().

◆ CheckStop()

bool HTTPLiveStream::CheckStop ( void  )

Definition at line 799 of file httplivestream.cpp.

Referenced by Transcode::TranscodeFile().

◆ StartStream()

DTC::LiveStreamInfo * HTTPLiveStream::StartStream ( void  )

Definition at line 821 of file httplivestream.cpp.

◆ StopStream()

DTC::LiveStreamInfo * HTTPLiveStream::StopStream ( int  id)
static

Definition at line 918 of file httplivestream.cpp.

Referenced by RemoveStream(), and Content::StopLiveStream().

◆ RemoveStream()

bool HTTPLiveStream::RemoveStream ( int  id)
static

Definition at line 846 of file httplivestream.cpp.

Referenced by Content::RemoveLiveStream().

◆ GetLiveStreamInfo()

DTC::LiveStreamInfo * HTTPLiveStream::GetLiveStreamInfo ( DTC::LiveStreamInfo info = nullptr)

Definition at line 967 of file httplivestream.cpp.

Referenced by GetLiveStreamInfoList(), and StartStream().

◆ GetLiveStreamInfoList()

DTC::LiveStreamInfoList * HTTPLiveStream::GetLiveStreamInfoList ( const QString &  FileName = "")
static

Definition at line 1003 of file httplivestream.cpp.

Referenced by Content::GetLiveStreamList().

Member Data Documentation

◆ m_writing

bool HTTPLiveStream::m_writing {false}
protected

Definition at line 83 of file httplivestream.h.

Referenced by InitForWrite(), and ~HTTPLiveStream().

◆ m_streamid

int HTTPLiveStream::m_streamid {-1}
protected

◆ m_sourceFile

QString HTTPLiveStream::m_sourceFile
protected

◆ m_sourceHost

QString HTTPLiveStream::m_sourceHost
protected

Definition at line 86 of file httplivestream.h.

Referenced by GetLiveStreamInfo(), HTTPLiveStream(), and LoadFromDB().

◆ m_sourceWidth

uint16_t HTTPLiveStream::m_sourceWidth {0}
protected

Definition at line 87 of file httplivestream.h.

Referenced by GetLiveStreamInfo(), LoadFromDB(), and UpdateSizeInfo().

◆ m_sourceHeight

uint16_t HTTPLiveStream::m_sourceHeight {0}
protected

Definition at line 88 of file httplivestream.h.

Referenced by GetLiveStreamInfo(), LoadFromDB(), and UpdateSizeInfo().

◆ m_outDir

QString HTTPLiveStream::m_outDir
protected

◆ m_outBase

QString HTTPLiveStream::m_outBase
protected

◆ m_outBaseEncoded

QString HTTPLiveStream::m_outBaseEncoded
protected

Definition at line 91 of file httplivestream.h.

Referenced by SetOutputVars(), and WriteHTML().

◆ m_outFile

QString HTTPLiveStream::m_outFile
protected

Definition at line 92 of file httplivestream.h.

Referenced by GetFilename(), GetPlaylistName(), and SetOutputVars().

◆ m_outFileEncoded

QString HTTPLiveStream::m_outFileEncoded
protected

Definition at line 93 of file httplivestream.h.

Referenced by GetFilename(), SetOutputVars(), and WriteMetaPlaylist().

◆ m_audioOutFile

QString HTTPLiveStream::m_audioOutFile
protected

Definition at line 94 of file httplivestream.h.

Referenced by GetFilename(), GetPlaylistName(), and SetOutputVars().

◆ m_audioOutFileEncoded

QString HTTPLiveStream::m_audioOutFileEncoded
protected

Definition at line 95 of file httplivestream.h.

Referenced by GetFilename(), SetOutputVars(), and WriteMetaPlaylist().

◆ m_segmentSize

uint16_t HTTPLiveStream::m_segmentSize {10}
protected

◆ m_maxSegments

uint16_t HTTPLiveStream::m_maxSegments {0}
protected

Definition at line 97 of file httplivestream.h.

Referenced by AddSegment(), AddStream(), GetLiveStreamInfo(), and LoadFromDB().

◆ m_segmentCount

uint16_t HTTPLiveStream::m_segmentCount {0}
protected

◆ m_startSegment

uint16_t HTTPLiveStream::m_startSegment {0}
protected

◆ m_curSegment

uint16_t HTTPLiveStream::m_curSegment {0}
protected

◆ m_httpPrefix

QString HTTPLiveStream::m_httpPrefix
protected

Definition at line 101 of file httplivestream.h.

Referenced by HTTPLiveStream(), SetOutputVars(), and UpdateSizeInfo().

◆ m_httpPrefixRel

QString HTTPLiveStream::m_httpPrefixRel
protected

Definition at line 102 of file httplivestream.h.

Referenced by HTTPLiveStream(), SetOutputVars(), and UpdateSizeInfo().

◆ m_height

uint16_t HTTPLiveStream::m_height {480}
protected

◆ m_width

uint16_t HTTPLiveStream::m_width {640}
protected

◆ m_bitrate

uint32_t HTTPLiveStream::m_bitrate {800000}
protected

◆ m_audioBitrate

uint32_t HTTPLiveStream::m_audioBitrate { 64000}
protected

◆ m_audioOnlyBitrate

uint32_t HTTPLiveStream::m_audioOnlyBitrate { 32000}
protected

◆ m_sampleRate

int32_t HTTPLiveStream::m_sampleRate {-1}
protected

Definition at line 108 of file httplivestream.h.

Referenced by AddStream(), and LoadFromDB().

◆ m_created

QDateTime HTTPLiveStream::m_created
protected

Definition at line 110 of file httplivestream.h.

Referenced by AddStream(), GetLiveStreamInfo(), and LoadFromDB().

◆ m_lastModified

QDateTime HTTPLiveStream::m_lastModified
protected

Definition at line 111 of file httplivestream.h.

Referenced by AddStream(), GetLiveStreamInfo(), and LoadFromDB().

◆ m_percentComplete

uint16_t HTTPLiveStream::m_percentComplete {0}
protected

Definition at line 112 of file httplivestream.h.

Referenced by GetLiveStreamInfo(), LoadFromDB(), and UpdatePercentComplete().

◆ m_relativeURL

QString HTTPLiveStream::m_relativeURL
protected

◆ m_fullURL

QString HTTPLiveStream::m_fullURL
protected

◆ m_statusMessage

QString HTTPLiveStream::m_statusMessage
protected

Definition at line 115 of file httplivestream.h.

Referenced by GetLiveStreamInfo(), LoadFromDB(), and UpdateStatusMessage().

◆ m_status

HTTPLiveStreamStatus HTTPLiveStream::m_status {kHLSStatusUndefined}
protected

Definition at line 117 of file httplivestream.h.

Referenced by AddStream(), GetLiveStreamInfo(), LoadFromDB(), and UpdateStatus().


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