AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Namespaces | |
test | |
Classes | |
class | ContentDecrypter |
class | FFMpegInputBuffer |
class | Id3TagsRemover |
class | IterativePlaylistParser |
struct | M3UContent |
A struct used to encapsulate information retrieved from an M3U playlist. More... | |
struct | PlayItem |
class | PlaylistParser |
class | UrlContentToAttachmentConverter |
Class that handles the streaming of urls containing media into Attachments . More... | |
Typedefs | |
typedef std::vector< unsigned char > | ByteVector |
Alias for bytes. More... | |
Functions | |
bool | isPlaylistExtendedM3U (const std::string &playlistContent) |
M3UContent | parseM3UContent (const std::string &playlistURL, const std::string &content) |
avsCommon::utils::playlistParser::EncryptionInfo | parseHLSEncryptionLine (const std::string &line, const std::string &baseURL) |
long | parsePlaylistMediaSequence (const std::string &line) |
avsCommon::utils::playlistParser::ByteRange | parseHLSByteRangeLine (const std::string &line) |
avsCommon::utils::playlistParser::PlaylistEntry | parseHLSMapLine (const std::string &line, const std::string &baseURL) |
std::vector< std::string > | parsePLSContent (const std::string &playlistURL, const std::string &content) |
void | removeCarriageReturnFromLine (std::string *line) |
bool | readFromContentFetcher (std::unique_ptr< avsCommon::sdkInterfaces::HTTPContentFetcherInterface > contentFetcher, std::string *content, std::atomic< bool > *shouldShutDown, std::string *playlistURL) |
bool | isURLAbsolute (const std::string &url) |
bool | getAbsoluteURLFromRelativePathToURL (std::string baseURL, std::string relativePath, std::string *absoluteURL) |
Variables | |
static constexpr long | INVALID_MEDIA_SEQUENCE = -1 |
An invalid media sequence number. More... | |
typedef std::vector<unsigned char> alexaClientSDK::playlistParser::ByteVector |
Alias for bytes.
bool alexaClientSDK::playlistParser::getAbsoluteURLFromRelativePathToURL | ( | std::string | baseURL, |
std::string | relativePath, | ||
std::string * | absoluteURL | ||
) |
Creates an absolute url, given a base url and a relative path from that url. For example, if "www.awesomewebsite.com/music/test.m3u" was the base url and the relative path was "music.mp3", "www.awesomewebsite.com/music/music.mp3" would be returned.
baseURL | The base url to add the relative path to. | |
relativePath | The relative path to add to the base url. | |
[out] | absoluteURL | The absolute url generated |
true
If everything was successful and false
otherwise. bool alexaClientSDK::playlistParser::isPlaylistExtendedM3U | ( | const std::string & | playlistContent | ) |
Determines the playlist type of an M3U playlist.
playlistContent | The M3U playlist in std::string format. |
true
if the playlist is extended M3U or false
otherwise bool alexaClientSDK::playlistParser::isURLAbsolute | ( | const std::string & | url | ) |
Determines whether the provided url is an absolute url as opposed to a relative url. This is done by simply checking to see if the string contains the substring "://".
url | The url to check. |
true
if the url is an absolute url and false
otherwise. avsCommon::utils::playlistParser::ByteRange alexaClientSDK::playlistParser::parseHLSByteRangeLine | ( | const std::string & | line | ) |
Parses #EXT-X-BYTERANGE line of HLS playlist and returns ByteRange
.
line | The line to parse. |
ByteRange
- {start, end}. avsCommon::utils::playlistParser::EncryptionInfo alexaClientSDK::playlistParser::parseHLSEncryptionLine | ( | const std::string & | line, |
const std::string & | baseURL | ||
) |
Parses #EXT-X-KEY line of HLS playlist and returns EncryptionInfo
.
line | The line to parse. |
baseURL | The URL of the playlist. |
EncryptionInfo
. avsCommon::utils::playlistParser::PlaylistEntry alexaClientSDK::playlistParser::parseHLSMapLine | ( | const std::string & | line, |
const std::string & | baseURL | ||
) |
Parses #EXT-X-MAP line of HLS playlist and returns PlaylistEntry
.
line | The line to parse. |
baseURL | The url of the playlist. |
PlaylistEntry
. M3UContent alexaClientSDK::playlistParser::parseM3UContent | ( | const std::string & | playlistURL, |
const std::string & | content | ||
) |
Parses an M3U playlist and returns the "children" URLs in the order they appeared in the playlist.
playlistURL | The URL of the M3U playlist that needs to be parsed. |
content | Text content of the downloaded M3U playlist to parse. |
M3UContent
which contains parsed list of variant URLs (for master playlist) OR list of @ Playlist (for media playlist). long alexaClientSDK::playlistParser::parsePlaylistMediaSequence | ( | const std::string & | line | ) |
Helper method that parses the media sequence field. This method assumes that the line passed begins with the media sequence tag.
line | The line to be parsed. |
INVALID_MEDIA_SEQUENCE
if any issue happened during parsing. std::vector<std::string> alexaClientSDK::playlistParser::parsePLSContent | ( | const std::string & | playlistURL, |
const std::string & | content | ||
) |
Parses an PLS playlist and returns the "children" URLs in the order they appeared in the playlist.
content | The content to parse. |
bool alexaClientSDK::playlistParser::readFromContentFetcher | ( | std::unique_ptr< avsCommon::sdkInterfaces::HTTPContentFetcherInterface > | contentFetcher, |
std::string * | content, | ||
std::atomic< bool > * | shouldShutDown, | ||
std::string * | playlistURL | ||
) |
Retrieves playlist content and stores it into a string.
contentFetcher | Object used to retrieve url content. | |
[out] | content | The playlist content. |
shouldShutDown | A pointer to allow for the caller to cancel the content retrieval asynchronously | |
[out] | playlistURL | A pointer to the playlist url. This will be updated in case the last used URL to fetch the content is different. |
true
if no error occured or false
otherwise. void alexaClientSDK::playlistParser::removeCarriageReturnFromLine | ( | std::string * | line | ) |
Removes a carriage return from the end of a line. This is required to handle Windows style line breaks ('
'). std::getline reads by default up to '
' so at times, the '' may be included when readinglines.
line | The line to parse |
|
static |
An invalid media sequence number.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0