![]() |
AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Namespaces | |
test | |
Classes | |
class | ContentDecrypter |
struct | EVP_CIPHER_CTX_Deleter |
Unique ptr to auto release EVP_CIPHER_CTX. More... | |
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... | |
using | EVP_CIPHER_CTX_free_ptr = std::unique_ptr< EVP_CIPHER_CTX, EVP_CIPHER_CTX_Deleter > |
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) |
static const std::string | TAG ("ContentDecrypter") |
String to identify log entries originating from this file. More... | |
static const std::chrono::milliseconds | WRITE_TO_STREAM_TIMEOUT (100) |
Timeout for write to stream. More... | |
static const std::string | TAG ("Id3TagsRemover") |
static const std::size_t | CHUNK_SIZE (1024) |
The number of bytes read from the attachment with each read in the read loop. More... | |
static const std::string | TAG ("IterativePlaylistParser") |
String to identify log entries originating from this file. More... | |
static const std::string | TAG ("M3UParser") |
String to identify log entries originating from this file. More... | |
std::chrono::milliseconds | parseRuntime (const std::string &line) |
bool | getAbsoluteURL (const std::string &baseURL, const std::string &url, std::string *absoluteURL) |
bool | hasPrefix (const std::string &line, const std::string &prefix) |
static std::string | to16ByteHexString (int number) |
std::string | parseURIAttribute (const std::string &line, const std::string &baseURL) |
ByteRange | parseByteRange (const std::string &byteRange) |
static const std::string | TAG ("PlaylistParser") |
String to identify log entries originating from this file. More... | |
static const std::string | TAG ("PlaylistUtils") |
String to identify log entries originating from this file. More... | |
static const size_t | CHUNK_SIZE (1024) |
The number of bytes read from the attachment with each read in the read loop. More... | |
bool | readFromContentFetcher (std::unique_ptr< HTTPContentFetcherInterface > contentFetcher, std::string *content, std::atomic< bool > *shouldShutDown, std::string *playlistURL) |
static const std::string | TAG ("UrlContentToAttachmentConverter") |
String to identify log entries originating from this file. More... | |
static const size_t | CHUNK_SIZE (1024) |
The number of bytes read from the attachment with each read in the read loop. More... | |
Variables | |
static constexpr long | INVALID_MEDIA_SEQUENCE = -1 |
An invalid media sequence number. More... | |
static const int | AES_BLOCK_SIZE = 16 |
Block size of AES encrypted content. More... | |
static const int | IV_HEX_STRING_LENGTH = 2 * AES_BLOCK_SIZE |
Length of initilization vector as hex string. More... | |
static const std::chrono::milliseconds | WAIT_FOR_ACTIVITY_TIMEOUT {100} |
Timeout for polling loops that check activity between read or write. More... | |
static const std::string | M3U_CONTENT_TYPE = "mpegurl" |
The HTML content-type of an M3U playlist. More... | |
static const std::string | PLS_CONTENT_TYPE = "scpls" |
The HTML content-type of a PLS playlist. More... | |
static const auto | INVALID_DURATION = std::chrono::milliseconds(-1) |
An invalid duration. More... | |
static const std::string | EXT_M3U_PLAYLIST_HEADER = "#EXTM3U" |
The first line of an Extended M3U playlist. More... | |
static const std::string | EXTXMEDIASEQUENCE = "#EXT-X-MEDIA-SEQUENCE:" |
The key to identify the media sequence tag. More... | |
static const std::string | EXTINF = "#EXTINF" |
HLS EXTINF tag. More... | |
static const std::string | EXTSTREAMINF = "#EXT-X-STREAM-INF" |
static const std::string | ENDLIST = "#EXT-X-ENDLIST" |
static const std::string | EXT_KEY = "#EXT-X-KEY:" |
EXT-X-KEY HLS tag. More... | |
static const std::string | EXT_MAP = "#EXT-X-MAP:" |
EXT-X-MAP HLS tag. More... | |
static const std::string | EXT_BYTERANGE = "#EXT-X-BYTERANGE:" |
EXT-X-BYTERANGE HLS tag. More... | |
static const std::string | METHOD_ATTR = "METHOD=" |
Method encryption attribute. More... | |
static const std::string | URI_ATTR = "URI=\"" |
HLS tag attribute for URI. More... | |
static const std::string | IV_ATTR = "IV=" |
Initialization Vector encryption attribute. More... | |
static const std::string | BYTERANGE_ATTR = "BYTERANGE=\"" |
Byte range encryption attribute. More... | |
static const std::string | ENCRYPTION_METHOD_NONE = "NONE" |
Encryption method: NONE. More... | |
static const std::string | ENCRYPTION_METHOD_AES_128 = "AES-128" |
Encryption method: AES-128. More... | |
static const std::string | ENCRYPTION_METHOD_SAMPLE_AES = "SAMPLE-AES" |
Encryption method: SAMPLE-AES. More... | |
static const auto | INVALID_DURATION = std::chrono::milliseconds(-1) |
An invalid duration. More... | |
static const int | IV_HEX_STRING_LENGTH = 32 |
Length of initialization vector as hex string. More... | |
static const std::string | M3U_CONTENT_TYPE = "mpegurl" |
The HTML content-type of an M3U playlist. More... | |
static const std::string | PLS_CONTENT_TYPE = "scpls" |
The HTML content-type of a PLS playlist. More... | |
static int | g_id = 0 |
The id of each request. More... | |
static const auto | INVALID_DURATION = std::chrono::milliseconds(-1) |
An invalid duration. More... | |
static const std::string | PLS_FILE = "File" |
The beginning of a line in a PLS file indicating a URL. More... | |
static const std::string | URL_END_SCHEME_PATTERN = "://" |
url scheme pattern. More... | |
static const std::chrono::milliseconds | WAIT_FOR_ACTIVITY_TIMEOUT {100} |
A wait period for a polling loop that constantly check if a content fetcher finished fetching the payload or failed. More... | |
static const std::string | PROCESS_ATTACHMENT_ID = "download:" |
Process attachment ID. More... | |
static const std::chrono::minutes | PLAYLIST_FETCH_TIMEOUT {5} |
Timeout to wait for a playlist to arrive from the content fetcher. More... | |
static const std::chrono::milliseconds | INVALID_DURATION = std::chrono::milliseconds(-1) |
An invalid duration. More... | |
static const std::chrono::milliseconds | WAIT_FOR_ACTIVITY_TIMEOUT {100} |
Timeout for polling loops that check activities running on separate threads. More... | |
typedef std::vector<unsigned char> alexaClientSDK::playlistParser::ByteVector |
Alias for bytes.
using alexaClientSDK::playlistParser::EVP_CIPHER_CTX_free_ptr = typedef std::unique_ptr<EVP_CIPHER_CTX, EVP_CIPHER_CTX_Deleter> |
|
static |
The number of bytes read from the attachment with each read in the read loop.
|
static |
The number of bytes read from the attachment with each read in the read loop.
|
static |
The number of bytes read from the attachment with each read in the read loop.
bool alexaClientSDK::playlistParser::getAbsoluteURL | ( | const std::string & | baseURL, |
const std::string & | url, | ||
std::string * | absoluteURL | ||
) |
Helper method to convert a line in HLS playlist to absolute URL.
baseURL | The URL of the HLS playlist. | |
url | The URL found in HLS playlist. | |
[out] | absoluteURL | Absolute URL parsed from line and converted to an absolute URL. |
true
if method is successful or false
otherwise. 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.
|
inline |
Helper method to check if line starts with prefix.
line | A HLS line. |
prefix | The prefix to check. |
true
if line
starts with prefix
, 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. ByteRange alexaClientSDK::playlistParser::parseByteRange | ( | const std::string & | byteRange | ) |
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}. 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
. 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. |
std::chrono::milliseconds alexaClientSDK::playlistParser::parseRuntime | ( | const std::string & | line | ) |
std::string alexaClientSDK::playlistParser::parseURIAttribute | ( | const std::string & | line, |
const std::string & | baseURL | ||
) |
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. bool alexaClientSDK::playlistParser::readFromContentFetcher | ( | std::unique_ptr< HTTPContentFetcherInterface > | contentFetcher, |
std::string * | content, | ||
std::atomic< bool > * | shouldShutDown, | ||
std::string * | playlistURL | ||
) |
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 ('\r
'). std::getline reads by default up to '
' so at times, the '\r' may be included when readinglines.
line | The line to parse |
|
static |
String to identify log entries originating from this file.
|
static |
|
static |
String to identify log entries originating from this file.
|
static |
String to identify log entries originating from this file.
|
static |
String to identify log entries originating from this file.
|
static |
String to identify log entries originating from this file.
|
static |
String to identify log entries originating from this file.
|
static |
|
static |
Timeout for write to stream.
|
static |
Block size of AES encrypted content.
|
static |
Byte range encryption attribute.
|
static |
Encryption method: AES-128.
|
static |
Encryption method: NONE.
|
static |
Encryption method: SAMPLE-AES.
|
static |
A tag present in a live stream playlist indicating that no more URLs will be added to the playlist on subsequent requests.
|
static |
EXT-X-BYTERANGE HLS tag.
|
static |
EXT-X-KEY HLS tag.
|
static |
The first line of an Extended M3U playlist.
|
static |
EXT-X-MAP HLS tag.
|
static |
HLS EXTINF tag.
|
static |
A tag present in a live stream playlist that indicates that the next URL points to a playlist. Attributes of this tag include information such as bitrate, codecs, and others.
|
static |
The key to identify the media sequence tag.
|
static |
The id of each request.
|
static |
An invalid duration.
|
static |
An invalid duration.
|
static |
An invalid duration.
|
static |
An invalid duration.
|
staticconstexpr |
An invalid media sequence number.
|
static |
Initialization Vector encryption attribute.
|
static |
Length of initilization vector as hex string.
|
static |
Length of initialization vector as hex string.
|
static |
The HTML content-type of an M3U playlist.
|
static |
The HTML content-type of an M3U playlist.
|
static |
Method encryption attribute.
|
static |
Timeout to wait for a playlist to arrive from the content fetcher.
|
static |
The HTML content-type of a PLS playlist.
|
static |
The HTML content-type of a PLS playlist.
|
static |
The beginning of a line in a PLS file indicating a URL.
|
static |
Process attachment ID.
|
static |
HLS tag attribute for URI.
|
static |
url scheme pattern.
|
static |
Timeout for polling loops that check activity between read or write.
|
static |
Timeout for polling loops that check activities running on separate threads.
|
static |
A wait period for a polling loop that constantly check if a content fetcher finished fetching the payload or failed.
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0