arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
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 Function Documentation

◆ 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


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