RDK Documentation (Open Sourced RDK Components)
|
Advanced Adaptive Media Player (AAMP) PrivateInstanceAAMP impl. More...
#include "isobmffprocessor.h"
#include "priv_aamp.h"
#include "AampJsonObject.h"
#include "isobmffbuffer.h"
#include "AampFnLogger.h"
#include "AampConstants.h"
#include "AampCacheHandler.h"
#include "AampUtils.h"
#include "iso639map.h"
#include "fragmentcollector_mpd.h"
#include "admanager_mpd.h"
#include "fragmentcollector_hls.h"
#include "fragmentcollector_progressive.h"
#include "MediaStreamContext.h"
#include "hdmiin_shim.h"
#include "compositein_shim.h"
#include "ota_shim.h"
#include "_base64.h"
#include "base16.h"
#include "aampgstplayer.h"
#include "AampDRMSessionManager.h"
#include "SubtecFactory.hpp"
#include "AampCurlStore.h"
#include <sys/time.h>
#include <cmath>
#include <regex>
#include <fstream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <uuid/uuid.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | gActivePrivAAMP_t |
Used for storing active PrivateInstanceAAMPs. More... | |
struct | CurlCbContextSyncTime |
context during curl callbacks More... | |
struct | _IARM_BUS_NetSrvMgr_Iface_EventData_t |
IARM Bus struct contains active streaming interface, origional definition present in homenetworkingservice.h. More... | |
union | _IARM_BUS_NetSrvMgr_Iface_EventData_t.__unnamed__ |
Macros | |
#define | LOCAL_HOST_IP "127.0.0.1" |
#define | AAMP_MAX_TIME_BW_UNDERFLOWS_TO_TRIGGER_RETUNE_MS (20*1000LL) |
#define | AAMP_MAX_TIME_LL_BW_UNDERFLOWS_TO_TRIGGER_RETUNE_MS (AAMP_MAX_TIME_BW_UNDERFLOWS_TO_TRIGGER_RETUNE_MS/10) |
#define | MAX_DESCRIPTION_SIZE 128 |
#define | MACRO_TO_STRING(s) X_STR(s) |
#define | X_STR(s) #s |
#define | TRUST_LOCATOR_EXTENSION_IF_PRESENT |
#define | VALIDATE_INT(param_name, param_value, default_value) |
#define | VALIDATE_LONG(param_name, param_value, default_value) |
#define | VALIDATE_DOUBLE(param_name, param_value, default_value) |
#define | CURL_EASY_SETOPT(curl, CURLoption, option) |
#define | FOG_REASON_STRING "Fog-Reason:" |
#define | CURLHEADER_X_REASON "X-Reason:" |
#define | BITRATE_HEADER_STRING "X-Bitrate:" |
#define | CONTENTLENGTH_STRING "Content-Length:" |
#define | SET_COOKIE_HEADER_STRING "Set-Cookie:" |
#define | LOCATION_HEADER_STRING "Location:" |
#define | CONTENT_ENCODING_STRING "Content-Encoding:" |
#define | FOG_RECORDING_ID_STRING "Fog-Recording-Id:" |
#define | CAPPED_PROFILE_STRING "Profile-Capped:" |
#define | TRANSFER_ENCODING_STRING "Transfer-Encoding:" |
#define | MAX_DOWNLOAD_DELAY_LIMIT_MS 30000 |
#define | BITRATEREASON2STRING(id) BITRATECHANGE_STR[id] |
#define | ADEVENT2STRING(id) ADEVENT_STR[id - AAMP_EVENT_AD_RESERVATION_START] |
#define | ONE_KILO 1024 |
#define | ONE_MEGA ((1024) * ONE_KILO) |
#define | WV_KID_WORKAROUND "SkyStoreDE=" |
Typedefs | |
typedef enum _NetworkManager_EventId_t | IARM_Bus_NetworkManager_EventId_t |
Enumeration for net_srv_mgr active interface event callback. | |
typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t | IARM_BUS_NetSrvMgr_Iface_EventData_t |
Enumerations | |
enum | _NetworkManager_EventId_t |
Enumeration for net_srv_mgr active interface event callback. | |
Functions | |
static guint | aamp_GetSourceID () |
Get the idle task's source ID. More... | |
static gboolean | PrivateInstanceAAMP_Resume (gpointer ptr) |
Idle task to resume aamp. More... | |
static gboolean | PrivateInstanceAAMP_ProcessDiscontinuity (gpointer ptr) |
Idle task to process discontinuity. More... | |
static gboolean | PrivateInstanceAAMP_Retune (gpointer ptr) |
Tune again to currently viewing asset. Used for internal error handling. More... | |
static void | SimulateLinearWindow (struct GrowableBuffer *buffer, const char *ptr, size_t len) |
Simulate VOD asset as a "virtual linear" stream. | |
static MediaTypeTelemetry | aamp_GetMediaTypeForTelemetry (MediaType type) |
Get the telemetry type for a media type. More... | |
static void | DeFog (std::string &url) |
de-fog playback URL to play directly from CDN instead of fog More... | |
static bool | replace (std::string &str, const char *existingSubStringToReplace, const char *replacementString) |
replace all occurrences of existingSubStringToReplace in str with replacementString More... | |
void | ForceHttpCoversionforFog (std::string &url, const std::string &from, const std::string &to) |
convert https to https in recordedUrl part of manifestUrl More... | |
static bool | IsActiveStreamingInterfaceWifi (void) |
Active streaming interface is wifi. More... | |
static int | ReadConfigStringHelper (std::string buf, const char *prefixPtr, const char **valueCopyPtr) |
helper function to avoid dependency on unsafe sscanf while reading strings More... | |
template<typename T > | |
static int | ReadConfigNumericHelper (std::string buf, const char *prefixPtr, T &value) |
helper function to extract numeric value from given buf after removing prefix More... | |
static std::string | getTimeStamp (time_t epochTime, const char *format="%Y-%m-%dT%H:%M:%S.%f%Z") |
static time_t | convertTimeToEpoch (const char *theTime, const char *format="%Y-%m-%dT%H:%M:%S.%f%Z") |
static size_t | SyncTime_write_callback (char *ptr, size_t size, size_t nmemb, void *userdata) |
write callback to be used by CURL More... | |
static size_t | write_callback (char *ptr, size_t size, size_t nmemb, void *userdata) |
write callback to be used by CURL More... | |
static void | print_headerResponse (std::vector< std::string > &allResponseHeadersForErrorLogging, MediaType fileType) |
function to print header response during download failure and latency. More... | |
char * | ConvertSpeedToStr (long bps, char *str) |
Convert to string and add suffix k, M, G. More... | |
long | getCurrentContentDownloadSpeed (PrivateInstanceAAMP *aamp, MediaType fileType, bool bDownloadStart, long start, double dlnow) |
Get Current Content Download Speed. More... | |
static int | progress_callback (void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) |
static gboolean | PrivateInstanceAAMP_PausePosition (gpointer ptr) |
perform pause of the pipeline and notifications for PauseAt functionality | |
static void * | PausePositionMonitor (void *arg) |
call the PausePositionMonitoring thread loop | |
static std::string | TrackTypeString (const int track) |
track description string from TrackType enum | |
static char * | createJsonData (TextTrackInfo &track) |
Create json data from track Info. | |
Variables | |
static long long | simulation_start |
static char * | full_playlist_video_ptr = NULL |
static size_t | full_playlist_video_len = 0 |
static char * | full_playlist_audio_ptr = NULL |
static size_t | full_playlist_audio_len = 0 |
static std::list< gActivePrivAAMP_t > | gActivePrivAAMPs = std::list<gActivePrivAAMP_t>() |
static pthread_mutex_t | gMutex = PTHREAD_MUTEX_INITIALIZER |
static pthread_cond_t | gCond = PTHREAD_COND_INITIALIZER |
static int | PLAYERID_CNTR = 0 |
static const char * | strAAMPPipeName = "/tmp/ipc_aamp" |
static bool | activeInterfaceWifi = false |
static char | previousInterface [20] = {'\0'} |
static unsigned int | ui32CurlTrace = 0 |
static TuneFailureMap | tuneFailureMap [] |
static constexpr const char * | BITRATECHANGE_STR [] |
static constexpr const char * | ADEVENT_STR [] |
static constexpr const char * | mMediaFormatName [] |
Advanced Adaptive Media Player (AAMP) PrivateInstanceAAMP impl.
Definition in file priv_aamp.cpp.
struct gActivePrivAAMP_t |
Used for storing active PrivateInstanceAAMPs.
Definition at line 142 of file priv_aamp.cpp.
Data Fields | ||
---|---|---|
PrivateInstanceAAMP * | pAAMP | |
bool | reTune | |
int | numPtsErrors |
#define VALIDATE_INT | ( | param_name, | |
param_value, | |||
default_value | |||
) |
Definition at line 91 of file priv_aamp.cpp.
#define VALIDATE_LONG | ( | param_name, | |
param_value, | |||
default_value | |||
) |
Definition at line 97 of file priv_aamp.cpp.
#define VALIDATE_DOUBLE | ( | param_name, | |
param_value, | |||
default_value | |||
) |
Definition at line 103 of file priv_aamp.cpp.
#define CURL_EASY_SETOPT | ( | curl, | |
CURLoption, | |||
option | |||
) |
Definition at line 109 of file priv_aamp.cpp.
|
static |
|
static |
Idle task to resume aamp.
ptr | pointer to PrivateInstanceAAMP object |
True/False |
Definition at line 300 of file priv_aamp.cpp.
|
static |
Idle task to process discontinuity.
ptr | pointer to PrivateInstanceAAMP object |
G_SOURCE_REMOVE |
Definition at line 341 of file priv_aamp.cpp.
|
static |
Tune again to currently viewing asset. Used for internal error handling.
ptr | pointer to PrivateInstanceAAMP object |
G_SOURCE_REMOVE |
Definition at line 367 of file priv_aamp.cpp.
|
static |
Get the telemetry type for a media type.
type | media type |
telemetry | type |
Definition at line 491 of file priv_aamp.cpp.
|
static |
de-fog playback URL to play directly from CDN instead of fog
[in] |
Definition at line 532 of file priv_aamp.cpp.
|
static |
replace all occurrences of existingSubStringToReplace in str with replacementString
str | string to be scanned/modified |
existingSubStringToReplace | substring to be replaced |
replacementString | string to be substituted |
true | iff str was modified |
Definition at line 556 of file priv_aamp.cpp.
void ForceHttpCoversionforFog | ( | std::string & | url, |
const std::string & | from, | ||
const std::string & | to | ||
) |
convert https to https in recordedUrl part of manifestUrl
[in] |
Definition at line 621 of file priv_aamp.cpp.
|
static |
Active streaming interface is wifi.
Definition at line 636 of file priv_aamp.cpp.
|
static |
helper function to avoid dependency on unsafe sscanf while reading strings
buf | pointer to CString buffer to scan |
prefixPtr | - prefix string to match in bufPtr |
valueCopyPtr | receives allocated copy of string following prefix (skipping delimiting whitesace) if prefix found |
0 | if prefix not present or error |
1 | if string extracted/copied to valueCopyPtr |
Definition at line 667 of file priv_aamp.cpp.
|
static |
helper function to extract numeric value from given buf after removing prefix
buf | String buffer to scan |
prefixPtr | - prefix string to match in bufPtr |
value | - receives numeric value after extraction |
0 | if prefix not present or error |
1 | if string converted to numeric value |
Definition at line 696 of file priv_aamp.cpp.
|
static |
write callback to be used by CURL
ptr | pointer to buffer containing the data |
size | size of the buffer |
nmemb | number of bytes |
userdata | CurlCallbackContext pointer |
size | consumed or 0 if interrupted |
Definition at line 755 of file priv_aamp.cpp.
|
static |
write callback to be used by CURL
ptr | pointer to buffer containing the data |
size | size of the buffer |
nmemb | number of bytes |
userdata | CurlCallbackContext pointer |
size | consumed or 0 if interrupted |
Definition at line 830 of file priv_aamp.cpp.
|
static |
function to print header response during download failure and latency.
fileType | current media type |
Definition at line 844 of file priv_aamp.cpp.
char* ConvertSpeedToStr | ( | long | bps, |
char * | str | ||
) |
Convert to string and add suffix k, M, G.
bps | bytes Speed |
str | ptr String buffer |
ptr | Converted String buffer |
Definition at line 1020 of file priv_aamp.cpp.
long getCurrentContentDownloadSpeed | ( | PrivateInstanceAAMP * | aamp, |
MediaType | fileType, | ||
bool | bDownloadStart, | ||
long | start, | ||
double | dlnow | ||
) |
Get Current Content Download Speed.
aamp | ptr aamp context |
fileType | File Type |
bDownloadStart | Download start flag |
start | Download start time |
dlnow | current downloaded bytes |
bps | bits per second |
Definition at line 1050 of file priv_aamp.cpp.
|
static |
clientp | app-specific as optionally set with CURLOPT_PROGRESSDATA |
dltotal | total bytes expected to download |
dlnow | downloaded bytes so far |
ultotal | total bytes expected to upload |
ulnow | uploaded bytes so far |
Definition at line 1260 of file priv_aamp.cpp.
|
static |
New state for treating a VOD asset as a "virtual linear" stream
Definition at line 131 of file priv_aamp.cpp.
|
staticconstexpr |
Definition at line 245 of file priv_aamp.cpp.
|
staticconstexpr |
Definition at line 262 of file priv_aamp.cpp.
|
staticconstexpr |
Definition at line 274 of file priv_aamp.cpp.