arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
HLSParser< URLStream > Class Template Reference

Simple Parser for HLS data. More...

#include <HLSStream.h>

Public Member Functions

int available ()
 
bool begin ()
 
bool begin (const char *urlStr)
 
int contentLength ()
 Provides the http content lengh.
 
const char * contentType ()
 Provides the content type of the audio data.
 
void end ()
 Closes the processing.
 
const char * getCodec ()
 Provides the codec.
 
const char * indexUrl ()
 
size_t readBytes (uint8_t *data, size_t len)
 
const char * segmentsUrl ()
 
void setBufferSize (int size, int count)
 Redefines the buffer size.
 
void setCACert (const char *cert)
 
void setPowerSave (bool flag)
 
void setUrlCount (int count)
 Defines the number of urls that are preloaded in the URLLoaderHLS.
 
void setURLResolver (const char *(*cb)(const char *segment, const char *reqURL))
 
size_t totalRead ()
 Povides the number of bytes read.
 
const char * urlStr ()
 Provides the hls url as string.
 

Protected Types

enum class  URLType { Undefined , Index , Segment }
 

Protected Member Functions

bool parseIndex ()
 parse the index file and the segments
 
bool parseIndexLine (StrView &str)
 Determine codec for min bandwidth.
 
bool parseIndexLineMetaData (StrView &str)
 
bool parseIndexLines ()
 parse the index file
 
bool parseLineURL (StrView &str)
 
bool parseSegmentLine (StrView &str)
 Add all segments to queue.
 
bool parseSegmentLineMetaData (StrView &str)
 
bool parseSegmentLines ()
 parse the segments
 
bool parseSegments ()
 parse the segment url provided by the index
 
void reloadSegments ()
 trigger the reloading of segments if the limit is underflowing
 
void resetTimings ()
 
void segmentsActivate ()
 

Static Protected Member Functions

static const char * resolveURL (const char *segment, const char *reqURL)
 

Protected Attributes

bool active = false
 
int bandwidth = 0
 
Str codec
 
const char * index_url_str = nullptr
 
bool is_extm3u = false
 
int media_sequence = 0
 
uint64_t next_sement_load_time = 0
 
uint64_t next_sement_load_time_planned = 0
 
URLType next_url_type = URLType::Undefined
 
bool parse_segments_active = false
 
float play_time = 0
 
const char *(* resolve_url )(const char *segment, const char *reqURL) = resolveURL
 
int segment_count = 0
 
Str segments_url_str
 
size_t total_read = 0
 
bool url_active = false
 
int url_count = 5
 
URLHistory url_history
 
URLLoaderHLS< URLStream > url_loader
 
Str url_str
 
URLStream url_stream
 

Detailed Description

template<typename URLStream>
class audio_tools_hls::HLSParser< URLStream >

Simple Parser for HLS data.

Author
Phil Schatzmann

Member Enumeration Documentation

◆ URLType

template<typename URLStream >
enum class URLType
strongprotected
Enumerator
Undefined 
Index 
Segment 

Member Function Documentation

◆ available()

template<typename URLStream >
int available ( )
inline

◆ begin() [1/2]

template<typename URLStream >
bool begin ( )
inline

◆ begin() [2/2]

template<typename URLStream >
bool begin ( const char *  urlStr)
inline

◆ contentLength()

template<typename URLStream >
int contentLength ( )
inline

Provides the http content lengh.

◆ contentType()

template<typename URLStream >
const char * contentType ( )
inline

Provides the content type of the audio data.

◆ end()

template<typename URLStream >
void end ( )
inline

Closes the processing.

◆ getCodec()

template<typename URLStream >
const char * getCodec ( )
inline

Provides the codec.

◆ indexUrl()

template<typename URLStream >
const char * indexUrl ( )
inline

◆ parseIndex()

template<typename URLStream >
bool parseIndex ( )
inlineprotected

parse the index file and the segments

◆ parseIndexLine()

template<typename URLStream >
bool parseIndexLine ( StrView &  str)
inlineprotected

Determine codec for min bandwidth.

◆ parseIndexLineMetaData()

template<typename URLStream >
bool parseIndexLineMetaData ( StrView &  str)
inlineprotected

◆ parseIndexLines()

template<typename URLStream >
bool parseIndexLines ( )
inlineprotected

parse the index file

◆ parseLineURL()

template<typename URLStream >
bool parseLineURL ( StrView &  str)
inlineprotected

◆ parseSegmentLine()

template<typename URLStream >
bool parseSegmentLine ( StrView &  str)
inlineprotected

Add all segments to queue.

◆ parseSegmentLineMetaData()

template<typename URLStream >
bool parseSegmentLineMetaData ( StrView &  str)
inlineprotected

◆ parseSegmentLines()

template<typename URLStream >
bool parseSegmentLines ( )
inlineprotected

parse the segments

◆ parseSegments()

template<typename URLStream >
bool parseSegments ( )
inlineprotected

parse the segment url provided by the index

◆ readBytes()

template<typename URLStream >
size_t readBytes ( uint8_t *  data,
size_t  len 
)
inline

◆ reloadSegments()

template<typename URLStream >
void reloadSegments ( )
inlineprotected

trigger the reloading of segments if the limit is underflowing

◆ resetTimings()

template<typename URLStream >
void resetTimings ( )
inlineprotected

◆ resolveURL()

template<typename URLStream >
static const char * resolveURL ( const char *  segment,
const char *  reqURL 
)
inlinestaticprotected

Default implementation for url resolver: determine absolue url from relative url

◆ segmentsActivate()

template<typename URLStream >
void segmentsActivate ( )
inlineprotected

◆ segmentsUrl()

template<typename URLStream >
const char * segmentsUrl ( )
inline

◆ setBufferSize()

template<typename URLStream >
void setBufferSize ( int  size,
int  count 
)
inline

Redefines the buffer size.

◆ setCACert()

template<typename URLStream >
void setCACert ( const char *  cert)
inline

◆ setPowerSave()

template<typename URLStream >
void setPowerSave ( bool  flag)
inline

◆ setUrlCount()

template<typename URLStream >
void setUrlCount ( int  count)
inline

Defines the number of urls that are preloaded in the URLLoaderHLS.

◆ setURLResolver()

template<typename URLStream >
void setURLResolver ( const char *(*)(const char *segment, const char *reqURL)  cb)
inline

◆ totalRead()

template<typename URLStream >
size_t totalRead ( )
inline

Povides the number of bytes read.

◆ urlStr()

template<typename URLStream >
const char * urlStr ( )
inline

Provides the hls url as string.

Member Data Documentation

◆ active

template<typename URLStream >
bool active = false
protected

◆ bandwidth

template<typename URLStream >
int bandwidth = 0
protected

◆ codec

template<typename URLStream >
Str codec
protected

◆ index_url_str

template<typename URLStream >
const char* index_url_str = nullptr
protected

◆ is_extm3u

template<typename URLStream >
bool is_extm3u = false
protected

◆ media_sequence

template<typename URLStream >
int media_sequence = 0
protected

◆ next_sement_load_time

template<typename URLStream >
uint64_t next_sement_load_time = 0
protected

◆ next_sement_load_time_planned

template<typename URLStream >
uint64_t next_sement_load_time_planned = 0
protected

◆ next_url_type

template<typename URLStream >
URLType next_url_type = URLType::Undefined
protected

◆ parse_segments_active

template<typename URLStream >
bool parse_segments_active = false
protected

◆ play_time

template<typename URLStream >
float play_time = 0
protected

◆ resolve_url

template<typename URLStream >
const char *(* resolve_url) (const char *segment, const char *reqURL) = resolveURL
protected

◆ segment_count

template<typename URLStream >
int segment_count = 0
protected

◆ segments_url_str

template<typename URLStream >
Str segments_url_str
protected

◆ total_read

template<typename URLStream >
size_t total_read = 0
protected

◆ url_active

template<typename URLStream >
bool url_active = false
protected

◆ url_count

template<typename URLStream >
int url_count = 5
protected

◆ url_history

template<typename URLStream >
URLHistory url_history
protected

◆ url_loader

template<typename URLStream >
URLLoaderHLS<URLStream> url_loader
protected

◆ url_str

template<typename URLStream >
Str url_str
protected

◆ url_stream

template<typename URLStream >
URLStream url_stream
protected

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