|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
28 #include "libIBusDaemon.h"
35 #include "AampUtils.h"
36 #ifdef AAMP_CC_ENABLED
55 #define ERROR_STATE_CHECK_VOID() \
56 PrivAAMPState state = GetState(); \
57 if( state == eSTATE_ERROR){ \
58 AAMPLOG_WARN("operation is not allowed when player in eSTATE_ERROR state !");\
62 #define ERROR_STATE_CHECK_VAL(val) \
63 PrivAAMPState state = GetState(); \
64 if( state == eSTATE_ERROR){ \
65 AAMPLOG_WARN("operation is not allowed when player in eSTATE_ERROR state !");\
69 #define ERROR_OR_IDLE_STATE_CHECK_VOID() \
70 PrivAAMPState state = GetState(); \
71 if( state == eSTATE_ERROR || state == eSTATE_IDLE){ \
72 AAMPLOG_WARN("operation is not allowed when player in %s state !",\
73 (state == eSTATE_ERROR) ? "eSTATE_ERROR" : "eSTATE_IDLE" );\
77 #define NOT_IDLE_AND_NOT_RELEASED_STATE_CHECK_VOID() \
78 PrivAAMPState state = GetState(); \
79 if( state != eSTATE_IDLE && state != eSTATE_RELEASED){ \
80 AAMPLOG_WARN("operation is not allowed when player not in eSTATE_IDLE or eSTATE_RELEASED state !");\
84 #define ERROR_OR_IDLE_STATE_CHECK_VAL(val) \
85 PrivAAMPState state = GetState(); \
86 if( state == eSTATE_ERROR || state == eSTATE_IDLE){ \
87 AAMPLOG_WARN("operation is not allowed in %s state !",\
88 (state == eSTATE_ERROR) ? "eSTATE_ERROR" : "eSTATE_IDLE" );\
92 #define PLAYING_STATE_CHECK() \
93 PrivAAMPState state = GetState(); \
94 if( state != eSTATE_STOPPED && state != eSTATE_IDLE && state != eSTATE_COMPLETE && state != eSTATE_RELEASED){ \
95 AAMPLOG_WARN("Operation is not allowed when player in playing state !!");\
99 static bool iarmInitialized =
false;
106 , std::function<
void(uint8_t *,
int,
int,
int) > exportFrames
107 ) : aamp(NULL), sp_aamp(nullptr), mInternalStreamSink(NULL), mJSBinding_DL(),mAsyncRunning(false),mConfig(),mAsyncTuneEnabled(false),mScheduler()
113 char processName[20] = {0};
114 IARM_Result_t result;
115 snprintf(processName,
sizeof(processName),
"AAMP-PLAYER-%u", getpid());
116 if (IARM_RESULT_SUCCESS == (result =
IARM_Bus_Init((
const char*) &processName))) {
117 logprintf(
"IARM Interface Inited in AAMP");
120 logprintf(
"IARM Interface Inited Externally : %d", result);
124 logprintf(
"IARM Interface Connected in AAMP");
127 logprintf (
"IARM Interface Connected Externally :%d", result);
129 iarmInitialized =
true;
133 #ifdef SUPPORT_JS_EVENTS
134 #ifdef AAMP_WPEWEBKIT_JSBINDINGS //aamp_LoadJS defined in libaampjsbindings.so
135 const char* szJSLib =
"libaampjsbindings.so";
137 const char* szJSLib =
"libaamp.so";
147 #ifdef AAMP_BUILD_INFO
148 std::string tmpstr = MACRO_TO_STRING(AAMP_BUILD_INFO);
149 logprintf(
" AAMP_BUILD_INFO: %s",tmpstr.c_str());
155 AAMPLOG_WARN(
"[AAMP_JS][%p]Creating GlobalConfig Instance[%p]",
this,
gpGlobalConfig);
170 sp_aamp = std::make_shared<PrivateInstanceAAMP>(&mConfig);
172 mLogObj = mConfig.GetLoggerInstance();
178 if (NULL == streamSink)
181 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
206 #ifdef AAMP_CC_ENABLED
234 #ifdef AAMP_CC_ENABLED
235 if (isLastPlayerInstance)
240 #ifdef SUPPORT_JS_EVENTS
247 #ifdef USE_SECMANAGER
248 if (isLastPlayerInstance)
255 AAMPLOG_WARN(
"[%p] Release GlobalConfig(%p)",
this,
gpGlobalConfig);
266 AAMPLOG_WARN(
"Resetting Configuration to default values ");
270 mLogObj = mConfig.GetLoggerInstance();
271 #ifdef AAMP_CC_ENABLED
312 void PlayerInstanceAAMP::Tune(
const char *mainManifestUrl,
const char *contentType,
bool bFirstAttempt,
bool bFinalAttempt,
const char *traceUUID,
bool audioDecoderStreamSync)
314 Tune(mainManifestUrl,
true, contentType,bFirstAttempt,bFinalAttempt,traceUUID,audioDecoderStreamSync);
320 void PlayerInstanceAAMP::Tune(
const char *mainManifestUrl,
bool autoPlay,
const char *contentType,
bool bFirstAttempt,
bool bFinalAttempt,
const char *traceUUID,
bool audioDecoderStreamSync)
327 const std::string manifest {mainManifestUrl};
328 const std::string cType = (contentType != NULL) ? std::string(contentType) : std::string();
329 const std::string sTraceUUID = (traceUUID != NULL)? std::string(traceUUID) : std::string();
332 [manifest, autoPlay , cType, bFirstAttempt, bFinalAttempt, sTraceUUID, audioDecoderStreamSync](
void *data)
335 const char * trace_uuid = sTraceUUID.empty() ?
nullptr : sTraceUUID.c_str();
337 instance->
TuneInternal(manifest.c_str(), autoPlay, cType.c_str(), bFirstAttempt, bFinalAttempt, trace_uuid, audioDecoderStreamSync);
344 TuneInternal(mainManifestUrl, autoPlay , contentType, bFirstAttempt, bFinalAttempt,traceUUID,audioDecoderStreamSync);
351 void PlayerInstanceAAMP::TuneInternal(
const char *mainManifestUrl,
bool autoPlay,
const char *contentType,
bool bFirstAttempt,
bool bFinalAttempt,
const char *traceUUID,
bool audioDecoderStreamSync)
359 bool IsOTAtoOTA =
false;
364 std::string urlStr(mainManifestUrl);
365 if((urlStr.rfind(
"live:",0)==0) || (urlStr.rfind(
"tune:",0)==0))
377 aamp->
Tune(mainManifestUrl, autoPlay, contentType, bFirstAttempt, bFinalAttempt,traceUUID,audioDecoderStreamSync);
437 NOT_IDLE_AND_NOT_RELEASED_STATE_CHECK_VOID();
438 SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_InitialBuffer,durationSec);
447 GETCONFIGVALUE(eAAMPConfig_InitialBuffer,durationSec);
486 AAMPLOG_WARN(
"SetLanguageFormat bDescriptiveAudioTrack deprecated!" );
498 AAMPLOG_INFO(
"Setting minimum bitrate: %ld", bitrate);
503 AAMPLOG_WARN(
"Invalid bitrate value %ld", bitrate);
525 AAMPLOG_INFO(
"Setting maximum bitrate : %ld", bitrate);
530 AAMPLOG_WARN(
"Invalid bitrate value %ld", bitrate);
549 bool retValue =
false;
550 if (abs(rate) <= AAMP_RATE_TRICKPLAY_MAX)
563 AAMPLOG_INFO(
"PLAYER[%d] rate=%f.",
aamp->mPlayerId, rate);
568 AAMPLOG_WARN(
"SetRate ignored!! Invalid rate (%f)", rate);
578 }, (
void *)
this,__FUNCTION__));
593 AAMPLOG_INFO(
"PLAYER[%d] rate=%f.",
aamp->mPlayerId, rate);
595 ERROR_STATE_CHECK_VOID();
599 AAMPLOG_WARN(
"SetRate ignored!! Invalid rate (%f)", rate);
605 AAMPLOG_WARN(
"mRepairIframes is true, setting actual rate %f for the received rate %f",
getWorkingTrickplayRate(rate), rate);
615 AAMPLOG_WARN(
"Ignoring trickplay. No iframe tracks in stream");
621 AAMPLOG_WARN(
"PLAYER[%d] Player %s=>%s.",
aamp->mPlayerId, STRBGPLAYER, STRFGPLAYER );
623 if (AAMP_NORMAL_PLAY_RATE == rate)
634 else if(AAMP_RATE_PAUSE != rate)
636 AAMPLOG_INFO(
"Player switched at trickplay %f", rate);
640 bool retValue =
true;
643 AAMPLOG_WARN(
"Already at logical live point, hence skipping operation");
652 AAMPLOG_WARN(
"Already running at playback rate(%f) pipeline_paused(%d), hence skipping set rate for (%f)",
aamp->
rate,
aamp->
pipeline_paused, rate);
671 const auto SeekInfo =
aamp->mNewSeekInfo.
GetInfo();
684 if(!SeekInfo.isPositionValid(seek_pos_seconds_copy))
686 AAMPLOG_WARN(
"Cached seek position (%f) is invalid. seek_pos_seconds = %f, seek_pos_seconds @ last report = %f.",SeekInfo.getPosition(), seek_pos_seconds_copy, SeekInfo.getSeekPositionSec());
690 double newSeekPosInSec = -1;
694 newSeekPosInSec = (SeekInfo.getPosition()/1000);
698 if(timeDeltaFromProgReport > 950)
701 newSeekPosInSec = (SeekInfo.getPosition()+(
aamp->
rate*1000))/1000;
703 else if(timeDeltaFromProgReport > 100)
706 newSeekPosInSec = SeekInfo.getPosition()/1000;
711 newSeekPosInSec = (SeekInfo.getPosition()-(
aamp->
rate*1000))/1000;
715 if (newSeekPosInSec >= 0)
726 AAMPLOG_WARN(
"new seek_pos_seconds calculated is invalid(%f), discarding it!", newSeekPosInSec);
737 aamp->trickStartUTCMS = -1;
747 aamp->trickStartUTCMS = -1;
751 if( AAMP_SLOWMOTION_RATE == rate )
760 AAMPLOG_WARN(
"aamp_SetRate (%f)overshoot(%d) ProgressReportDelta:(%d) ", rate,overshootcorrection,timeDeltaFromProgReport);
773 retValue =
aamp->mStreamSink->
Pause(
false,
false);
786 retValue =
aamp->mStreamSink->
Pause(
true,
false);
812 aamp->mSetPlayerRateAfterFirstframe=
false;
847 }, (
void *)
this,__FUNCTION__));
861 AAMPLOG_WARN(
"PLAYER[%d] aamp_PauseAt position=%f",
aamp->mPlayerId, position);
863 ERROR_STATE_CHECK_VOID();
875 AAMPLOG_WARN(
"PauseAt called when already paused");
880 static gboolean SeekAfterPrepared(gpointer ptr)
883 bool sentSpeedChangedEv =
false;
884 bool isSeekToLiveOrEnd =
false;
889 AAMPLOG_WARN(
"operation is not allowed when player in eSTATE_ERROR state !");\
895 isSeekToLiveOrEnd =
true;
898 AAMPLOG_WARN(
"aamp_Seek(%f) and seekToLiveOrEnd(%d)", aamp->
seek_pos_seconds, isSeekToLiveOrEnd);
900 if (isSeekToLiveOrEnd)
917 AAMPLOG_WARN(
"Already at live point, skipping operation since requested position(%f) >= currPosition(%f) or seekToLive(%d)", aamp->
seek_pos_seconds, currPositionSecs, isSeekToLiveOrEnd);
927 AAMPLOG_WARN(
"paused state, so resume downloads");
930 sentSpeedChangedEv =
true;
935 AAMPLOG_WARN(
"tune type is SEEK");
937 if (aamp->
rate != AAMP_NORMAL_PLAY_RATE)
939 aamp->
rate = AAMP_NORMAL_PLAY_RATE;
940 sentSpeedChangedEv =
true;
951 aamp->mSetPlayerRateAfterFirstframe=
false;
954 if(PositionMilisecondLocked)
959 if (sentSpeedChangedEv)
982 instance->
SeekInternal(secondsRelativeToTuneTime,keepPaused);
983 }, (
void *)
this,__FUNCTION__));
998 bool sentSpeedChangedEv =
false;
999 bool isSeekToLiveOrEnd =
false;
1002 ERROR_STATE_CHECK_VOID();
1008 AAMPLOG_WARN(
"aamp_Seek(%f) at the middle of tune, no fragments downloaded yet.state(%d), keep paused(%d)", secondsRelativeToTuneTime,state, keepPaused);
1014 AAMPLOG_WARN(
"aamp_Seek(%f) will be called after preparing the content.state(%d), keep paused(%d)", secondsRelativeToTuneTime,state, keepPaused);
1017 g_idle_add(SeekAfterPrepared, (gpointer)
aamp);
1021 if (secondsRelativeToTuneTime == AAMP_SEEK_TO_LIVE_POSITION)
1023 isSeekToLiveOrEnd =
true;
1026 AAMPLOG_WARN(
"aamp_Seek(%f) and seekToLiveOrEnd(%d) state(%d), keep paused(%d)", secondsRelativeToTuneTime, isSeekToLiveOrEnd,state, keepPaused);
1028 if (isSeekToLiveOrEnd)
1046 AAMPLOG_WARN(
"aamp_Seek position adjusted to absolute value for TSB : %lf", secondsRelativeToTuneTime);
1055 AAMPLOG_WARN(
"Already at live point, skipping operation since requested position(%f) >= currPosition(%f) or seekToLive(%d)", secondsRelativeToTuneTime, currPositionSecs, isSeekToLiveOrEnd);
1061 bool seekWhilePause =
false;
1071 seekWhilePause =
true;
1076 if (!seekWhilePause)
1078 AAMPLOG_WARN(
"Clearing paused flag");
1080 sentSpeedChangedEv =
true;
1083 AAMPLOG_INFO(
"Resuming downloads");
1103 if (
aamp->
rate != AAMP_NORMAL_PLAY_RATE)
1105 aamp->
rate = AAMP_NORMAL_PLAY_RATE;
1106 sentSpeedChangedEv =
true;
1115 if(PositionMilisecondLocked)
1120 aamp->mSetPlayerRateAfterFirstframe=
false;
1124 if (sentSpeedChangedEv && (!seekWhilePause) )
1129 else if(PositionMilisecondLocked)
1154 instance->
SeekInternal(AAMP_SEEK_TO_LIVE_POSITION, keepPaused);
1155 }, (
void *)
this,__FUNCTION__));
1169 ERROR_OR_IDLE_STATE_CHECK_VOID();
1170 AAMPLOG_WARN(
"SetSlowMotionPlay(%f)", rate );
1181 if(AAMP_SLOWMOTION_RATE == rate)
1183 aamp->mSetPlayerRateAfterFirstframe=
true;
1184 aamp->playerrate=rate;
1189 aamp->
rate = AAMP_NORMAL_PLAY_RATE;
1206 ERROR_OR_IDLE_STATE_CHECK_VOID();
1207 AAMPLOG_WARN(
"aamp_SetRateAndSeek(%d)(%f)", rate, secondsRelativeToTuneTime);
1210 AAMPLOG_WARN(
"SetRate ignored!! Invalid rate (%d)", rate);
1217 AAMPLOG_WARN(
"mRepairIframes is true, setting actual rate %f for the received rate %d",
getWorkingTrickplayRate(rate), rate);
1221 if (secondsRelativeToTuneTime == AAMP_SEEK_TO_LIVE_POSITION)
1237 AAMPLOG_WARN(
"Ignoring trickplay. No iframe tracks in stream");
1242 aamp->mSetPlayerRateAfterFirstframe=
false;
1256 bool retValue =
aamp->mStreamSink->
Pause(
true,
false);
1272 ERROR_STATE_CHECK_VOID();
1284 ERROR_STATE_CHECK_VOID();
1286 aamp->zoom_mode = zoom;
1294 AAMPLOG_WARN(
"Player is in state (eSTATE_IDLE), value has been cached");
1305 ERROR_STATE_CHECK_VOID();
1307 AAMPLOG_WARN(
" mute == %s subtitles_muted == %s", muted?
"true":
"false",
aamp->subtitles_muted?
"true":
"false");
1308 aamp->video_muted = muted;
1320 AAMPLOG_WARN(
"Player is in state eSTATE_IDLE, value has been cached");
1327 AAMPLOG_WARN(
"StreamLock is not available, value has been cached");
1340 ERROR_STATE_CHECK_VOID();
1342 AAMPLOG_WARN(
" mute == %s", muted?
"true":
"false");
1343 aamp->subtitles_muted = muted;
1351 AAMPLOG_WARN(
"Player is in state eSTATE_IDLE, value has been cached");
1363 ERROR_STATE_CHECK_VOID();
1364 AAMPLOG_WARN(
" volume == %d", volume);
1368 AAMPLOG_WARN(
"Audio level (%d) is outside the range supported.. discarding it..",
1371 else if (
aamp != NULL)
1373 aamp->audio_volume = volume;
1380 AAMPLOG_WARN(
"Player is in state eSTATE_IDLE, value has been cached");
1391 ERROR_STATE_CHECK_VOID();
1397 std::string sLanguage = std::string(language);
1399 [sLanguage](
void *data)
1403 }, (
void *)
this,__FUNCTION__));
1417 ERROR_STATE_CHECK_VOID();
1419 aamp->subscribedTags = subscribedTags;
1421 for (
int i=0; i <
aamp->subscribedTags.size(); i++) {
1422 AAMPLOG_WARN(
" subscribedTags[%d] = '%s'", i, subscribedTags.at(i).data());
1432 ERROR_STATE_CHECK_VOID();
1435 aamp->responseHeaders = responseHeaders;
1437 for (
int header=0; header <
aamp->responseHeaders.size(); header++) {
1438 AAMPLOG_INFO(
" responseHeaders[%d] = '%s'", header, responseHeaders.at(header).data());
1443 #ifdef SUPPORT_JS_EVENTS
1450 AAMPLOG_WARN(
"[AAMP_JS] (%p)", context);
1452 void(*loadJS)(
void*,
void*);
1453 const char* szLoadJS =
"aamp_LoadJS";
1454 loadJS = (void(*)(
void*,
void*))dlsym(
mJSBinding_DL, szLoadJS);
1456 AAMPLOG_WARN(
"[AAMP_JS] dlsym(%p, \"%s\")=%p",
mJSBinding_DL, szLoadJS, loadJS);
1457 loadJS(context,
this);
1467 AAMPLOG_WARN(
"[AAMP_JS] (%p)", context);
1469 void(*unloadJS)(
void*);
1470 const char* szUnloadJS =
"aamp_UnloadJS";
1471 unloadJS = (void(*)(
void*))dlsym(
mJSBinding_DL, szUnloadJS);
1473 AAMPLOG_WARN(
"[AAMP_JS] dlsym(%p, \"%s\")=%p",
mJSBinding_DL, szUnloadJS, unloadJS);
1505 ERROR_OR_IDLE_STATE_CHECK_VAL(
false);
1506 bool isLive =
false;
1525 ERROR_OR_IDLE_STATE_CHECK_VAL(
"");
1526 static char lang[MAX_LANGUAGE_TAG_LENGTH];
1534 if (!trackInfo.empty())
1536 strncpy(lang, trackInfo[trackIndex].language.c_str(),
sizeof(lang));
1537 lang[
sizeof(lang)-1] =
'\0';
1549 ERROR_OR_IDLE_STATE_CHECK_VAL(
"");
1554 return helper->friendlyName().c_str();
1565 ERROR_STATE_CHECK_VOID();
1568 for(
auto &header : pageHeaders)
1570 AAMPLOG_INFO(
"PrivateInstanceAAMP: applying the http header key: %s, value: %s", header.first.c_str(), header.second.c_str());
1581 ERROR_STATE_CHECK_VOID();
1592 ERROR_STATE_CHECK_VOID();
1612 AAMPLOG_ERR(
"PlayerInstanceAAMP:: invalid drm type(%d) received.", type);
1622 ERROR_STATE_CHECK_VOID();
1639 ERROR_STATE_CHECK_VOID();
1648 ERROR_STATE_CHECK_VOID();
1657 ERROR_STATE_CHECK_VOID();
1666 PLAYING_STATE_CHECK();
1676 PLAYING_STATE_CHECK();
1686 ERROR_STATE_CHECK_VOID();
1687 SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_StallErrorCode,errorCode);
1695 ERROR_STATE_CHECK_VOID();
1696 SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_StallTimeoutMS,timeoutMS);
1704 ERROR_STATE_CHECK_VOID();
1705 if(reportInterval > 0)
1708 double dReportInterval = reportInterval;
1709 dReportInterval /= 1000;
1731 ERROR_STATE_CHECK_VAL(0.00);
1740 ERROR_OR_IDLE_STATE_CHECK_VAL(0.00);
1756 iPlayerId =
aamp->mPlayerId;
1773 throw std::invalid_argument(
"NULL reference");
1777 catch (std::exception &e)
1779 AAMPLOG_WARN(
"Invalid access to the instance of PrivateInstanceAAMP (%s), returning %s as current state", e.what(),
"eSTATE_RELEASED");
1781 return currentState;
1790 ERROR_OR_IDLE_STATE_CHECK_VAL(0);
1816 long gpDefaultBitRate;
1819 AAMPLOG_WARN(
"Resetting default bitrate to %ld", gpDefaultBitRate);
1828 ERROR_OR_IDLE_STATE_CHECK_VAL(0);
1854 ERROR_STATE_CHECK_VAL(0);
1855 return aamp->zoom_mode;
1863 ERROR_STATE_CHECK_VAL(0);
1864 return aamp->video_muted;
1872 ERROR_STATE_CHECK_VAL(0);
1875 AAMPLOG_WARN(
" GetAudioVolume is returning cached value since player is at %s",
1878 return aamp->audio_volume;
1886 ERROR_OR_IDLE_STATE_CHECK_VAL(0);
1895 ERROR_OR_IDLE_STATE_CHECK_VAL(std::vector<long>());
1896 std::vector<long> bitrates;
1913 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
1919 memset(&manifest, 0,
sizeof(manifest));
1923 std::string Manifest(manifest.
ptr,manifest.
len);
1925 AAMPLOG_INFO(
"PlayerInstanceAAMP: manifest retrieved from cache");
1937 ERROR_OR_IDLE_STATE_CHECK_VAL(std::vector<long>());
1938 std::vector<long> bitrates;
1955 ERROR_STATE_CHECK_VOID();
1974 ERROR_STATE_CHECK_VOID();
1993 ERROR_STATE_CHECK_VOID();
2002 ERROR_STATE_CHECK_VOID();
2011 ERROR_STATE_CHECK_VOID();
2020 ERROR_STATE_CHECK_VOID();
2029 ERROR_STATE_CHECK_VOID();
2033 aamp->isPreferredDRMConfigured =
true;
2037 aamp->isPreferredDRMConfigured =
false;
2046 ERROR_STATE_CHECK_VOID();
2071 ERROR_STATE_CHECK_VOID();
2081 ERROR_STATE_CHECK_VOID();
2090 ERROR_STATE_CHECK_VOID();
2099 ERROR_STATE_CHECK_VOID();
2108 ERROR_OR_IDLE_STATE_CHECK_VOID();
2117 ERROR_STATE_CHECK_VOID();
2126 ERROR_STATE_CHECK_VOID();
2135 ERROR_STATE_CHECK_VOID();
2136 if( stallTimeout >= 0 )
2147 ERROR_STATE_CHECK_VOID();
2148 if( startTimeout >= 0 )
2159 ERROR_STATE_CHECK_VOID();
2160 if( lowBWTimeout >= 0 )
2171 ERROR_STATE_CHECK_VOID();
2172 AAMPLOG_WARN(
"PlayerInstanceAAMP::(%s)->(%s)",
aamp->mSubLanguage.c_str(), language);
2174 if (
aamp->mSubLanguage.compare(language) == 0)
2180 AAMPLOG_WARN(
"PlayerInstanceAAMP:: \"%s\" language set prior to tune start", language);
2184 AAMPLOG_WARN(
"PlayerInstanceAAMP:: \"%s\" language set - will take effect on next tune", language);
2194 ERROR_STATE_CHECK_VOID();
2203 ERROR_STATE_CHECK_VOID();
2220 ERROR_STATE_CHECK_VOID();
2264 if( DownloadDelayInMs <= MAX_DOWNLOAD_DELAY_LIMIT_MS )
2266 SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DownloadDelay,(
int)DownloadDelayInMs);
2290 [language,rendition,type,codec,channel, label](
void *data)
2294 }, (
void *)
this,__FUNCTION__));
2309 aamp->
mAudioTuple.setAudioTrackTuple(language, rendition, codec, channel);
2312 rendition.empty()?NULL:rendition.c_str(),
2313 type.empty()?NULL:type.c_str(),
2314 codec.empty()?NULL:codec.c_str(),
2315 label.empty()?NULL:label.c_str());
2412 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2430 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2440 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2450 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2462 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2472 ERROR_STATE_CHECK_VAL(std::string());
2474 return aamp->GetVideoRectangle();
2490 #ifdef AAMP_CC_ENABLED
2516 AAMPLOG_WARN(
"Skipping the configuration value[%d], since westerossink is disabled", rectProperty);
2530 ERROR_OR_IDLE_STATE_CHECK_VOID();
2534 if (!tracks.empty() && (trackId >= 0 && trackId < tracks.size()))
2539 [tracks , trackId](
void *data)
2542 instance->
SetPreferredLanguages(tracks[trackId].language.c_str(), tracks[trackId].rendition.c_str(), tracks[trackId].accessibilityType.c_str(), tracks[trackId].codec.c_str(), tracks[trackId].label.c_str());
2543 }, (
void *)
this,__FUNCTION__));
2547 SetPreferredLanguages(tracks[trackId].language.c_str(), tracks[trackId].rendition.c_str(), tracks[trackId].accessibilityType.c_str(), tracks[trackId].codec.c_str(), tracks[trackId].label.c_str());
2558 ERROR_OR_IDLE_STATE_CHECK_VAL(-1);
2568 ERROR_OR_IDLE_STATE_CHECK_VOID();
2573 AAMPLOG_INFO(
"trackId: %d tracks size %lu", trackId, tracks.size());
2574 if (!tracks.empty() && (MUTE_SUBTITLES_TRACKID == trackId || (trackId >= 0 && trackId < tracks.size())))
2579 [trackId, ccData ](
void *data)
2583 }, (
void *)
this,__FUNCTION__));
2612 ERROR_OR_IDLE_STATE_CHECK_VAL(-1);
2622 ERROR_STATE_CHECK_VOID();
2640 ERROR_STATE_CHECK_VOID();
2650 ERROR_STATE_CHECK_VAL(std::string());
2669 #ifdef AAMP_CC_ENABLED
2680 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2689 ERROR_OR_IDLE_STATE_CHECK_VAL(
false);
2705 ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2714 ERROR_STATE_CHECK_VOID();
2726 ERROR_STATE_CHECK_VOID();
2735 ERROR_STATE_CHECK_VOID();
2744 ERROR_OR_IDLE_STATE_CHECK_VOID();
2753 ERROR_OR_IDLE_STATE_CHECK_VOID();
2791 AAMPLOG_WARN(
"Enable async tune operation!!" );
2798 AAMPLOG_WARN(
"Disable async tune operation!!");
2810 ERROR_STATE_CHECK_VOID();
2831 AAMPLOG_WARN(
"aamp_stop PlayerState=%d",state);
2833 if (sendStateChangeEvent)
2852 ERROR_STATE_CHECK_VOID();
2854 if(behavior >= 0 && behavior < ePAUSED_BEHAVIOR_MAX)
2856 AAMPLOG_WARN(
"Player Paused behavior : %d", behavior);
2867 ERROR_STATE_CHECK_VOID();
2877 ERROR_STATE_CHECK_VOID();
2887 bool retVal =
false;
2888 cJSON *cfgdata = NULL;
2891 cfgdata = cJSON_Parse(jsonStr);
2903 if(cfgdata != NULL){
2904 cJSON *drmConfig = cJSON_GetObjectItem(cfgdata,
"drmConfig");
2906 std::string LicenseServerUrl =
"";
2908 aamp->
mDynamicDrmDefaultconfig.licenseEndPoint.insert(std::pair<std::string, std::string>(
"com.microsoft.playready", LicenseServerUrl.c_str()));
2910 aamp->
mDynamicDrmDefaultconfig.licenseEndPoint.insert(std::pair<std::string, std::string>(
"com.widevine.alpha",LicenseServerUrl.c_str()));
2912 aamp->
mDynamicDrmDefaultconfig.licenseEndPoint.insert(std::pair<std::string, std::string>(
"org.w3.clearkey",LicenseServerUrl.c_str()));
2913 std::string customData =
"";
2917 cJSON_Delete(cfgdata);
2927 std::string jsonStr;
2953 }, (
void *)
this , __FUNCTION__));
2967 ERROR_STATE_CHECK_VOID();
2968 #ifdef AAMP_AUXILIARY_AUDIO_ENABLED
2972 AAMPLOG_WARN(
"aamp_SetAuxiliaryLanguage(%s)->(%s)", currentLanguage.c_str(), language.c_str());
2974 if(language != currentLanguage)
2987 AAMPLOG_WARN(
"aamp_SetAuxiliaryLanguage(%s) retuning", language.c_str());
2989 aamp->discardEnteringLiveEvt =
true;
2995 aamp->discardEnteringLiveEvt =
false;
3000 AAMPLOG_ERR(
"Auxiliary audio language is not supported in this platform, ignoring the input!");
3009 ERROR_STATE_CHECK_VOID();
3028 ERROR_STATE_CHECK_VOID();
3029 AAMPLOG_INFO(
"ProcessContentProtectionDataConfig received DRM config data from app");
3031 std::vector<uint8_t> tempKeyId;
3033 if(
aamp->vDynamicDrmData.size()>9)
3035 aamp->vDynamicDrmData.erase(
aamp->vDynamicDrmData.begin());
3038 cJSON *cfgdata = cJSON_Parse(jsonbuffer);
3039 empty_config = cJSON_GetArraySize(cfgdata);
3042 cJSON *arryitem = cJSON_GetObjectItem(cfgdata,
"keyID" );
3044 cJSON *iterator = NULL;
3045 cJSON_ArrayForEach(iterator, arryitem) {
3046 if (cJSON_IsNumber(iterator)) {
3047 tempKeyId.push_back(iterator->valueint);
3050 dynamicDrmCache.keyID=tempKeyId;
3053 AAMPLOG_WARN(
"Response message doesn't have keyID ignoring the message");
3059 while (iter1 < aamp->vDynamicDrmData.size()) {
3061 if(tempKeyId == dynamicDrmCache.keyID) {
3062 AAMPLOG_WARN(
"Deleting old config and updating new config");
3063 aamp->vDynamicDrmData.erase(
aamp->vDynamicDrmData.begin()+iter1);
3068 cJSON *playReadyObject = cJSON_GetObjectItem(cfgdata,
"com.microsoft.playready");
3069 std::string playreadyurl=
"";
3070 if(playReadyObject) {
3071 playreadyurl = playReadyObject->valuestring;
3072 AAMPLOG_TRACE(
"App configured Playready License server URL : %s",playreadyurl.c_str());
3075 dynamicDrmCache.licenseEndPoint.insert(std::pair<std::string, std::string>(
"com.microsoft.playready",playreadyurl.c_str()));
3077 cJSON *wideVineObject = cJSON_GetObjectItem(cfgdata,
"com.widevine.alpha");
3078 std::string widevineurl =
"";
3079 if(wideVineObject) {
3080 widevineurl = wideVineObject->valuestring;
3081 AAMPLOG_TRACE(
"App configured widevine License server URL : %s",widevineurl.c_str());
3083 dynamicDrmCache.licenseEndPoint.insert(std::pair<std::string, std::string>(
"com.widevine.alpha",widevineurl.c_str()));
3085 cJSON *clearKeyObject = cJSON_GetObjectItem(cfgdata,
"org.w3.clearkey");
3086 std::string clearkeyurl =
"";
3087 if(clearKeyObject) {
3088 clearkeyurl = clearKeyObject->valuestring;
3089 AAMPLOG_TRACE(
"App configured clearkey License server URL : %s",clearkeyurl.c_str());
3091 dynamicDrmCache.licenseEndPoint.insert(std::pair<std::string, std::string>(
"org.w3.clearkey",clearkeyurl.c_str()));
3093 cJSON *customDataObject = cJSON_GetObjectItem(cfgdata,
"customData");
3094 std::string customdata =
"";
3095 if(customDataObject) {
3096 customdata = customDataObject->valuestring;
3097 AAMPLOG_TRACE(
"App configured customData : %s",customdata.c_str());
3099 dynamicDrmCache.customData = customdata;
3101 cJSON *authTokenObject = cJSON_GetObjectItem(cfgdata,
"authToken");
3102 std::string authToken =
"";
3103 if(authTokenObject) {
3104 authToken = authTokenObject->valuestring;
3105 AAMPLOG_TRACE(
"App configured authToken : %s",authToken.c_str());
3107 dynamicDrmCache.authToken = authToken;
3109 cJSON *licenseResponseObject = cJSON_GetObjectItem(cfgdata,
"licenseResponse");
3110 if(licenseResponseObject) {
3111 std::string licenseResponse = licenseResponseObject->valuestring;
3112 if(!licenseResponse.empty()) {
3116 if(empty_config == 1){
3118 AAMPLOG_WARN(
"Received empty config applying default config");
3121 std::map<std::string,std::string>::iterator itr;
3122 for(itr = dynamicDrmCache.licenseEndPoint.begin();itr!=dynamicDrmCache.licenseEndPoint.end();itr++) {
3123 if(strcasecmp(
"com.microsoft.playready",itr->first.c_str())==0) {
3124 playreadyurl = itr->second;
3126 if(strcasecmp(
"com.widevine.alpha",itr->first.c_str())==0) {
3127 widevineurl = itr->second;
3129 if(strcasecmp(
"org.w3.clearkey",itr->first.c_str())==0) {
3130 clearkeyurl = itr->second;
3133 authToken = dynamicDrmCache.authToken;
3134 customdata = dynamicDrmCache.customData;
3137 aamp->vDynamicDrmData.push_back(dynamicDrmCache);
3141 AAMPLOG_WARN(
"Player received the config for requested keyId applying the configs");
3147 pthread_mutex_lock(&
aamp->mDynamicDrmUpdateLock);
3148 pthread_cond_signal(&
aamp->mWaitForDynamicDRMToUpdate);
3149 AAMPLOG_WARN(
"Updated new Content Protection Data Configuration");
3150 pthread_mutex_unlock(&
aamp->mDynamicDrmUpdateLock);
3154 cJSON_Delete(cfgdata);
3165 ERROR_STATE_CHECK_VOID();
3166 int timeout_ms = timeout * 1000;
3185 #ifdef AAMP_CC_ENABLED
void SetAsyncTuneConfig(bool bValue)
Set async tune configuration.
long GetInitialBitrate(void)
To get the initial bitrate value.
@ eAAMPConfig_CurlDownloadStartTimeout
int GetInitialBufferDuration(void)
Get initial buffer duration in seconds.
void ApplyArtificialDownloadDelay(unsigned int DownloadDelayInMs)
to optionally configure simulated per-download network latency for negative testing
long GetMinimumBitrate(void)
Get minimum bitrate value.
double mProgressReportOffset
@ eAAMPConfig_PlaylistTimeout
long GetVideoBitrate(void)
To get the bitrate of current video profile.
void SetLiveOffsetAppRequest(bool LiveOffsetAppRequest)
set LiveOffset Request flag Status
std::string GetAuxiliaryAudioLanguage()
Get auxiliary language.
void aamp_Free(void *ptr)
wrapper for g_free, used for segment allocation
int GetAudioTrack()
Get current audio track index.
bool IsValidRate(int rate)
Check given rate is valid.
void SetManifestTimeout(double timeout)
Optionally override default HLS main manifest download timeout with app-specific value.
std::string GetVideoRectangle()
Get the video window co-ordinates.
int ScheduleTask(AsyncTaskObj obj)
To schedule a task to be executed later.
void SetRampDownLimit(int limit)
Set profile ramp down limit.
@ eAAMPConfig_InterruptHandling
@ eAAMPConfig_MaxFragmentCached
class PrivateInstanceAAMP * aamp
double GetPlaybackPosition(void)
To get the current playback position.
@ eAAMPConfig_NewDiscontinuity
@ eAAMPConfig_LiveOffset4K
Implented DRM helper functionalities.
@ eAAMPConfig_HLSAVTrackSyncUsingStartTime
std::string preferredLanguagesString
@ eAAMPConfig_SubTitleLanguage
void SetPropagateUriParameters(bool bValue)
to configure URI parameters for fragment downloads
bool mIsIframeTrackPresent
bool GetESChangeStatus(void)
Get elementary stream type change status for reconfigure the pipeline..
class StreamAbstractionAAMP * mpStreamAbstractionAAMP
void EnableContentRestrictions()
Enable Content Restrictions - lock.
std::string GetTextTrackInfo()
Get current audio track index.
@ eAAMPConfig_WVLicenseServerUrl
@ eAAMPConfig_CurlDownloadLowBWTimeout
bool SetThumbnailTrack(int thumbIndex)
To set a preferred bitrate for thumbnail profile.
bool GetAudioFwdToAuxStatus()
Get audio forward to aux pipeline status.
void SetBulkTimedMetaReport(bool bValue)
Set Bulk TimedMetadata Reporting flag.
void UnRegisterEvents(EventListener *eventListener)
UnRegister event handler.
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
void SetSlowMotionPlayRate(float rate)
Set slow motion player speed.
void NotifyFirstBufferProcessed()
Notify if first buffer processed by gstreamer.
@ eAAMPConfig_PlaybackOffset
void TuneHelper(TuneType tuneType, bool seekWhilePaused=false)
The helper function which perform tuning Common tune operations used on Tune, Seek,...
void ManageAsyncTuneConfig(const char *url)
Manage async tune configuration for specific contents.
void SetPreferredLanguages(const char *languageList, const char *preferredRendition, const char *preferredType, const char *codecList, const char *labelList)
set preferred Audio Language properties like language, rendition, type and codec
std::string GetPlaybackStats()
Get playback stats for the session so far.
Class for sed event to Listener.
void SetNetworkProxy(const char *proxy)
To set the network proxy.
void SetLicenseCaching(bool bValue)
Set license caching.
bool InitAAMPConfig(char *jsonStr)
InitAAMPConfig - Initialize the media player session with json config.
virtual void Stream(void)
Start the stream.
void SetContentProtectionDataUpdateTimeout(int timeout)
To set default timeout for Dynamic ContentProtectionDataUpdate on Key Rotation.
Base classes of HLS/MPD collectors. Implements common caching/injection logic.
bool GetAampConfigJSONStr(std::string &str)
GetAampConfigJSONStr - Function to Complete Config as JSON str.
void logprintf(const char *format,...)
Print logs to console / log fil.
std::string GetThumbnails(double start, double end)
Get the Thumbnail Tile data.
bool IsTuneCompleted()
Check if tune completed or not.
DRMSystems GetPreferredDRM()
Get Preferred DRM.
virtual std::vector< long > GetVideoBitrates(void)=0
Get available video bitrates.
bool IsLive()
To check whether the asset is live or not.
Types and APIs exposed by the AAMP player.
void SetAudioVolume(int volume)
Set audio volume.
void SetStallTimeout(int timeoutMS)
To set the timeout value to be used for playback stall detection.
void SetVideoMute(bool muted)
Enable/ Disable Video.
void SetSegmentDecryptFailCount(int value)
Set retry limit on Segment drm decryption failure.
void Tune(const char *url, bool autoPlay, const char *contentType=NULL, bool bFirstAttempt=true, bool bFinalAttempt=false, const char *sessionUUID=NULL, bool audioDecoderStreamSync=true)
Tune API.
void SetState(PrivAAMPState state)
Set player state.
Class declaration of Gstreamer based player.
void LogPlayerPreBuffered(void)
Profile Player changed from background to foreground i.e prebuffred.
@ eAAMPConfig_LicenseServerUrl
AampCacheHandler * getAampCacheHandler()
Get AampCacheHandler instance.
void RegisterEvents(EventListener *eventListener)
Register event listener.
void SetDownloadStartTimeout(long startTimeout)
To set the curl download start timeout.
int GetPlaybackRate(void)
To get the current playback rate.
void SetTextStyle(const std::string &options)
Set style options for text track rendering.
@ eAAMPConfig_ReportProgressInterval
void StopInternal(bool sendStateChangeEvent)
Stop playback and release resources.
void EnableSeekableRange(bool enabled)
Enable seekable range values in progress event.
int GetAudioTrack()
Get current audio track index.
void SetPreferredSubtitleLanguage(const char *language)
Set preferred subtitle language.
bool mSeekFromPausedState
void AcquireStreamLock()
acquire streamsink lock
void RemoveEventListener(AAMPEventType eventType, EventListener *eventListener)
Remove event listener for eventType.
void StartPlaylistCache()
Start playlist caching.
@ eAAMPConfig_BulkTimedMetaReport
It contains class referenced by manager.cpp file.
void SetLicenseCustomData(const char *customData)
Set License Custom Data.
@ eAAMPConfig_NativeCCRendering
void SetVideoRectangle(int x, int y, int w, int h)
Set video rectangle.
void SubscribeResponseHeaders(std::vector< std::string > responseHeaders)
Subscribe array of http response headers.
void RemoveEventListener(AAMPEventType eventType, EventListener *eventListener)
Deregister event lister, Remove listener to aamp events.
void SetPreferredTextLanguages(const char *param)
Set Preferred Text Language.
void SetInitialBufferDuration(int durationSec)
Set initial buffer duration in seconds.
@ eAAMPConfig_ReportVideoPTS
void AsyncStartStop()
Enable/Disable async operation.
void SetRepairIframes(bool configState)
To set the repairIframes flag.
const char * GetPreferredLanguages()
Get current preferred language list.
@ eAAMPConfig_InitRampDownLimit
std::string GetPlaybackStats()
Get playback statistics formated for partner apps.
DynamicDrmInfo mDynamicDrmDefaultconfig
void XRESupportedTune(bool xreSupported)
To set whether the JS playback session is from XRE or not.
@ eAAMPConfig_EnableSeekRange
void SetUseAbsoluteTimeline(bool configState)
To set UseAbsoluteTimeline for DASH.
void PersistBitRateOverSeek(bool value)
Enable/disable configuration to persist ABR profile over seek/SAP.
void SetAnonymousRequest(bool isAnonymous)
Indicates if session token has to be used with license request or not.
bool IsTSBSupported()
Checking whether TSB enabled or not.
long long GetDurationMs(void)
Get asset duration in milliseconds.
int GetVideoZoom(void)
To get video zoom mode.
bool IsFragmentCachingRequired()
Check if fragment caching is required.
std::string GetAvailableVideoTracks()
Get available video tracks.
void SetAlternateContents(const std::string &adBreakId, const std::string &adId, const std::string &url)
Setting the alternate contents' (Ads/blackouts) URL.
void SetTextTrack(int trackId, char *data=NULL)
Set text track.
@ eAAMPConfig_CurlStallTimeout
void PauseAtInternal(double secondsRelativeToTuneTime)
Set PauseAt position - Internal function.
void SetLicenseReqProxy(const char *licenseProxy)
To set the proxy for license request.
void SetVideoTracks(std::vector< long > bitrates)
Set video tracks.
void SetPreferredCodec(const char *codecList)
Set optional preferred codec list.
long GetVideoBitrate(void)
Get the bitrate of current video profile selected.
void AddEventListener(AAMPEventType eventType, EventListener *eventListener)
Support multiple listeners for multiple event type.
void SetLanguageFormat(LangCodePreference preferredFormat, bool useRole=false)
Set Language preferred Format.
std::string GetAvailableVideoTracks()
Get available video tracks.
void SetLinearTrickplayFPS(int linearTrickplayFPS)
Set Linear Trickplay FPS.
std::string & GetManifestUrl(void)
Get manifest URL.
void SetTextTrack(int trackId, char *ccData=NULL)
Set text track.
void SetInitRampdownLimit(int limit)
Set Initial profile ramp down limit.
@ eAAMPConfig_NetworkTimeout
bool IsStreamerAtLivePoint()
Whether we are playing at live point or not.
std::string GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
std::vector< long > GetVideoBitrates(void)
To get the available video bitrates.
void SetLanguage(const char *language)
Set Audio language.
void StopDownloads()
Stop downloads of all tracks. Used by aamp internally to manage states.
void SetSubtitleMute(bool muted)
Set subtitle mute state.
void SetScheduler(AampScheduler *instance)
Set the scheduler instance to schedule tasks.
bool GetConfigValue(AAMPConfigSettings cfg, std::string &value)
GetConfigValue - Gets configuration for string data type.
VideoZoomMode
Video zoom mode.
void SetInitFragTimeoutRetryCount(int count)
To set the max retry attempts for init frag curl timeout failures.
bool LockGetPositionMilliseconds()
Lock GetPositionMilliseconds() returns true if successfull.
void SetRuntimeDRMConfigSupport(bool DynamicDRMSupported)
To set Dynamic DRM feature by Application.
void GetState(PrivAAMPState &state)
Get player state.
void SetLiveOffset4K(double liveoffset)
Set Live Offset.
const char * GetCurrentDRM()
Get current drm.
void SetNewAdBreakerConfig(bool bValue)
Configure New AdBreaker Enable/Disable.
@ eAAMPConfig_ManifestTimeout
void SetLiveOffset(double liveoffset)
Set Live Offset.
void SetReportVideoPTS(bool enabled)
Enable video PTS reporting in progress event.
void SetMaximumBitrate(long bitrate)
Set maximum bitrate value.
bool ProcessConfigJson(const char *cfg, ConfigPriority owner)
ProcessConfigJson - Function to parse and process json configuration string.
@ eAAMPConfig_RampDownLimit
void SetVODTrickplayFPS(int vodTrickplayFPS)
Set VOD Trickplay FPS.
virtual void StartInjection(void)=0
Start injection of fragments.
void TuneInternal(const char *mainManifestUrl, bool autoPlay, const char *contentType, bool bFirstAttempt, bool bFinalAttempt, const char *traceUUID, bool audioDecoderStreamSync)
Tune to a URL.
void ReadOperatorConfiguration()
ReadOperatorConfiguration - Reads Operator configuration from RFC and env variables.
void Seek(double secondsRelativeToTuneTime, bool keepPaused=false)
Seek to a time.
bool ReadAampCfgJsonFile()
ReadAampCfgJsonFile - Function to parse and process configuration file in json format.
long GetMaximumBitrate(void)
Get maximum bitrate value.
void UnloadJS(void *context)
static void DestroyInstance()
To release AampSecManager singelton instance.
@ eAAMPConfig_NetworkProxy
void SetPausedBehavior(int behavior)
To set preferred paused state behavior.
void SetCCStatus(bool enabled)
Set CC visibility on/off.
void UnRegisterEvents(EventListener *eventListener)
UnRegister event listener.
void SetCEAFormat(int format)
Set the CEA format for force setting.
void SetParallelPlaylistDL(bool bValue)
Set parallel playlist download config value.
std::string GetThumbnailTracks()
Get available thumbnail tracks.
long GetAudioBitrate(void)
Get the bitrate of current audio profile selected.
AudioTrackTuple mAudioTuple
void SetLogger(AampLogManager *logObj)
Set the logger instance for the Scheduler.
void SetPlaylistTimeout(double timeout)
Optionally override default HLS main manifest download timeout with app-specific value.
static void DestroyInstance()
Destroy instance.
void SetAuxiliaryLanguage(const std::string &language)
Set auxiliary language.
void SetParallelPlaylistRefresh(bool bValue)
Set parallel playlist download config value for linear.
@ eAAMPConfig_PlaylistParallelFetch
@ eAAMPConfig_LimitResolution
Class to communicate with SecManager Thunder plugin.
void SetDisable4K(bool value)
Disable 4K Support in player.
@ eAAMPConfig_EnableGstPositionQuery
void PauseAt(double position)
Set PauseAt position.
void TuneFail(bool fail)
Profiler for failure tune.
long long GetPositionMilliseconds(void)
Get current stream playback position in milliseconds.
@ eAAMPConfig_DRMDecryptThreshold
void StartScheduler()
To start scheduler thread.
void SetAuxiliaryLanguageInternal(const std::string &language)
Set auxiluerry track language.
virtual bool SetThumbnailTrack(int)=0
Set thumbnail bitrate.
@ eAAMPConfig_AnonymousLicenseRequest
@ eAAMPConfig_CustomLicenseData
@ AAMP_CUSTOM_DEV_CFG_SETTING
void ReleaseStreamLock()
release streamsink lock
bool RetrieveFromPlaylistCache(const std::string url, GrowableBuffer *buffer, std::string &effectiveUrl)
Retrieve playlist from cache.
std::string GetPreferredTextProperties()
Get preferred text prioperties.
Player interface class for the JS pluggin.
void SetOutputResolutionCheck(bool bValue)
Set Display resolution check for video profile filtering.
@ eAAMPConfig_EnableRectPropertyCfg
long long getTimeSinceUpdateMs() const
For objects containing real data (check using isPopulated()) this returns the number of milliseconds ...
std::string GetAudioTrackInfo()
Get current audio track index.
static std::mutex mPrvAampMtx
void SetStallErrorCode(int errorCode)
To set the error code to be used for playback stalled error.
void ResumeScheduler()
To release execution lock.
bool playerStartedWithTrickPlay
bool IsOOBCCRenderingSupported()
To check whether Out of Band Closed caption/Subtile rendering supported or not.
bool GetCCStatus(void)
Get CC visibility on/off.
void SetDownloadBufferSize(int bufferSize)
To set the download buffer size value.
std::string GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
@ eAAMPConfig_CKLicenseServerUrl
@ eAAMPConfig_RuntimeDRMConfig
long GetInitialBitrate4k(void)
To get the initial bitrate value for 4K assets.
AampConfig * gpGlobalConfig
Global configuration.
@ eAAMPConfig_LanguageCodePreference
RDK IARM-Bus API Declarations.
void ResetConfiguration()
API to reset configuration across tunes for single player instance.
@ eAAMPConfig_UseWesterosSink
bool IsJsInfoLoggingEnabled()
Get jsinfo config value (default false)
PositionInfo< TPOSITIONCACHE > GetInfo()
Retrieve the stored position information.
void DisableContentRestrictions(long grace=0, long time=-1, bool eventChange=false)
Disable Content Restrictions - unlock.
DRMSystems GetPreferredDRM()
Get Preferred DRM.
void SetAudioVolume(int volume)
Set Audio Volume.
@ eAAMPConfig_XRESupportedTune
std::string GetTextStyle()
Get style options for text track rendering.
Gstreamer based player for AAMP.
float getWorkingTrickplayRate(float rate)
Get compatible trickplay for 6s cadense of iframe track from the given rates.
@ eAAMPConfig_AvgBWForABR
void DoCustomSetting(ConfigPriority owner)
DoCustomSetting - Function to do override , to avoid complexity with multiple configs.
void detach()
Soft stop the player instance.
void SetAudioTrackInternal(std::string language, std::string rendition, std::string codec, std::string type, unsigned int channel, std::string label)
Set audio track by audio parameters like language , rendition, codec etc..
void SetStreamSink(StreamSink *streamSink)
Setting the stream sink.
void StopPausePositionMonitoring(std::string reason)
stop the PausePositionMonitoring thread used for PauseAt functionality
virtual bool Pause(bool pause, bool forceStopGstreamerPreBuffering)
Enabled or disable playback pause.
void SeekInternal(double secondsRelativeToTuneTime, bool keepPaused)
Seek to a time - Internal function.
void Stop(void)
Stop playback and release resources.
void SetTextTrackInternal(int trackId, char *data)
Set text track by Id.
std::string GetPreferredAudioProperties()
Get preferred audio prioperties.
@ eAAMPConfig_RetuneForGSTError
void SetSubtitleMute(bool muted)
Enable/ Disable Subtitle.
std::string GetTextTrackInfo()
Get current audio track index.
@ eAAMPConfig_JsInfoLogging
void ProcessContentProtectionDataConfig(const char *jsonbuffer)
void TeardownStream(bool newTune)
Terminate the stream.
ContentType GetContentType() const
Get Content Type.
virtual std::vector< AudioTrackInfo > & GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
@ eAAMPConfig_LicenseProxy
void SetAvgBWForABR(bool useAvgBW)
Indicates average BW to be used for ABR Profiling.
void StopScheduler()
To stop scheduler and associated resources.
bool IsLive(void)
Checking if the stream is live or not.
std::string GetPreferredAudioProperties()
get the current audio preference set by user
@ eAAMPConfig_LinearTrickPlayFPS
PrivAAMPState GetState(void)
To get the current AAMP state.
bool TryStreamLock()
try to acquire streamsink lock
void NotifySpeedChanged(float rate, bool changeState=true)
Notify speed change event to listeners.
void SetRate(float rate, int overshootcorrection=0)
Set playback rate.
bool IsOTAContent()
Checking whether OTA content or not.
@ eAAMPConfig_DisableATMOS
void SetInitialBitrate(long bitrate)
To set the initial bitrate value.
const char * GetCurrentAudioLanguage()
Get current audio language.
void SetVideoTracks(std::vector< long > bitrateList)
set birate for video tracks selection
void SetPreferredTextLanguages(const char *param)
Set optional preferred language list.
@ eAAMPConfig_TuneEventConfig
@ eAAMPConfig_SslVerifyPeer
@ eAAMPConfig_SegmentInjectThreshold
void SetSessionToken(std::string sessionToken)
Set the session token for player.
void ReadDeviceCapability()
GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin.
void Tune(const char *mainManifestUrl, const char *contentType, bool bFirstAttempt, bool bFinalAttempt, const char *traceUUID, bool audioDecoderStreamSync)
Tune to a URL. DEPRECATED! This is included for backwards compatibility with current Sky AS integrati...
void SetPreferredLanguages(const char *languageList, const char *preferredRendition=NULL, const char *preferredType=NULL, const char *codecList=NULL, const char *labelList=NULL)
Set optional preferred language list.
@ eAAMPConfig_ABRBufferCheckEnabled
#define AAMPLOG_TRACE(FORMAT,...)
AAMP logging defines, this can be enabled through setLogLevel() as per the need.
std::string GetThumbnails(double sduration, double eduration)
To get preferred thumbnails for the duration.
virtual void NotifyPlaybackPaused(bool paused)
Function called when playback is paused to update related flags.
void RestoreConfiguration(ConfigPriority owner, AampLogManager *mLogObj)
RestoreConfiguration - Function is restore last configuration value from current ownership.
void SetAudioBitrate(long bitrate)
To set a preferred bitrate for audio profile.
@ eAAMPConfig_PropogateURIParam
static bool IsActiveInstancePresent()
Check if any active PrivateInstanceAAMP available.
Structure of GrowableBuffer.
void ShowOperatorSetConfiguration()
ShowOperatorSetConfiguration - List all operator configured settings.
Class representing the AAMP player's private instance, which is not exposed to outside world.
double GetPlaybackDuration(void)
To get the current asset's duration.
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
void SetNetworkTimeout(double timeout)
To override default curl timeout for playlist/fragment downloads.
@ eAAMPConfig_LivePauseBehavior
int GetTextTrack()
Get current text track index.
void setPlayerId(int playerId)
Set PlayerId.
void SetPreferredDRM(DRMSystems drmType)
Set Preferred DRM.
long GetAudioBitrate(void)
To get the bitrate of current audio profile.
virtual std::vector< TextTrackInfo > & GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
void SetMaxPlaylistCacheSize(int cacheSize)
Set Maximum Cache Size for storing playlist.
void LoadJS(void *context)
void SetRateAndSeek(int rate, double secondsRelativeToTuneTime)
Seek to a time and playback with a new rate.
void SetAuxiliaryLanguage(const std::string &language)
Set auxiliary language.
void UnlockGetPositionMilliseconds()
Unlock GetPositionMilliseconds()
void AddCustomHTTPHeader(std::string headerName, std::vector< std::string > headerValue, bool isLicenseHeader)
Add/Remove a custom HTTP header and value.
@ eAAMPConfig_MaxPlaylistCacheSize
void SuspendScheduler()
To acquire execution lock for synchronisation purposes.
void SetNativeCCRendering(bool enable)
Enable/disable the native CC rendering feature.
bool GetCCStatus(void)
Get CC visibility on/off.
bool IsAudioLanguageSupported(const char *checkLanguage)
Checking whether audio language supported.
std::string GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
bool GetVideoMute(void)
To get video mute status.
MediaFormat GetMediaFormatType(const char *url)
Assign the correct mediaFormat by parsing the url.
void SetMatchingBaseUrlConfig(bool bValue)
Set Matching BaseUrl Config Configuration.
@ eAAMPConfig_DefaultBitrate
@ eAAMPConfig_CEAPreferred
void SetRateInternal(float rate, int overshootcorrection)
Set playback rate - Internal function.
void EnableVideoRectangle(bool rectProperty)
Set video rectangle property.
std::vector< long > GetAudioBitrates(void)
To get the available audio bitrates.
void SetSegmentInjectFailCount(int value)
Set retry limit on Segment injection failure.
void SetRetuneForUnpairedDiscontinuity(bool bValue)
Set unpaired discontinuity retune flag.
void ShowDevCfgConfiguration()
ShowDevCfgConfiguration - List all developer configured settings.
virtual void SeekPosUpdate(double secondsRelativeToTuneTime)=0
Update seek position when player is initialized.
void SetWesterosSinkConfig(bool bValue)
Set Westeros sink configuration.
void SetDownloadStallTimeout(long stallTimeout)
To set the curl stall timeout value.
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
int GetRampDownLimit(void)
Get profile ramp down limit.
bool mbUsingExternalPlayer
void StartPausePositionMonitoring(long long pausePositionMilliseconds)
start the PausePositionMonitoring thread used for PauseAt functionality
AAMPEventType
Type of the events sending to the JSPP player.
void SetVideoRectangle(int x, int y, int w, int h)
Set video rectangle.
std::string GetManifest(void)
To get the available manifest.
static AampCCManagerBase * GetInstance()
Get the singleton instance.
void SetAudioTrack(std::string language="", std::string rendition="", std::string type="", std::string codec="", unsigned int channel=0, std::string label="")
Set audio track.
#define AAMP_MAXIMUM_AUDIO_LEVEL
std::string GetAvailableThumbnailTracks(void)
To get the available bitrates for thumbnails.
std::vector< uint8_t > mcurrent_keyIdArray
void SetStereoOnlyPlayback(bool bValue)
Set Stereo Only Playback.
void SetAppName(std::string name)
Set the application name which has created PlayerInstanceAAMP, for logging purposes.
void SetLicenseServerURL(const char *url, DRMSystems type=eDRM_MAX_DRMSystems)
Set License Server URL.
void DisableContentRestrictions(long grace, long time, bool eventChange)
Disable Content Restrictions - unlock.
void Stop(bool sendStateChangeEvent=true)
Stop playback and release resources.
@ eAAMPConfig_PlaylistParallelRefresh
@ eAAMPConfig_VODTrickPlayFPS
bool IsOOBCCRenderingSupported()
@ eAAMPConfig_RetuneForUnpairDiscontinuity
ContentType
Asset's content types.
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
@ eAAMPConfig_DefaultBitrate4K
void SetPreCacheTimeWindow(int nTimeWindow)
SetPreCacheTimeWindow Function to Set PreCache Time.
void SetEventPriorityAsyncTune(bool bValue)
Set async tune configuration for EventPriority.
void SetVideoBitrate(long bitrate)
To set a preferred bitrate for video profile.
~PlayerInstanceAAMP()
PlayerInstanceAAMP Destructor.
bool mApplyCachedVideoMute
@ eAAMPConfig_SetLicenseCaching
std::shared_ptr< AampDrmHelper > GetCurrentDRM()
Get current drm.
void SetTextStyle(const std::string &options)
Set style options for text track rendering.
DRMSystems
DRM system types.
bool GetPauseOnFirstVideoFrameDisp(void)
GetPauseOnFirstVideoFrameDisplay.
PlayerInstanceAAMP(StreamSink *streamSink=NULL, std::function< void(uint8_t *, int, int, int) > exportFrames=nullptr)
PlayerInstanceAAMP Constructor.
std::string GetAAMPConfig()
GetAAMPConfig - GetAamp Config as JSON string.
void SetDownloadLowBWTimeout(long lowBWTimeout)
To set the curl download low bandwidth timeout value.
void SetCCStatus(bool enabled)
Set CC visibility on/off.
void EnableContentRestrictions()
Enable Content Restrictions - lock.
std::string GetTextStyle()
Get style options for text track rendering.
virtual std::vector< long > GetAudioBitrates(void)=0
Get available audio bitrates.
std::shared_ptr< PrivateInstanceAAMP > sp_aamp
void SeekToLive(bool keepPaused=false)
Seek to live point.
void SetAlternateContents(const std::string &adBreakId, const std::string &adId, const std::string &url)
Setting the alternate contents' (Ads/blackouts) URL.
int GetAudioVolume(void)
To get the current audio volume.
std::string GetAvailableTextTracks(bool alltrack=false)
Get available text tracks.
void AddPageHeaders(std::map< std::string, std::string > customHttpHeaders)
Applies the custom http headers for page (Injector bundle) received from the js layer.
void SetPreferredRenditions(const char *renditionList)
Set optional preferred rendition list.
@ eAAMPConfig_PersistentBitRateOverSeek
int GetTextTrack()
Get current text track index.
void SetSubscribedTags(std::vector< std::string > subscribedTags)
Set array of subscribed tags.
double GetPositionSeconds(void)
@ eAAMPConfig_MatchBaseUrl
@ eAAMPConfig_PreCachePlaylistTime
void EnableDownloads(void)
Enable downloads after aamp_DisableDownloads. Called after stopping fragment collector thread.
StreamSink * mInternalStreamSink
virtual void Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false)
Configure output formats.
std::string GetPreferredTextProperties()
get the current text preference set by user
void SetMinimumBitrate(long bitrate)
Set minimum bitrate value.
void RegisterEvents(EventListener *eventListener)
Register event handler.
void RemoveAllTasks()
To remove all scheduled tasks and prevent further tasks from scheduling.
void AddCustomHTTPHeader(std::string headerName, std::vector< std::string > headerValue, bool isLicenseHeader=false)
Add/Remove a custom HTTP header and value.
Integration layer of ClosedCaption in AAMP.
void NotifyOnEnteringLive()
Notify when entering live point to listeners.
void SetVideoMute(bool muted)
Enable/ Disable Video.
bool ReadAampCfgTxtFile()
ReadAampCfgTxtFile - Function to parse and process configuration file in text format.
std::string GetAudioTrackInfo()
Get current audio track index.
LangCodePreference
Language Code Preference types.
void SetTuneEventConfig(int tuneEventType)
To set the vod-tune-event according to the player.
void SetAppName(std::string name)
Set the application name which has created PlayerInstanceAAMP, for logging purposes.
@ eAAMPConfig_AllowPageHeaders
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
@ eAAMPConfig_UseAbsoluteTimeline
@ eAAMPConfig_InitFragmentRetryCount
void SetRetuneForGSTInternalError(bool bValue)
Set retune configuration for gstpipeline internal data stream error.
bool mJumpToLiveFromPause
@ eAAMPConfig_ContentProtectionDataUpdateTimeout
bool SetStateBufferingIfRequired()
Set eSTATE_BUFFERING if required.
void SetReportInterval(int reportInterval)
To set the Playback Position reporting interval.
@ eAAMPConfig_PRLicenseServerUrl
void ResumeDownloads()
Resume downloads of all tracks. Used by aamp internally to manage states.
void SetNewABRConfig(bool bValue)
Configure New ABR Enable/Disable.
@ eAAMPConfig_RepairIframes
void SetPreferredLabels(const char *lableList)
Set optional preferred label list.
void detach()
Soft stop the player instance.
void SetInitialBitrate4K(long bitrate4K)
To set the initial bitrate value for 4K assets.
void AddEventListener(AAMPEventType eventType, EventListener *eventListener)
Add listener to aamp events.
void SetSslVerifyPeerConfig(bool bValue)
Configure URI parameters.
@ eAAMPConfig_PreferredDRM