RDK Documentation (Open Sourced RDK Components)
main_aamp.cpp
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @file main_aamp.cpp
22  * @brief Advanced Adaptive Media Player (AAMP)
23  */
24 #ifdef IARM_MGR
25 #include "host.hpp"
26 #include "manager.hpp"
27 #include "libIBus.h"
28 #include "libIBusDaemon.h"
29 #include "irMgr.h"
30 #endif
31 
32 #include "main_aamp.h"
33 #include "AampConfig.h"
34 #include "AampCacheHandler.h"
35 #include "AampUtils.h"
36 #ifdef AAMP_CC_ENABLED
37 #include "AampCCManager.h"
38 #endif
39 #include "helper/AampDrmHelper.h"
40 #include "StreamAbstractionAAMP.h"
41 #include "aampgstplayer.h"
42 
43 #include <dlfcn.h>
44 #include <termios.h>
45 #include <errno.h>
46 #include <regex>
47 
49 AampLogManager *mLogObj=NULL;
50 
51 #ifdef USE_SECMANAGER
52 #include "AampSecManager.h"
53 #endif
54 
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 !");\
59  return; \
60  }
61 
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 !");\
66  return val; \
67  }
68 
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" );\
74  return; \
75  }
76 
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 !");\
81  return; \
82  }
83 
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" );\
89  return val; \
90  }
91 
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 !!");\
96  return; \
97  }
98 
99 static bool iarmInitialized = false;
101 
102 /**
103  * @brief PlayerInstanceAAMP Constructor.
104  */
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()
108 {
109 
110 #ifdef IARM_MGR
111 if(!iarmInitialized)
112 {
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");
118  }
119  else {
120  logprintf("IARM Interface Inited Externally : %d", result);
121  }
122 
123  if (IARM_RESULT_SUCCESS == (result = IARM_Bus_Connect())) {
124  logprintf("IARM Interface Connected in AAMP");
125  }
126  else {
127  logprintf ("IARM Interface Connected Externally :%d", result);
128  }
129  iarmInitialized = true;
130 }
131 #endif
132 
133 #ifdef SUPPORT_JS_EVENTS
134 #ifdef AAMP_WPEWEBKIT_JSBINDINGS //aamp_LoadJS defined in libaampjsbindings.so
135  const char* szJSLib = "libaampjsbindings.so";
136 #else
137  const char* szJSLib = "libaamp.so";
138 #endif
139  mJSBinding_DL = dlopen(szJSLib, RTLD_GLOBAL | RTLD_LAZY);
140  logprintf("[AAMP_JS] dlopen(\"%s\")=%p", szJSLib, mJSBinding_DL);
141 #endif
142 
143  // Create very first instance of Aamp Config to read the cfg & Operator file .This is needed for very first
144  // tune only . After that every tune will use the same config parameters
145  if(gpGlobalConfig == NULL)
146  {
147 #ifdef AAMP_BUILD_INFO
148  std::string tmpstr = MACRO_TO_STRING(AAMP_BUILD_INFO);
149  logprintf(" AAMP_BUILD_INFO: %s",tmpstr.c_str());
150 #endif
151  gpGlobalConfig = new AampConfig();
152  // Init the default values
153  gpGlobalConfig->Initialize();
155  AAMPLOG_WARN("[AAMP_JS][%p]Creating GlobalConfig Instance[%p]",this,gpGlobalConfig);
157  {
159  }
163  ::mLogObj = gpGlobalConfig->GetLoggerInstance();
164  }
165 
166  // Copy the default configuration to session configuration .
167  // App can modify the configuration set
168  mConfig = *gpGlobalConfig;
169 
170  sp_aamp = std::make_shared<PrivateInstanceAAMP>(&mConfig);
171  aamp = sp_aamp.get();
172  mLogObj = mConfig.GetLoggerInstance();
173  mConfig.logging.setPlayerId(aamp->mPlayerId);
174  // start Scheduler Worker for task handling
175  mScheduler.SetLogger(mLogObj);
176  mScheduler.StartScheduler();
177 
178  if (NULL == streamSink)
179  {
180  mInternalStreamSink = new AAMPGstPlayer(mConfig.GetLoggerInstance(), aamp
181 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
182  , exportFrames
183 #endif
184  );
185 
186  streamSink = mInternalStreamSink;
187  }
188  else
189  {
190  // Disable async tune in aamp as plugin mode, since it already called from aamp gst as async call
191  SETCONFIGVALUE(AAMP_APPLICATION_SETTING, eAAMPConfig_AsyncTune, false);
192  mAsyncRunning = false;
193  }
194  aamp->SetStreamSink(streamSink);
195  aamp->SetScheduler(&mScheduler);
196  AsyncStartStop();
197 }
198 
199 
200 /**
201  * @brief PlayerInstanceAAMP Destructor.
202  */
204 {
205  mLogObj = gpGlobalConfig->GetLoggerInstance();
206 #ifdef AAMP_CC_ENABLED
207  AampCCManager::GetInstance()->SetLogger(mLogObj);
208 #endif
209  if (aamp)
210  {
211  PrivAAMPState state;
212  aamp->GetState(state);
213  // Acquire the lock , to prevent new entries into scheduler
214  mScheduler.SuspendScheduler();
215  // Remove all the tasks
216  mScheduler.RemoveAllTasks();
217  if (state != eSTATE_IDLE && state != eSTATE_RELEASED)
218  {
219  //Avoid stop call since already stopped
220  aamp->Stop();
221  }
222 
223  std::lock_guard<std::mutex> lock (mPrvAampMtx);
224  aamp = NULL;
225  }
226  SAFE_DELETE(mInternalStreamSink);
227 
228  // Stop the scheduler
229  mAsyncRunning = false;
230  mScheduler.StopScheduler();
231 
232  bool isLastPlayerInstance = !PrivateInstanceAAMP::IsActiveInstancePresent();
233 
234 #ifdef AAMP_CC_ENABLED
235  if (isLastPlayerInstance)
236  {
238  }
239 #endif
240 #ifdef SUPPORT_JS_EVENTS
241  if (mJSBinding_DL && isLastPlayerInstance)
242  {
243  AAMPLOG_WARN("[AAMP_JS] dlclose(%p)", mJSBinding_DL);
244  dlclose(mJSBinding_DL);
245  }
246 #endif
247 #ifdef USE_SECMANAGER
248  if (isLastPlayerInstance)
249  {
251  }
252 #endif
253  if (isLastPlayerInstance && gpGlobalConfig)
254  {
255  AAMPLOG_WARN("[%p] Release GlobalConfig(%p)",this,gpGlobalConfig);
256  SAFE_DELETE(gpGlobalConfig);
257  }
258 }
259 
260 
261 /**
262  * @brief API to reset configuration across tunes for single player instance
263  */
265 {
266  AAMPLOG_WARN("Resetting Configuration to default values ");
267  // Copy the default configuration to session configuration .App can modify the configuration set
268  mConfig = *gpGlobalConfig;
269 
270  mLogObj = mConfig.GetLoggerInstance();
271 #ifdef AAMP_CC_ENABLED
272  AampCCManager::GetInstance()->SetLogger(mLogObj);
273 #endif
274 
275  // Based on the default condition , reset the AsyncTune scheduler
276  AsyncStartStop();
277 }
278 
279 /**
280  * @brief Stop playback and release resources.
281  */
282 void PlayerInstanceAAMP::Stop(bool sendStateChangeEvent)
283 {
284  if (aamp)
285  {
286  PrivAAMPState state;
287  aamp->GetState(state);
288 
289  // 1. Ensure scheduler is suspended and all tasks if any to be cleaned
290  // 2. Check for state ,if already in Idle / Released , ignore stopInternal
291  // 3. Restart the scheduler , needed if same instance is used for tune again
292 
293  mScheduler.SuspendScheduler();
294  mScheduler.RemoveAllTasks();
295 
296  //state will be eSTATE_IDLE or eSTATE_RELEASED, right after an init or post-processing of a Stop call
297  if (state != eSTATE_IDLE && state != eSTATE_RELEASED)
298  {
299  StopInternal(sendStateChangeEvent);
300  }
301 
302  //Release lock
303  mScheduler.ResumeScheduler();
304  }
305 }
306 
307 /**
308  * @brief Tune to a URL.
309  * DEPRECATED! This is included for backwards compatibility with current Sky AS integration
310  * audioDecoderStreamSync is a broadcom-specific hack (for original xi6 POC build) - this doesn't belong in Tune API.
311  */
312 void PlayerInstanceAAMP::Tune(const char *mainManifestUrl, const char *contentType, bool bFirstAttempt, bool bFinalAttempt,const char *traceUUID,bool audioDecoderStreamSync)
313 {
314  Tune(mainManifestUrl, /*autoPlay*/ true, contentType,bFirstAttempt,bFinalAttempt,traceUUID,audioDecoderStreamSync);
315 }
316 
317 /**
318  * @brief Tune to a URL.
319  */
320 void PlayerInstanceAAMP::Tune(const char *mainManifestUrl, bool autoPlay, const char *contentType, bool bFirstAttempt, bool bFinalAttempt,const char *traceUUID,bool audioDecoderStreamSync)
321 {
322 #ifdef AMLOGIC
323  ManageAsyncTuneConfig(mainManifestUrl);
324 #endif
326  {
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();
330 
331  mScheduler.ScheduleTask(AsyncTaskObj(
332  [manifest, autoPlay , cType, bFirstAttempt, bFinalAttempt, sTraceUUID, audioDecoderStreamSync](void *data)
333  {
334  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
335  const char * trace_uuid = sTraceUUID.empty() ? nullptr : sTraceUUID.c_str();
336 
337  instance->TuneInternal(manifest.c_str(), autoPlay, cType.c_str(), bFirstAttempt, bFinalAttempt, trace_uuid, audioDecoderStreamSync);
338  },
339  (void *) this,
340  __FUNCTION__));
341  }
342  else
343  {
344  TuneInternal(mainManifestUrl, autoPlay , contentType, bFirstAttempt, bFinalAttempt,traceUUID,audioDecoderStreamSync);
345  }
346 }
347 
348 /**
349  * @brief Tune to a URL.
350  */
351 void PlayerInstanceAAMP::TuneInternal(const char *mainManifestUrl, bool autoPlay, const char *contentType, bool bFirstAttempt, bool bFinalAttempt,const char *traceUUID,bool audioDecoderStreamSync)
352 {
353  PrivAAMPState state;
354  if(aamp){
355 
356  aamp->StopPausePositionMonitoring("Tune() called");
357 
358  aamp->GetState(state);
359  bool IsOTAtoOTA = false;
360 
361  if((aamp->IsOTAContent()) && (NULL != mainManifestUrl))
362  {
363  /* OTA to OTA tune does not need to call stop. */
364  std::string urlStr(mainManifestUrl); // for convenience, convert to std::string
365  if((urlStr.rfind("live:",0)==0) || (urlStr.rfind("tune:",0)==0))
366  {
367  IsOTAtoOTA = true;
368  }
369  }
370 
371  if ((state != eSTATE_IDLE) && (state != eSTATE_RELEASED) && (!IsOTAtoOTA))
372  {
373  //Calling tune without closing previous tune
374  StopInternal(false);
375  }
377  aamp->Tune(mainManifestUrl, autoPlay, contentType, bFirstAttempt, bFinalAttempt,traceUUID,audioDecoderStreamSync);
378  }
379 }
380 
381 
382 /**
383  * @brief Soft stop the player instance.
384  */
386 {
387  // detach is similar to Stop , need to run like stop in Sync mode
388  if(aamp){
389 
390  //Acquire lock
391  mScheduler.SuspendScheduler();
392  aamp->StopPausePositionMonitoring("detach() called");
393  aamp->detach();
394  //Release lock
395  mScheduler.ResumeScheduler();
396 
397  }
398 }
399 
400 /**
401  * @brief Register event handler.
402  */
404 {
405  aamp->RegisterEvents(eventListener);
406 }
407 
408 /**
409  * @brief UnRegister event handler.
410  */
412 {
413  aamp->UnRegisterEvents(eventListener);
414 }
415 
416 /**
417  * @brief Set retry limit on Segment injection failure.
418  */
420 {
421  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_SegmentInjectThreshold,value);
422 }
423 
424 /**
425  * @brief Set retry limit on Segment drm decryption failure.
426  */
428 {
429  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DRMDecryptThreshold,value);
430 }
431 
432 /**
433  * @brief Set initial buffer duration in seconds
434  */
436 {
437  NOT_IDLE_AND_NOT_RELEASED_STATE_CHECK_VOID();
438  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_InitialBuffer,durationSec);
439 }
440 
441 /**
442  * @brief Get initial buffer duration in seconds
443  */
445 {
446  int durationSec;
447  GETCONFIGVALUE(eAAMPConfig_InitialBuffer,durationSec);
448  return durationSec;
449 }
450 
451 /**
452  * @brief Set Maximum Cache Size for storing playlist
453  */
455 {
456  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_MaxPlaylistCacheSize,cacheSize);
457 }
458 
459 /**
460  * @brief Set profile ramp down limit.
461  */
463 {
464  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_RampDownLimit,limit);
465 }
466 
467 /**
468  * @brief Get profile ramp down limit.
469  */
471 {
472  int limit;
473  GETCONFIGVALUE(eAAMPConfig_RampDownLimit,limit);
474  return limit;
475 }
476 
477 /**
478  * @brief Set Language preferred Format
479  */
481 {
482  //NOT_IDLE_AND_NOT_RELEASED_STATE_CHECK_VOID(); // why was this here?
483  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LanguageCodePreference,(int)preferredFormat);
484  if( useRole )
485  {
486  AAMPLOG_WARN("SetLanguageFormat bDescriptiveAudioTrack deprecated!" );
487  }
488  //gpGlobalConfig->bDescriptiveAudioTrack = useRole;
489 }
490 
491 /**
492  * @brief Set minimum bitrate value.
493  */
495 {
496  if (bitrate > 0)
497  {
498  AAMPLOG_INFO("Setting minimum bitrate: %ld", bitrate);
499  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_MinBitrate,bitrate);
500  }
501  else
502  {
503  AAMPLOG_WARN("Invalid bitrate value %ld", bitrate);
504  }
505 
506 }
507 
508 /**
509  * @brief Get minimum bitrate value.
510  */
512 {
513  long bitrate;
514  GETCONFIGVALUE(eAAMPConfig_MinBitrate,bitrate);
515  return bitrate;
516 }
517 
518 /**
519  * @brief Set maximum bitrate value.
520  */
522 {
523  if (bitrate > 0)
524  {
525  AAMPLOG_INFO("Setting maximum bitrate : %ld", bitrate);
526  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_MaxBitrate,bitrate);
527  }
528  else
529  {
530  AAMPLOG_WARN("Invalid bitrate value %ld", bitrate);
531  }
532 }
533 
534 /**
535  * @brief Get maximum bitrate value.
536  */
538 {
539  long bitrate;
540  GETCONFIGVALUE(eAAMPConfig_MaxBitrate,bitrate);
541  return bitrate;
542 }
543 
544 /**
545  * @brief Check given rate is valid.
546  */
548 {
549  bool retValue = false;
550  if (abs(rate) <= AAMP_RATE_TRICKPLAY_MAX)
551  {
552  retValue = true;
553  }
554  return retValue;
555 }
556 
557 
558 /**
559  * @brief Set playback rate.
560  */
561 void PlayerInstanceAAMP::SetRate(float rate,int overshootcorrection)
562 {
563  AAMPLOG_INFO("PLAYER[%d] rate=%f.", aamp->mPlayerId, rate);
564  if(aamp)
565  {
566  if (!IsValidRate(rate))
567  {
568  AAMPLOG_WARN("SetRate ignored!! Invalid rate (%f)", rate);
569  return;
570  }
571 
573  {
574  mScheduler.ScheduleTask(AsyncTaskObj([rate,overshootcorrection](void *data)
575  {
576  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
577  instance->SetRateInternal(rate,overshootcorrection);
578  }, (void *) this,__FUNCTION__));
579  }
580  else
581  {
582  SetRateInternal(rate,overshootcorrection);
583  }
584  }
585 }
586 
587 
588 /**
589  * @brief Set playback rate - Internal function
590  */
591 void PlayerInstanceAAMP::SetRateInternal(float rate,int overshootcorrection)
592 {
593  AAMPLOG_INFO("PLAYER[%d] rate=%f.", aamp->mPlayerId, rate);
594 
595  ERROR_STATE_CHECK_VOID();
596 
597  if (!IsValidRate(rate))
598  {
599  AAMPLOG_WARN("SetRate ignored!! Invalid rate (%f)", rate);
600  return;
601  }
602  //Hack For DELIA-51318 convert the incoming rates into acceptable rates
604  {
605  AAMPLOG_WARN("mRepairIframes is true, setting actual rate %f for the received rate %f", getWorkingTrickplayRate(rate), rate);
606  rate = getWorkingTrickplayRate(rate);
607  }
608 
609  aamp->StopPausePositionMonitoring("SetRate() called");
610 
612  {
613  if ( AAMP_SLOWMOTION_RATE != rate && !aamp->mIsIframeTrackPresent && rate != AAMP_NORMAL_PLAY_RATE && rate != 0 && aamp->mMediaFormat != eMEDIAFORMAT_PROGRESSIVE)
614  {
615  AAMPLOG_WARN("Ignoring trickplay. No iframe tracks in stream");
616  aamp->NotifySpeedChanged(AAMP_NORMAL_PLAY_RATE); // Send speed change event to XRE to reset the speed to normal play since the trickplay ignored at player level.
617  return;
618  }
619  if(!(aamp->mbPlayEnabled) && aamp->pipeline_paused && (AAMP_RATE_PAUSE != rate) && (aamp->mbSeeked || !aamp->mbDetached))
620  {
621  AAMPLOG_WARN("PLAYER[%d] Player %s=>%s.", aamp->mPlayerId, STRBGPLAYER, STRFGPLAYER );
622  aamp->mbPlayEnabled = true;
623  if (AAMP_NORMAL_PLAY_RATE == rate)
624  {
626  aamp->mStreamSink->Configure(aamp->mVideoFormat, aamp->mAudioFormat, aamp->mAuxFormat, aamp->mSubtitleFormat, aamp->mpStreamAbstractionAAMP->GetESChangeStatus(), aamp->mpStreamAbstractionAAMP->GetAudioFwdToAuxStatus());
627  aamp->ResumeDownloads(); //To make sure that the playback resumes after a player switch if player was in paused state before being at background
629  aamp->mStreamSink->Stream();
630  aamp->pipeline_paused = false;
631  aamp->mbSeeked = false;
632  return;
633  }
634  else if(AAMP_RATE_PAUSE != rate)
635  {
636  AAMPLOG_INFO("Player switched at trickplay %f", rate);
637  aamp->playerStartedWithTrickPlay = true; //to be used to show atleast one frame
638  }
639  }
640  bool retValue = true;
641  if ( AAMP_SLOWMOTION_RATE != rate && rate > 0 && aamp->IsLive() && aamp->mpStreamAbstractionAAMP->IsStreamerAtLivePoint() && aamp->rate >= AAMP_NORMAL_PLAY_RATE && !aamp->mbDetached)
642  {
643  AAMPLOG_WARN("Already at logical live point, hence skipping operation");
645  return;
646  }
647 
648  // DELIA-39691 If input rate is same as current playback rate, skip duplicate operation
649  // Additional check for pipeline_paused is because of 0(PAUSED) -> 1(PLAYING), where aamp->rate == 1.0 in PAUSED state
650  if ((!aamp->pipeline_paused && rate == aamp->rate && !aamp->GetPauseOnFirstVideoFrameDisp()) || (rate == 0 && aamp->pipeline_paused))
651  {
652  AAMPLOG_WARN("Already running at playback rate(%f) pipeline_paused(%d), hence skipping set rate for (%f)", aamp->rate, aamp->pipeline_paused, rate);
653  return;
654  }
655 
656  //DELIA-30274 -- Get the trick play to a closer position
657  //Logic adapted
658  // XRE gives fixed overshoot position , not suited for aamp . So ignoring overshoot correction value
659  // instead use last reported posn vs the time player get play command
660  // a. During trickplay , last XRE reported position is aamp->mNewSeekInfo.getInfo().Position()
661  /// and last reported time is aamp->mNewSeekInfo.getInfo().UpdateTime()
662  // b. Calculate the time delta from last reported time
663  // c. Using this diff , calculate the best/nearest match position (works out 70-80%)
664  // d. If time delta is < 100ms ,still last video fragment rendering is not removed ,but position updated very recently
665  // So switch last displayed position - NewPosn -= Posn - ((aamp->rate/4)*1000)
666  // e. If time delta is > 950ms , possibility of next frame to come by the time play event is processed.
667  //So go to next fragment which might get displayed
668  // f. If none of above ,maintain the last displayed position .
669  //
670  // h. TODO (again trial n error) - for 3x/4x , within 1sec there might multiple frame displayed . Can use timedelta to calculate some more near,to be tried
671  const auto SeekInfo = aamp->mNewSeekInfo.GetInfo();
672 
673  const int timeDeltaFromProgReport = SeekInfo.getTimeSinceUpdateMs();
674 
675  //Skip this logic for either going to paused to coming out of paused scenarios with HLS
676  //What we would like to avoid here is the update of seek_pos_seconds because gstreamer position will report proper position
677  //Check for 1.0 -> 0.0 and 0.0 -> 1.0 usecase and avoid below logic
678  if (!((aamp->rate == AAMP_NORMAL_PLAY_RATE && rate == 0) || (aamp->pipeline_paused && rate == AAMP_NORMAL_PLAY_RATE)))
679  {
680  // when switching from trick to play mode only
681  if(aamp->rate && ( AAMP_SLOWMOTION_RATE == rate || rate == AAMP_NORMAL_PLAY_RATE) && !aamp->pipeline_paused)
682  {
683  const auto seek_pos_seconds_copy = aamp->seek_pos_seconds; //ensure the same value of seek_pos_seconds used in the check is logged
684  if(!SeekInfo.isPositionValid(seek_pos_seconds_copy))
685  {
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());
687  }
688  else
689  {
690  double newSeekPosInSec = -1;
692  {
693  // Get the last frame position when resume from the trick play.
694  newSeekPosInSec = (SeekInfo.getPosition()/1000);
695  }
696  else
697  {
698  if(timeDeltaFromProgReport > 950) // diff > 950 mSec
699  {
700  // increment by 1x trickplay frame , next possible displayed frame
701  newSeekPosInSec = (SeekInfo.getPosition()+(aamp->rate*1000))/1000;
702  }
703  else if(timeDeltaFromProgReport > 100) // diff > 100 mSec
704  {
705  // Get the last shown frame itself
706  newSeekPosInSec = SeekInfo.getPosition()/1000;
707  }
708  else
709  {
710  // Go little back to last shown frame
711  newSeekPosInSec = (SeekInfo.getPosition()-(aamp->rate*1000))/1000;
712  }
713  }
714 
715  if (newSeekPosInSec >= 0)
716  {
717  /* Note circular calculation:
718  * newSeekPosInSec is based on aamp->mNewSeekInfo
719  * aamp->mNewSeekInfo's position value is based on PrivateInstanceAAMP::GetPositionMilliseconds()
720  * PrivateInstanceAAMP::GetPositionMilliseconds() uses seek_pos_seconds
721  */
722  aamp->seek_pos_seconds = newSeekPosInSec;
723  }
724  else
725  {
726  AAMPLOG_WARN("new seek_pos_seconds calculated is invalid(%f), discarding it!", newSeekPosInSec);
727  }
728  }
729  }
730  else
731  {
732  // Coming out of pause mode(aamp->rate=0) or when going into pause mode (rate=0)
733  // Show the last position
735  }
736 
737  aamp->trickStartUTCMS = -1;
738  }
739  else
740  {
741  // DELIA-39530 - For 1.0->0.0 and 0.0->1.0 if eAAMPConfig_EnableGstPositionQuery is enabled, GStreamer position query will give proper value
742  // Fallback case added for when eAAMPConfig_EnableGstPositionQuery is disabled, since we will be using elapsedTime to calculate position and
743  // trickStartUTCMS has to be reset
745  {
747  aamp->trickStartUTCMS = -1;
748  }
749  }
750 
751  if( AAMP_SLOWMOTION_RATE == rate )
752  {
753  /* Handling of fwd slowmotion playback */
754  SetSlowMotionPlayRate(rate);
755  aamp->NotifySpeedChanged(rate, false);
756 
757  return;
758  }
759 
760  AAMPLOG_WARN("aamp_SetRate (%f)overshoot(%d) ProgressReportDelta:(%d) ", rate,overshootcorrection,timeDeltaFromProgReport);
761  AAMPLOG_WARN("aamp_SetRate rate(%f)->(%f) cur pipeline: %s. Adj position: %f Play/Pause Position:%lld", aamp->rate,rate,aamp->pipeline_paused ? "paused" : "playing",aamp->seek_pos_seconds,aamp->GetPositionMilliseconds()); // current position relative to tune time
762 
763  if (!aamp->mSeekFromPausedState && (rate == aamp->rate) && !aamp->mbDetached)
764  { // no change in desired play rate
765  // no deferring for playback resume
766  if (aamp->pipeline_paused && rate != 0)
767  { // but need to unpause pipeline
768  AAMPLOG_INFO("Resuming Playback at Position '%lld'.", aamp->GetPositionMilliseconds());
769  // check if unpausing in the middle of fragments caching
771  {
773  retValue = aamp->mStreamSink->Pause(false, false);
774  aamp->NotifyFirstBufferProcessed(); //required since buffers are already cached in paused state
775  }
776  aamp->pipeline_paused = false;
778  }
779  }
780  else if (rate == 0)
781  {
782  if (!aamp->pipeline_paused)
783  {
785  aamp->StopDownloads();
786  retValue = aamp->mStreamSink->Pause(true, false);
787  aamp->pipeline_paused = true;
788  }
789  }
790  else
791  {
792  //Enable playback if setRate call after detach
793  if(aamp->mbDetached){
794  aamp->mbPlayEnabled = true;
795  }
796 
797  TuneType tuneTypePlay = eTUNETYPE_SEEK;
799  {
800  tuneTypePlay = eTUNETYPE_SEEKTOLIVE;
801  aamp->mJumpToLiveFromPause = false;
802  }
803  /* if Gstreamer pipeline set to paused state by user, change it to playing state */
804  if( aamp->pipeline_paused == true )
805  {
806  aamp->mStreamSink->Pause(false, false);
807  }
808  aamp->rate = rate;
809  aamp->pipeline_paused = false;
810  aamp->mSeekFromPausedState = false;
811  /* Clear setting playerrate flag */
812  aamp->mSetPlayerRateAfterFirstframe=false;
816  aamp->TuneHelper(tuneTypePlay); // this unpauses pipeline as side effect
818  }
819 
820  if(retValue)
821  {
822  // Do not update state if fragments caching is ongoing and pipeline not paused,
823  // target state will be updated once caching completed
826  }
827  }
828  else
829  {
830  AAMPLOG_WARN("aamp_SetRate rate[%f] - mpStreamAbstractionAAMP[%p] state[%d]", aamp->rate, aamp->mpStreamAbstractionAAMP, state);
831  }
832 }
833 
834 /**
835  * @brief Set PauseAt position.
836  */
837 void PlayerInstanceAAMP::PauseAt(double position)
838 {
839  if(aamp)
840  {
842  {
843  (void)mScheduler.ScheduleTask(AsyncTaskObj([position](void *data)
844  {
845  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
846  instance->PauseAtInternal(position);
847  }, (void *) this,__FUNCTION__));
848  }
849  else
850  {
851  PauseAtInternal(position);
852  }
853  }
854 }
855 
856 /**
857  * @brief Set PauseAt position - Internal function
858  */
860 {
861  AAMPLOG_WARN("PLAYER[%d] aamp_PauseAt position=%f", aamp->mPlayerId, position);
862 
863  ERROR_STATE_CHECK_VOID();
864 
865  aamp->StopPausePositionMonitoring("PauseAt() called");
866 
867  if (position >= 0)
868  {
869  if (!aamp->pipeline_paused)
870  {
871  aamp->StartPausePositionMonitoring(static_cast<long long>(position * 1000));
872  }
873  else
874  {
875  AAMPLOG_WARN("PauseAt called when already paused");
876  }
877  }
878 }
879 
880 static gboolean SeekAfterPrepared(gpointer ptr)
881 {
883  bool sentSpeedChangedEv = false;
884  bool isSeekToLiveOrEnd = false;
885  TuneType tuneType = eTUNETYPE_SEEK;
886  PrivAAMPState state;
887  aamp->GetState(state);
888  if( state == eSTATE_ERROR){
889  AAMPLOG_WARN("operation is not allowed when player in eSTATE_ERROR state !");\
890  return false;
891  }
892 
893  if (AAMP_SEEK_TO_LIVE_POSITION == aamp->seek_pos_seconds )
894  {
895  isSeekToLiveOrEnd = true;
896  }
897 
898  AAMPLOG_WARN("aamp_Seek(%f) and seekToLiveOrEnd(%d)", aamp->seek_pos_seconds, isSeekToLiveOrEnd);
899 
900  if (isSeekToLiveOrEnd)
901  {
902  if (aamp->IsLive())
903  {
904  tuneType = eTUNETYPE_SEEKTOLIVE;
905  }
906  else
907  {
908  tuneType = eTUNETYPE_SEEKTOEND;
909  }
910  }
911 
913  {
914  double currPositionSecs = aamp->GetPositionSeconds();
915  if ((tuneType == eTUNETYPE_SEEKTOLIVE) || (aamp->seek_pos_seconds >= currPositionSecs))
916  {
917  AAMPLOG_WARN("Already at live point, skipping operation since requested position(%f) >= currPosition(%f) or seekToLive(%d)", aamp->seek_pos_seconds, currPositionSecs, isSeekToLiveOrEnd);
918  aamp->NotifyOnEnteringLive();
919  return false;
920  }
921  }
922 
923  if ((aamp->mbPlayEnabled) && aamp->pipeline_paused)
924  {
925  // resume downloads and clear paused flag for foreground instance. state change will be done
926  // on streamSink configuration.
927  AAMPLOG_WARN("paused state, so resume downloads");
928  aamp->pipeline_paused = false;
929  aamp->ResumeDownloads();
930  sentSpeedChangedEv = true;
931  }
932 
933  if (tuneType == eTUNETYPE_SEEK)
934  {
935  AAMPLOG_WARN("tune type is SEEK");
936  }
937  if (aamp->rate != AAMP_NORMAL_PLAY_RATE)
938  {
939  aamp->rate = AAMP_NORMAL_PLAY_RATE;
940  sentSpeedChangedEv = true;
941  }
942  if (aamp->mpStreamAbstractionAAMP)
943  { // for seek while streaming
944 
945  /* LLAMA-7124
946  * PositionMilisecondLock is intended to ensure both state and seek_pos_seconds (in TuneHelper)
947  * are updated before GetPositionMilliseconds() can be used*/
948  auto PositionMilisecondLocked = aamp->LockGetPositionMilliseconds();
949  aamp->SetState(eSTATE_SEEKING);
950  /* Clear setting playerrate flag */
951  aamp->mSetPlayerRateAfterFirstframe=false;
952  aamp->AcquireStreamLock();
953  aamp->TuneHelper(tuneType);
954  if(PositionMilisecondLocked)
955  {
957  }
958  aamp->ReleaseStreamLock();
959  if (sentSpeedChangedEv)
960  {
961  aamp->NotifySpeedChanged(aamp->rate, false);
962  }
963  }
964  return false; // G_SOURCE_REMOVE = false , G_SOURCE_CONTINUE = true
965 }
966 
967 
968 /**
969  * @brief Seek to a time.
970  */
971 void PlayerInstanceAAMP::Seek(double secondsRelativeToTuneTime, bool keepPaused)
972 {
973  if(aamp)
974  {
975  PrivAAMPState state;
976  aamp->GetState(state);
977  if(mAsyncTuneEnabled && state != eSTATE_IDLE && state != eSTATE_RELEASED)
978  {
979  mScheduler.ScheduleTask(AsyncTaskObj([secondsRelativeToTuneTime,keepPaused](void *data)
980  {
981  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
982  instance->SeekInternal(secondsRelativeToTuneTime,keepPaused);
983  }, (void *) this,__FUNCTION__));
984  }
985  else
986  {
987  SeekInternal(secondsRelativeToTuneTime,keepPaused);
988  }
989  }
990 }
991 
992 
993 /**
994  * @brief Seek to a time - Internal function
995  */
996 void PlayerInstanceAAMP::SeekInternal(double secondsRelativeToTuneTime, bool keepPaused)
997 {
998  bool sentSpeedChangedEv = false;
999  bool isSeekToLiveOrEnd = false;
1000  TuneType tuneType = eTUNETYPE_SEEK;
1001 
1002  ERROR_STATE_CHECK_VOID();
1003 
1004  aamp->StopPausePositionMonitoring("Seek() called");
1005 
1006  if ((aamp->mMediaFormat == eMEDIAFORMAT_HLS || aamp->mMediaFormat == eMEDIAFORMAT_HLS_MP4) && (eSTATE_INITIALIZING == state) && aamp->mpStreamAbstractionAAMP)
1007  {
1008  AAMPLOG_WARN("aamp_Seek(%f) at the middle of tune, no fragments downloaded yet.state(%d), keep paused(%d)", secondsRelativeToTuneTime,state, keepPaused);
1009  aamp->mpStreamAbstractionAAMP->SeekPosUpdate(secondsRelativeToTuneTime);
1010  SETCONFIGVALUE(AAMP_TUNE_SETTING,eAAMPConfig_PlaybackOffset,secondsRelativeToTuneTime);
1011  }
1012  else if (eSTATE_INITIALIZED == state || eSTATE_PREPARING == state)
1013  {
1014  AAMPLOG_WARN("aamp_Seek(%f) will be called after preparing the content.state(%d), keep paused(%d)", secondsRelativeToTuneTime,state, keepPaused);
1015  aamp->seek_pos_seconds = secondsRelativeToTuneTime ;
1016  SETCONFIGVALUE(AAMP_TUNE_SETTING,eAAMPConfig_PlaybackOffset,secondsRelativeToTuneTime);
1017  g_idle_add(SeekAfterPrepared, (gpointer)aamp);
1018  }
1019  else
1020  {
1021  if (secondsRelativeToTuneTime == AAMP_SEEK_TO_LIVE_POSITION)
1022  {
1023  isSeekToLiveOrEnd = true;
1024  }
1025 
1026  AAMPLOG_WARN("aamp_Seek(%f) and seekToLiveOrEnd(%d) state(%d), keep paused(%d)", secondsRelativeToTuneTime, isSeekToLiveOrEnd,state, keepPaused);
1027 
1028  if (isSeekToLiveOrEnd)
1029  {
1030  if (aamp->IsLive())
1031  {
1032  tuneType = eTUNETYPE_SEEKTOLIVE;
1033  }
1034  else
1035  {
1036  tuneType = eTUNETYPE_SEEKTOEND;
1037  }
1038  }
1039 
1042  aamp->IsTSBSupported() &&
1043  !isSeekToLiveOrEnd)
1044  {
1045  secondsRelativeToTuneTime += aamp->mProgressReportOffset;
1046  AAMPLOG_WARN("aamp_Seek position adjusted to absolute value for TSB : %lf", secondsRelativeToTuneTime);
1047  }
1048 
1050  {
1051  double currPositionSecs = aamp->GetPositionSeconds();
1052 
1053  if ((tuneType == eTUNETYPE_SEEKTOLIVE) || secondsRelativeToTuneTime >= currPositionSecs)
1054  {
1055  AAMPLOG_WARN("Already at live point, skipping operation since requested position(%f) >= currPosition(%f) or seekToLive(%d)", secondsRelativeToTuneTime, currPositionSecs, isSeekToLiveOrEnd);
1057  return;
1058  }
1059  }
1060 
1061  bool seekWhilePause = false;
1062  // For autoplay false, pipeline_paused will be true, which denotes a non-playing state
1063  // as the GST pipeline is not yet created, avoid setting pipeline_paused to false here
1064  // which might mess up future SetRate call for BG->FG
1066  {
1067 
1068  if(keepPaused && aamp->mMediaFormat != eMEDIAFORMAT_PROGRESSIVE)
1069  {
1070  // Enable seek while paused if not Progressive stream
1071  seekWhilePause = true;
1072  }
1073 
1074  // Clear paused flag. state change will be done
1075  // on streamSink configuration.
1076  if (!seekWhilePause)
1077  {
1078  AAMPLOG_WARN("Clearing paused flag");
1079  aamp->pipeline_paused = false;
1080  sentSpeedChangedEv = true;
1081  }
1082  // Resume downloads
1083  AAMPLOG_INFO("Resuming downloads");
1084  aamp->ResumeDownloads();
1085  }
1086 
1087  /* LLAMA-7124
1088  * PositionMilisecondLock is intended to ensure both state and seek_pos_seconds
1089  * are updated before GetPositionMilliseconds() can be used*/
1090  auto PositionMilisecondLocked = aamp->LockGetPositionMilliseconds();
1091 
1092  if (tuneType == eTUNETYPE_SEEK)
1093  {
1094  SETCONFIGVALUE(AAMP_TUNE_SETTING,eAAMPConfig_PlaybackOffset,secondsRelativeToTuneTime);
1095  aamp->seek_pos_seconds = secondsRelativeToTuneTime;
1096  }
1097  else if (tuneType == eTUNETYPE_SEEKTOEND)
1098  {
1099  SETCONFIGVALUE(AAMP_TUNE_SETTING,eAAMPConfig_PlaybackOffset,-1);
1100  aamp->seek_pos_seconds = -1;
1101  }
1102 
1103  if (aamp->rate != AAMP_NORMAL_PLAY_RATE)
1104  {
1105  aamp->rate = AAMP_NORMAL_PLAY_RATE;
1106  sentSpeedChangedEv = true;
1107  }
1108 
1109  /**Set the flag true to indicate seeked **/
1110  aamp->mbSeeked = true;
1111 
1113  { // for seek while streaming
1115  if(PositionMilisecondLocked)
1116  {
1118  }
1119  /* Clear setting playerrate flag */
1120  aamp->mSetPlayerRateAfterFirstframe=false;
1122  aamp->TuneHelper(tuneType, seekWhilePause);
1124  if (sentSpeedChangedEv && (!seekWhilePause) )
1125  {
1126  aamp->NotifySpeedChanged(aamp->rate, false);
1127  }
1128  }
1129  else if(PositionMilisecondLocked)
1130  {
1132  }
1133  if (aamp->mbPlayEnabled)
1134  {
1135  // Clear seeked flag for FG instance after SEEK
1136  aamp->mbSeeked = false;
1137  }
1138  }
1139 }
1140 
1141 /**
1142  * @brief Seek to live point.
1143  */
1144 void PlayerInstanceAAMP::SeekToLive(bool keepPaused)
1145 {
1146  if(aamp)
1147  {
1148  if(mAsyncTuneEnabled)
1149  {
1150 
1151  mScheduler.ScheduleTask(AsyncTaskObj([keepPaused](void *data)
1152  {
1153  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
1154  instance->SeekInternal(AAMP_SEEK_TO_LIVE_POSITION, keepPaused);
1155  }, (void *) this,__FUNCTION__));
1156  }
1157  else
1158  {
1159  SeekInternal(AAMP_SEEK_TO_LIVE_POSITION, keepPaused);
1160  }
1161  }
1162 }
1163 
1164 /**
1165  * @brief Set slow motion player speed.
1166  */
1168 {
1169  ERROR_OR_IDLE_STATE_CHECK_VOID();
1170  AAMPLOG_WARN("SetSlowMotionPlay(%f)", rate );
1171 
1173  {
1175  {
1176  //Clear pause state flag & resume download
1177  aamp->pipeline_paused = false;
1178  aamp->ResumeDownloads();
1179  }
1180 
1181  if(AAMP_SLOWMOTION_RATE == rate)
1182  {
1183  aamp->mSetPlayerRateAfterFirstframe=true;
1184  aamp->playerrate=rate;
1185  }
1186  AAMPLOG_WARN("SetSlowMotionPlay(%f) %lf", rate, aamp->seek_pos_seconds );
1188  aamp->TeardownStream(false);
1189  aamp->rate = AAMP_NORMAL_PLAY_RATE;
1192  }
1193  else
1194  {
1195  AAMPLOG_WARN("SetSlowMotionPlay rate[%f] - mpStreamAbstractionAAMP[%p] state[%d]", aamp->rate, aamp->mpStreamAbstractionAAMP, state);
1196  }
1197 }
1198 
1199 /**
1200  * @brief Seek to a time and playback with a new rate.
1201  */
1202 void PlayerInstanceAAMP::SetRateAndSeek(int rate, double secondsRelativeToTuneTime)
1203 {
1204  TuneType tuneType = eTUNETYPE_SEEK;
1205 
1206  ERROR_OR_IDLE_STATE_CHECK_VOID();
1207  AAMPLOG_WARN("aamp_SetRateAndSeek(%d)(%f)", rate, secondsRelativeToTuneTime);
1208  if (!IsValidRate(rate))
1209  {
1210  AAMPLOG_WARN("SetRate ignored!! Invalid rate (%d)", rate);
1211  return;
1212  }
1213 
1214  //Hack For DELIA-51318 convert the incoming rates into acceptable rates
1216  {
1217  AAMPLOG_WARN("mRepairIframes is true, setting actual rate %f for the received rate %d", getWorkingTrickplayRate(rate), rate);
1218  rate = getWorkingTrickplayRate(rate);
1219  }
1220 
1221  if (secondsRelativeToTuneTime == AAMP_SEEK_TO_LIVE_POSITION)
1222  {
1223  if (aamp->IsLive())
1224  {
1225  tuneType = eTUNETYPE_SEEKTOLIVE;
1226  }
1227  else
1228  {
1229  tuneType = eTUNETYPE_SEEKTOEND;
1230  }
1231  }
1232 
1234  {
1235  if ((!aamp->mIsIframeTrackPresent && rate != AAMP_NORMAL_PLAY_RATE && rate != 0))
1236  {
1237  AAMPLOG_WARN("Ignoring trickplay. No iframe tracks in stream");
1238  aamp->NotifySpeedChanged(AAMP_NORMAL_PLAY_RATE); // Send speed change event to XRE to reset the speed to normal play since the trickplay ignored at player level.
1239  return;
1240  }
1241  /* Clear setting playerrate flag */
1242  aamp->mSetPlayerRateAfterFirstframe=false;
1244  aamp->TeardownStream(false);
1245  aamp->seek_pos_seconds = secondsRelativeToTuneTime;
1246  aamp->rate = rate;
1247  aamp->TuneHelper(tuneType);
1249  if(rate == 0)
1250  {
1251  if (!aamp->pipeline_paused)
1252  {
1253  AAMPLOG_WARN("Pausing Playback at Position '%lld'.", aamp->GetPositionMilliseconds());
1255  aamp->StopDownloads();
1256  bool retValue = aamp->mStreamSink->Pause(true, false);
1257  aamp->pipeline_paused = true;
1258  }
1259  }
1260  }
1261  else
1262  {
1263  AAMPLOG_WARN("aamp_SetRateAndSeek rate[%f] - mpStreamAbstractionAAMP[%p] state[%d]", aamp->rate, aamp->mpStreamAbstractionAAMP, state);
1264  }
1265 }
1266 
1267 /**
1268  * @brief Set video rectangle.
1269  */
1270 void PlayerInstanceAAMP::SetVideoRectangle(int x, int y, int w, int h)
1271 {
1272  ERROR_STATE_CHECK_VOID();
1273  if(aamp)
1274  {
1275  aamp->SetVideoRectangle(x, y, w, h);
1276  }
1277 }
1278 
1279 /**
1280  * @brief Set video zoom.
1281  */
1283 {
1284  ERROR_STATE_CHECK_VOID();
1285  if(aamp){
1286  aamp->zoom_mode = zoom;
1289  {
1290  aamp->SetVideoZoom(zoom);
1291  }
1292  else
1293  {
1294  AAMPLOG_WARN("Player is in state (eSTATE_IDLE), value has been cached");
1295  }
1297  }// end of if aamp
1298 }
1299 
1300 /**
1301  * @brief Enable/ Disable Video.
1302  */
1304 {
1305  ERROR_STATE_CHECK_VOID();
1306  if(aamp){
1307  AAMPLOG_WARN(" mute == %s subtitles_muted == %s", muted?"true":"false", aamp->subtitles_muted?"true":"false");
1308  aamp->video_muted = muted;
1309 
1310  //If lock could not be acquired, then cache it
1311  if(aamp->TryStreamLock())
1312  {
1314  {
1315  aamp->SetVideoMute(muted);
1316  SetCCStatus(muted ? false : !aamp->subtitles_muted);
1317  }
1318  else
1319  {
1320  AAMPLOG_WARN("Player is in state eSTATE_IDLE, value has been cached");
1321  aamp->mApplyCachedVideoMute = true;
1322  }
1324  }
1325  else
1326  {
1327  AAMPLOG_WARN("StreamLock is not available, value has been cached");
1328  aamp->mApplyCachedVideoMute = true;
1329  }
1330  }
1331 }
1332 
1333 /**
1334  * @brief Enable/ Disable Subtitles.
1335  *
1336  * @param muted - true to disable subtitles, false to enable subtitles.
1337  */
1339 {
1340  ERROR_STATE_CHECK_VOID();
1341 
1342  AAMPLOG_WARN(" mute == %s", muted?"true":"false");
1343  aamp->subtitles_muted = muted;
1346  {
1347  aamp->SetSubtitleMute(muted);
1348  }
1349  else
1350  {
1351  AAMPLOG_WARN("Player is in state eSTATE_IDLE, value has been cached");
1352  }
1354 }
1355 
1356 /**
1357  * @brief Set Audio Volume.
1358  *
1359  * @param volume - Minimum 0, maximum 100.
1360  */
1362 {
1363  ERROR_STATE_CHECK_VOID();
1364  AAMPLOG_WARN(" volume == %d", volume);
1365  if(aamp){
1366  if (volume < AAMP_MINIMUM_AUDIO_LEVEL || volume > AAMP_MAXIMUM_AUDIO_LEVEL)
1367  {
1368  AAMPLOG_WARN("Audio level (%d) is outside the range supported.. discarding it..",
1369  volume);
1370  }
1371  else if (aamp != NULL)
1372  {
1373  aamp->audio_volume = volume;
1375  {
1376  aamp->SetAudioVolume(volume);
1377  }
1378  else
1379  {
1380  AAMPLOG_WARN("Player is in state eSTATE_IDLE, value has been cached");
1381  }
1382  }
1383  }// end of if aamp
1384 }
1385 
1386 /**
1387  * @brief Set Audio language.
1388  */
1389 void PlayerInstanceAAMP::SetLanguage(const char* language)
1390 {
1391  ERROR_STATE_CHECK_VOID();
1392  if(aamp){
1393  PrivAAMPState state;
1394  aamp->GetState(state);
1395  if (mAsyncTuneEnabled && state != eSTATE_IDLE && state != eSTATE_RELEASED)
1396  {
1397  std::string sLanguage = std::string(language);
1398  mScheduler.ScheduleTask(AsyncTaskObj(
1399  [sLanguage](void *data)
1400  {
1401  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
1402  instance->SetPreferredLanguages(sLanguage.c_str());
1403  }, (void *) this,__FUNCTION__));
1404  }
1405  else
1406  {
1407  SetPreferredLanguages(language);
1408  }
1409  }// end of if
1410 }
1411 
1412 /**
1413  * @brief Set array of subscribed tags.
1414  */
1415 void PlayerInstanceAAMP::SetSubscribedTags(std::vector<std::string> subscribedTags)
1416 {
1417  ERROR_STATE_CHECK_VOID();
1418  if(aamp){
1419  aamp->subscribedTags = subscribedTags;
1420 
1421  for (int i=0; i < aamp->subscribedTags.size(); i++) {
1422  AAMPLOG_WARN(" subscribedTags[%d] = '%s'", i, subscribedTags.at(i).data());
1423  }
1424  }// end of if aamp
1425 }
1426 
1427 /**
1428  * @brief Subscribe array of http response headers.
1429  */
1430 void PlayerInstanceAAMP::SubscribeResponseHeaders(std::vector<std::string> responseHeaders)
1431 {
1432  ERROR_STATE_CHECK_VOID();
1433 
1434  if(aamp){
1435  aamp->responseHeaders = responseHeaders;
1436 
1437  for (int header=0; header < aamp->responseHeaders.size(); header++) {
1438  AAMPLOG_INFO(" responseHeaders[%d] = '%s'", header, responseHeaders.at(header).data());
1439  }
1440  } // end of if aaamp
1441 }
1442 
1443 #ifdef SUPPORT_JS_EVENTS
1444 
1445 /**
1446  * @brief Load AAMP JS object in the specified JS context.
1447  */
1448 void PlayerInstanceAAMP::LoadJS(void* context)
1449 {
1450  AAMPLOG_WARN("[AAMP_JS] (%p)", context);
1451  if (mJSBinding_DL) {
1452  void(*loadJS)(void*, void*);
1453  const char* szLoadJS = "aamp_LoadJS";
1454  loadJS = (void(*)(void*, void*))dlsym(mJSBinding_DL, szLoadJS);
1455  if (loadJS) {
1456  AAMPLOG_WARN("[AAMP_JS] dlsym(%p, \"%s\")=%p", mJSBinding_DL, szLoadJS, loadJS);
1457  loadJS(context, this);
1458  }
1459  }
1460 }
1461 
1462 /**
1463  * @brief Unload AAMP JS object in the specified JS context.
1464  */
1465 void PlayerInstanceAAMP::UnloadJS(void* context)
1466 {
1467  AAMPLOG_WARN("[AAMP_JS] (%p)", context);
1468  if (mJSBinding_DL) {
1469  void(*unloadJS)(void*);
1470  const char* szUnloadJS = "aamp_UnloadJS";
1471  unloadJS = (void(*)(void*))dlsym(mJSBinding_DL, szUnloadJS);
1472  if (unloadJS) {
1473  AAMPLOG_WARN("[AAMP_JS] dlsym(%p, \"%s\")=%p", mJSBinding_DL, szUnloadJS, unloadJS);
1474  unloadJS(context);
1475  }
1476  }
1477 }
1478 #endif
1479 
1480 /**
1481  * @brief Support multiple listeners for multiple event type
1482  */
1484 {
1485  if(aamp){
1486  aamp->AddEventListener(eventType, eventListener);
1487  }
1488 }
1489 
1490 /**
1491  * @brief Remove event listener for eventType.
1492  */
1494 {
1495  if(aamp){
1496  aamp->RemoveEventListener(eventType, eventListener);
1497  }
1498 }
1499 
1500 /**
1501  * @brief To check whether the asset is live or not.
1502  */
1504 {
1505  ERROR_OR_IDLE_STATE_CHECK_VAL(false);
1506  bool isLive = false;
1507  if(aamp) isLive = aamp->IsLive();
1508  return isLive;
1509 }
1510 /**
1511  * @brief Get jsinfo config value (default false)
1512  */
1513 
1515 
1516  {
1518  }
1519 
1520 /**
1521  * @brief Get current audio language.
1522  */
1524 {
1525  ERROR_OR_IDLE_STATE_CHECK_VAL("");
1526  static char lang[MAX_LANGUAGE_TAG_LENGTH];
1527  lang[0] = 0;
1529 
1530  int trackIndex = GetAudioTrack();
1531  if( trackIndex>=0 )
1532  {
1533  std::vector<AudioTrackInfo> trackInfo = aamp->mpStreamAbstractionAAMP->GetAvailableAudioTracks();
1534  if (!trackInfo.empty())
1535  {
1536  strncpy(lang, trackInfo[trackIndex].language.c_str(), sizeof(lang));
1537  lang[sizeof(lang)-1] = '\0'; //CID:173324 - Buffer size warning
1538  }
1539  }
1540  }// end of if aamp
1541  return lang;
1542 }
1543 
1544 /**
1545  * @brief Get current drm
1546  */
1548 {
1549  ERROR_OR_IDLE_STATE_CHECK_VAL("");
1550  if(aamp){
1551  std::shared_ptr<AampDrmHelper> helper = aamp->GetCurrentDRM();
1552  if (helper)
1553  {
1554  return helper->friendlyName().c_str();
1555  }
1556  }// end of if aamp
1557  return "NONE";
1558 }
1559 
1560 /**
1561  * @brief Applies the custom http headers for page (Injector bundle) received from the js layer
1562  */
1563 void PlayerInstanceAAMP::AddPageHeaders(std::map<std::string, std::string> pageHeaders)
1564 {
1565  ERROR_STATE_CHECK_VOID();
1567  {
1568  for(auto &header : pageHeaders)
1569  {
1570  AAMPLOG_INFO("PrivateInstanceAAMP: applying the http header key: %s, value: %s", header.first.c_str(), header.second.c_str());
1571  aamp->AddCustomHTTPHeader(header.first, std::vector<std::string>{header.second}, false);
1572  }
1573  }
1574 }
1575 
1576 /**
1577  * @brief Add/Remove a custom HTTP header and value.
1578  */
1579 void PlayerInstanceAAMP::AddCustomHTTPHeader(std::string headerName, std::vector<std::string> headerValue, bool isLicenseHeader)
1580 {
1581  ERROR_STATE_CHECK_VOID();
1582  if(aamp){
1583  aamp->AddCustomHTTPHeader(headerName, headerValue, isLicenseHeader);
1584  }
1585 }
1586 
1587 /**
1588  * @brief Set License Server URL.
1589  */
1591 {
1592  ERROR_STATE_CHECK_VOID();
1593  if(aamp){
1594  if (type == eDRM_PlayReady)
1595  {
1596  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PRLicenseServerUrl,std::string(url));
1597  }
1598  else if (type == eDRM_WideVine)
1599  {
1600  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_WVLicenseServerUrl,std::string(url));
1601  }
1602  else if (type == eDRM_ClearKey)
1603  {
1604  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CKLicenseServerUrl,std::string(url));
1605  }
1606  else if (type == eDRM_MAX_DRMSystems)
1607  {
1608  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LicenseServerUrl,std::string(url));
1609  }
1610  else
1611  {
1612  AAMPLOG_ERR("PlayerInstanceAAMP:: invalid drm type(%d) received.", type);
1613  }
1614  }// end of if aamp
1615 }
1616 
1617 /**
1618  * @brief Indicates if session token has to be used with license request or not.
1619  */
1621 {
1622  ERROR_STATE_CHECK_VOID();
1623  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_AnonymousLicenseRequest,isAnonymous);
1624 }
1625 
1626 /**
1627  * @brief Indicates average BW to be used for ABR Profiling.
1628  */
1630 {
1631  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_AvgBWForABR,useAvgBW);
1632 }
1633 
1634 /**
1635  * @brief SetPreCacheTimeWindow Function to Set PreCache Time
1636  */
1638 {
1639  ERROR_STATE_CHECK_VOID();
1640  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PreCachePlaylistTime,nTimeWindow);
1641 }
1642 
1643 /**
1644  * @brief Set VOD Trickplay FPS.
1645  */
1647 {
1648  ERROR_STATE_CHECK_VOID();
1649  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_VODTrickPlayFPS,vodTrickplayFPS);
1650 }
1651 
1652 /**
1653  * @brief Set Linear Trickplay FPS.
1654  */
1655 void PlayerInstanceAAMP::SetLinearTrickplayFPS(int linearTrickplayFPS)
1656 {
1657  ERROR_STATE_CHECK_VOID();
1658  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LinearTrickPlayFPS,linearTrickplayFPS);
1659 }
1660 
1661 /**
1662  * @brief Set Live Offset
1663  */
1664 void PlayerInstanceAAMP::SetLiveOffset(double liveoffset)
1665 {
1666  PLAYING_STATE_CHECK();
1668  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LiveOffset, liveoffset);
1669 }
1670 
1671 /**
1672  * @brief Set Live Offset
1673  */
1675 {
1676  PLAYING_STATE_CHECK();
1678  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LiveOffset4K, liveoffset);
1679 }
1680 
1681 /**
1682  * @brief To set the error code to be used for playback stalled error.
1683  */
1685 {
1686  ERROR_STATE_CHECK_VOID();
1687  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_StallErrorCode,errorCode);
1688 }
1689 
1690 /**
1691  * @brief To set the timeout value to be used for playback stall detection.
1692  */
1694 {
1695  ERROR_STATE_CHECK_VOID();
1696  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_StallTimeoutMS,timeoutMS);
1697 }
1698 
1699 /**
1700  * @brief To set the Playback Position reporting interval.
1701  */
1703 {
1704  ERROR_STATE_CHECK_VOID();
1705  if(reportInterval > 0)
1706  {
1707  // We now want the value in seconds but it is given in milliseconds so convert it here
1708  double dReportInterval = reportInterval;
1709  dReportInterval /= 1000;
1710 
1711  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_ReportProgressInterval,dReportInterval);
1712  }
1713 }
1714 
1715 /**
1716  * @brief To set the max retry attempts for init frag curl timeout failures
1717  */
1719 {
1720  if(count >= 0)
1721  {
1722  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_InitFragmentRetryCount,count);
1723  }
1724 }
1725 
1726 /**
1727  * @brief To get the current playback position.
1728  */
1730 {
1731  ERROR_STATE_CHECK_VAL(0.00);
1732  return aamp->GetPositionSeconds();
1733 }
1734 
1735 /**
1736  * @brief To get the current asset's duration.
1737  */
1739 {
1740  ERROR_OR_IDLE_STATE_CHECK_VAL(0.00);
1741  return (aamp->GetDurationMs() / 1000.00);
1742 }
1743 
1744 
1745 /**
1746  * @fn GetId
1747  *
1748  * @return returns unique id of player,
1749  */
1751  {
1752  int iPlayerId = -1;
1753 
1754  if(NULL != aamp)
1755  {
1756  iPlayerId = aamp->mPlayerId;
1757  }
1758 
1759  return iPlayerId;
1760  }
1761 
1762 /**
1763  * @brief To get the current AAMP state.
1764  */
1766 {
1767  PrivAAMPState currentState = eSTATE_RELEASED;
1768  try
1769  {
1770  std::lock_guard<std::mutex> lock (mPrvAampMtx);
1771  if(NULL == aamp)
1772  {
1773  throw std::invalid_argument("NULL reference");
1774  }
1775  aamp->GetState(currentState);
1776  }
1777  catch (std::exception &e)
1778  {
1779  AAMPLOG_WARN("Invalid access to the instance of PrivateInstanceAAMP (%s), returning %s as current state", e.what(),"eSTATE_RELEASED");
1780  }
1781  return currentState;
1782 }
1783 
1784 /**
1785  * @brief To get the bitrate of current video profile.
1786  */
1788 {
1789  long bitrate = 0;
1790  ERROR_OR_IDLE_STATE_CHECK_VAL(0);
1791  if(aamp){
1794  {
1796  }
1798  } // if aamp
1799  return bitrate;
1800 }
1801 
1802 /**
1803  * @brief To set a preferred bitrate for video profile.
1804  */
1806 {
1807  if (bitrate != 0)
1808  {
1809  // Single bitrate profile selection , with abr disabled
1810  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_EnableABR,false);
1811  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DefaultBitrate,bitrate);
1812  }
1813  else
1814  {
1815  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_EnableABR,true);
1816  long gpDefaultBitRate;
1818  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DefaultBitrate,gpDefaultBitRate);
1819  AAMPLOG_WARN("Resetting default bitrate to %ld", gpDefaultBitRate);
1820  }
1821 }
1822 
1823 /**
1824  * @brief To get the bitrate of current audio profile.
1825  */
1827 {
1828  ERROR_OR_IDLE_STATE_CHECK_VAL(0);
1829  long bitrate = 0;
1830  if(aamp){
1833  {
1835  }
1837  } // end of if
1838  return bitrate;
1839 }
1840 
1841 /**
1842  * @brief To set a preferred bitrate for audio profile.
1843  */
1845 {
1846  //no-op for now
1847 }
1848 
1849 /**
1850  * @brief To get video zoom mode
1851  */
1853 {
1854  ERROR_STATE_CHECK_VAL(0);
1855  return aamp->zoom_mode;
1856 }
1857 
1858 /**
1859  * @brief To get video mute status
1860  */
1862 {
1863  ERROR_STATE_CHECK_VAL(0);
1864  return aamp->video_muted;
1865 }
1866 
1867 /**
1868  * @brief To get the current audio volume.
1869  */
1871 {
1872  ERROR_STATE_CHECK_VAL(0);
1873  if (eSTATE_IDLE == state)
1874  {
1875  AAMPLOG_WARN(" GetAudioVolume is returning cached value since player is at %s",
1876  "eSTATE_IDLE");
1877  }
1878  return aamp->audio_volume;
1879 }
1880 
1881 /**
1882  * @brief To get the current playback rate.
1883  */
1885 {
1886  ERROR_OR_IDLE_STATE_CHECK_VAL(0);
1887  return (aamp->pipeline_paused ? 0 : aamp->rate);
1888 }
1889 
1890 /**
1891  * @brief To get the available video bitrates.
1892  */
1894 {
1895  ERROR_OR_IDLE_STATE_CHECK_VAL(std::vector<long>());
1896  std::vector<long> bitrates;
1897  if(aamp){
1900  {
1902  }
1904  } // end of if aamp
1905  return bitrates;
1906 }
1907 
1908 /**
1909  * @brief To get the available manifest.
1910  */
1912 {
1913  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
1914  GrowableBuffer manifest;
1916  if ((aamp->GetContentType() == ContentType_VOD) && (aamp->mMediaFormat == eMEDIAFORMAT_DASH))
1917  {
1918  std::string manifestUrl = aamp->GetManifestUrl();
1919  memset(&manifest, 0, sizeof(manifest));
1920  if (aamp->getAampCacheHandler()->RetrieveFromPlaylistCache(manifestUrl, &manifest, manifestUrl))
1921  {
1922  /*char pointer to string conversion*/
1923  std::string Manifest(manifest.ptr,manifest.len);
1924  aamp_Free(&manifest);
1925  AAMPLOG_INFO("PlayerInstanceAAMP: manifest retrieved from cache");
1926  return Manifest;
1927  }
1928  }
1929  return "";
1930 }
1931 
1932 /**
1933  * @brief To get the available audio bitrates.
1934  */
1936 {
1937  ERROR_OR_IDLE_STATE_CHECK_VAL(std::vector<long>());
1938  std::vector<long> bitrates;
1939  if(aamp){
1942  {
1944  }
1946  }
1947  return bitrates;
1948 }
1949 
1950 /**
1951  * @brief To set the initial bitrate value.
1952  */
1954 {
1955  ERROR_STATE_CHECK_VOID();
1956  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DefaultBitrate,bitrate);
1957 }
1958 
1959 /**
1960  * @brief To get the initial bitrate value.
1961  */
1963 {
1964  long bitrate;
1965  GETCONFIGVALUE(eAAMPConfig_DefaultBitrate,bitrate);
1966  return bitrate;
1967 }
1968 
1969 /**
1970  * @brief To set the initial bitrate value for 4K assets.
1971  */
1973 {
1974  ERROR_STATE_CHECK_VOID();
1975  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DefaultBitrate4K,bitrate4K);
1976 }
1977 
1978 /**
1979  * @brief To get the initial bitrate value for 4K assets.
1980  */
1982 {
1983  long bitrate4K;
1984  GETCONFIGVALUE(eAAMPConfig_DefaultBitrate4K,bitrate4K);
1985  return bitrate4K;
1986 }
1987 
1988 /**
1989  * @brief To override default curl timeout for playlist/fragment downloads
1990  */
1992 {
1993  ERROR_STATE_CHECK_VOID();
1994  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_NetworkTimeout,timeout);
1995 }
1996 
1997 /**
1998  * @brief Optionally override default HLS main manifest download timeout with app-specific value.
1999  */
2001 {
2002  ERROR_STATE_CHECK_VOID();
2003  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_ManifestTimeout,timeout);
2004 }
2005 
2006 /**
2007  * @brief Optionally override default HLS main manifest download timeout with app-specific value.
2008  */
2010 {
2011  ERROR_STATE_CHECK_VOID();
2012  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PlaylistTimeout,timeout);
2013 }
2014 
2015 /**
2016  * @brief To set the download buffer size value
2017  */
2019 {
2020  ERROR_STATE_CHECK_VOID();
2021  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_MaxFragmentCached,bufferSize);
2022 }
2023 
2024 /**
2025  * @brief Set Preferred DRM.
2026  */
2028 {
2029  ERROR_STATE_CHECK_VOID();
2030  if(drmType != eDRM_NONE)
2031  {
2032  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PreferredDRM,(int)drmType);
2033  aamp->isPreferredDRMConfigured = true;
2034  }
2035  else
2036  {
2037  aamp->isPreferredDRMConfigured = false;
2038  }
2039 }
2040 
2041 /**
2042  * @brief Set Stereo Only Playback.
2043  */
2045 {
2046  ERROR_STATE_CHECK_VOID();
2047  if(bValue)
2048  {
2049  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableEC3,true);
2050  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableAC3,true);
2051  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableAC4,true);
2052  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableATMOS,true);
2053  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_ForceEC3,false);
2054  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_StereoOnly,true);
2055  }
2056  else
2057  {
2058  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableEC3,false);
2059  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableAC3,false);
2060  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableAC4,false);
2061  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableATMOS,false);
2062  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_StereoOnly,false);
2063  }
2064 }
2065 
2066 /**
2067  * @brief Disable 4K Support in player
2068  */
2070 {
2071  ERROR_STATE_CHECK_VOID();
2072  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_Disable4K,bValue);
2073 }
2074 
2075 
2076 /**
2077  * @brief Set Bulk TimedMetadata Reporting flag
2078  */
2080 {
2081  ERROR_STATE_CHECK_VOID();
2082  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_BulkTimedMetaReport,bValue);
2083 }
2084 
2085 /**
2086  * @brief Set unpaired discontinuity retune flag
2087  */
2089 {
2090  ERROR_STATE_CHECK_VOID();
2091  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_RetuneForUnpairDiscontinuity,bValue);
2092 }
2093 
2094 /**
2095  * @brief Set retune configuration for gstpipeline internal data stream error.
2096  */
2098 {
2099  ERROR_STATE_CHECK_VOID();
2100  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_RetuneForGSTError,bValue);
2101 }
2102 
2103 /**
2104  * @brief Setting the alternate contents' (Ads/blackouts) URL
2105  */
2106 void PlayerInstanceAAMP::SetAlternateContents(const std::string &adBreakId, const std::string &adId, const std::string &url)
2107 {
2108  ERROR_OR_IDLE_STATE_CHECK_VOID();
2109  aamp->SetAlternateContents(adBreakId, adId, url);
2110 }
2111 
2112 /**
2113  * @brief To set the network proxy
2114  */
2115 void PlayerInstanceAAMP::SetNetworkProxy(const char * proxy)
2116 {
2117  ERROR_STATE_CHECK_VOID();
2118  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_NetworkProxy ,(std::string)proxy);
2119 }
2120 
2121 /**
2122  * @brief To set the proxy for license request
2123  */
2124 void PlayerInstanceAAMP::SetLicenseReqProxy(const char * licenseProxy)
2125 {
2126  ERROR_STATE_CHECK_VOID();
2127  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LicenseProxy ,(std::string)licenseProxy);
2128 }
2129 
2130 /**
2131  * @brief To set the curl stall timeout value
2132  */
2134 {
2135  ERROR_STATE_CHECK_VOID();
2136  if( stallTimeout >= 0 )
2137  {
2138  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CurlStallTimeout,stallTimeout);
2139  }
2140 }
2141 
2142 /**
2143  * @brief To set the curl download start timeout
2144  */
2146 {
2147  ERROR_STATE_CHECK_VOID();
2148  if( startTimeout >= 0 )
2149  {
2150  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CurlDownloadStartTimeout,startTimeout);
2151  }
2152 }
2153 
2154 /**
2155  * @brief To set the curl download low bandwidth timeout value
2156  */
2158 {
2159  ERROR_STATE_CHECK_VOID();
2160  if( lowBWTimeout >= 0 )
2161  {
2162  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CurlDownloadLowBWTimeout,lowBWTimeout);
2163  }
2164 }
2165 
2166 /**
2167  * @brief Set preferred subtitle language.
2168  */
2170 {
2171  ERROR_STATE_CHECK_VOID();
2172  AAMPLOG_WARN("PlayerInstanceAAMP::(%s)->(%s)", aamp->mSubLanguage.c_str(), language);
2173 
2174  if (aamp->mSubLanguage.compare(language) == 0)
2175  return;
2176 
2177 
2178  if (state == eSTATE_IDLE || state == eSTATE_RELEASED)
2179  {
2180  AAMPLOG_WARN("PlayerInstanceAAMP:: \"%s\" language set prior to tune start", language);
2181  }
2182  else
2183  {
2184  AAMPLOG_WARN("PlayerInstanceAAMP:: \"%s\" language set - will take effect on next tune", language);
2185  }
2186  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_SubTitleLanguage,(std::string)language);
2187 }
2188 
2189 /**
2190  * @brief Set parallel playlist download config value.
2191  */
2193 {
2194  ERROR_STATE_CHECK_VOID();
2195  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PlaylistParallelFetch,bValue);
2196 }
2197 
2198 /**
2199  * @brief Set parallel playlist download config value for linear
2200  */
2202 {
2203  ERROR_STATE_CHECK_VOID();
2204  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PlaylistParallelRefresh,bValue);
2205 }
2206 
2207 /**
2208  * @brief Set Westeros sink configuration
2209  */
2211 {
2212  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_UseWesterosSink,bValue);
2213 }
2214 
2215 /**
2216  * @brief Set license caching
2217  */
2219 {
2220  ERROR_STATE_CHECK_VOID();
2221  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_SetLicenseCaching,bValue);
2222 }
2223 
2224 /**
2225  * @brief Set Display resolution check for video profile filtering
2226  */
2228 {
2229  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LimitResolution,bValue);
2230 }
2231 
2232 /**
2233  * @brief Set Matching BaseUrl Config Configuration
2234  */
2236 {
2237  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_MatchBaseUrl,bValue);
2238 }
2239 
2240 /**
2241  * @brief Configure New ABR Enable/Disable
2242  */
2244 {
2245  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_ABRBufferCheckEnabled,bValue);
2246  // Piggybagged following setting along with NewABR for Peacock
2247  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_NewDiscontinuity,bValue);
2248  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_HLSAVTrackSyncUsingStartTime,bValue);
2249 }
2250 
2251 /**
2252  * @brief to configure URI parameters for fragment downloads
2253  */
2255 {
2256  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PropogateURIParam,bValue);
2257 }
2258 
2259 /**
2260  * @brief to optionally configure simulated per-download network latency for negative testing
2261  */
2262 void PlayerInstanceAAMP::ApplyArtificialDownloadDelay(unsigned int DownloadDelayInMs)
2263 {
2264  if( DownloadDelayInMs <= MAX_DOWNLOAD_DELAY_LIMIT_MS )
2265  {
2266  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_DownloadDelay,(int)DownloadDelayInMs);
2267  }
2268 }
2269 
2270 /**
2271  * @brief Configure URI parameters
2272  */
2274 {
2275  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_SslVerifyPeer,bValue);
2276 }
2277 
2278 
2279 /**
2280  * @brief Set audio track
2281  */
2282 void PlayerInstanceAAMP::SetAudioTrack(std::string language, std::string rendition, std::string type, std::string codec, unsigned int channel, std::string label)
2283 {
2284  if(aamp)
2285  {
2286 
2287  if (mAsyncTuneEnabled)
2288  {
2289  mScheduler.ScheduleTask(AsyncTaskObj(
2290  [language,rendition,type,codec,channel, label](void *data)
2291  {
2292  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
2293  instance->SetAudioTrackInternal(language,rendition,type,codec,channel, label);
2294  }, (void *) this,__FUNCTION__));
2295  }
2296  else
2297  {
2298  SetAudioTrackInternal(language,rendition,type,codec,channel,label);
2299  }
2300  }
2301 }
2302 
2303 /**
2304  * @brief Set audio track by audio parameters like language , rendition, codec etc..
2305  */
2306 void PlayerInstanceAAMP::SetAudioTrackInternal(std::string language, std::string rendition, std::string type, std::string codec, unsigned int channel, std::string label)
2307 {
2308  aamp->mAudioTuple.clear();
2309  aamp->mAudioTuple.setAudioTrackTuple(language, rendition, codec, channel);
2310  /* Now we have an option to set language and rendition only*/
2311  SetPreferredLanguages( language.empty()?NULL:language.c_str(),
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());
2316 }
2317 
2318 /**
2319  * @brief Set optional preferred codec list
2320  */
2321 void PlayerInstanceAAMP::SetPreferredCodec(const char *codecList)
2322 {
2323  aamp->SetPreferredLanguages(NULL, NULL, NULL, codecList, NULL);
2324 }
2325 
2326 /**
2327  * @brief Set optional preferred label list
2328  */
2329 void PlayerInstanceAAMP::SetPreferredLabels(const char *labelList)
2330 {
2331  aamp->SetPreferredLanguages(NULL, NULL, NULL, NULL, labelList);
2332 }
2333 
2334 /**
2335  * @brief Set optional preferred rendition list
2336  */
2337 void PlayerInstanceAAMP::SetPreferredRenditions(const char *renditionList)
2338 {
2339  aamp->SetPreferredLanguages(NULL, renditionList, NULL, NULL, NULL);
2340 }
2341 
2342 /**
2343  * @brief Get preferred audio prioperties
2344  */
2346 {
2348 }
2349 
2350 /**
2351  * @brief Get preferred text prioperties
2352  *
2353  * @return text preferred proprties in json format
2354  */
2356 {
2357  return aamp->GetPreferredTextProperties();
2358 }
2359 
2360 /**
2361  * @brief Set optional preferred language list
2362  */
2363 void PlayerInstanceAAMP::SetPreferredLanguages(const char *languageList, const char *preferredRendition, const char *preferredType, const char* codecList, const char* labelList )
2364 {
2365  aamp->SetPreferredLanguages(languageList, preferredRendition, preferredType, codecList, labelList);
2366 }
2367 
2368 /**
2369  * @brief Set optional preferred language list
2370  */
2372 {
2374 }
2375 
2376 /**
2377  * @brief Get Preferred DRM.
2378  */
2380 {
2381  return aamp->GetPreferredDRM();
2382 }
2383 
2384 /**
2385  * @brief Get current preferred language list
2386  */
2388 {
2389  if(!aamp->preferredLanguagesString.empty())
2390  {
2391  return aamp->preferredLanguagesString.c_str();
2392  }
2393 
2394  return NULL;
2395 }
2396 
2397 /**
2398  * @brief Configure New AdBreaker Enable/Disable
2399  */
2401 {
2402  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_NewDiscontinuity,bValue);
2403  // Piggyback the PDT based processing for new Adbreaker processing for peacock.
2404  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_HLSAVTrackSyncUsingStartTime,bValue);
2405 }
2406 
2407 /**
2408  * @brief Get available video tracks.
2409  */
2411 {
2412  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2413 
2414  return aamp->GetAvailableVideoTracks();
2415 }
2416 
2417 /**
2418  * @brief Set video tracks.
2419  */
2420 void PlayerInstanceAAMP::SetVideoTracks(std::vector<long> bitrates)
2421 {
2422  return aamp->SetVideoTracks(bitrates);
2423 }
2424 
2425 /**
2426  * @brief Get available audio tracks.
2427  */
2429 {
2430  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2431 
2432  return aamp->GetAvailableAudioTracks(allTrack);
2433 }
2434 
2435 /**
2436  * @brief Get current audio track index
2437  */
2439 {
2440  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2441 
2442  return aamp->GetAudioTrackInfo();
2443 }
2444 
2445 /**
2446  * @brief Get current audio track index
2447  */
2449 {
2450  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2451 
2452  return aamp->GetTextTrackInfo();
2453 }
2454 
2455 /**
2456  * @brief Get available text tracks.
2457  *
2458  * @return std::string JSON formatted list of text tracks
2459  */
2461 {
2462  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2463 
2464  return aamp->GetAvailableTextTracks(allTrack);
2465 }
2466 
2467 /**
2468  * @brief Get the video window co-ordinates
2469  */
2471 {
2472  ERROR_STATE_CHECK_VAL(std::string());
2473 
2474  return aamp->GetVideoRectangle();
2475 }
2476 
2477 /**
2478  * @brief Set the application name which has created PlayerInstanceAAMP, for logging purposes
2479  */
2480 void PlayerInstanceAAMP::SetAppName(std::string name)
2481 {
2482  aamp->SetAppName(name);
2483 }
2484 
2485 /**
2486  * @brief Enable/disable the native CC rendering feature
2487  */
2489 {
2490 #ifdef AAMP_CC_ENABLED
2491  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_NativeCCRendering,enable);
2492 #endif
2493 }
2494 
2495 /**
2496  * @brief To set the vod-tune-event according to the player.
2497  */
2499 {
2500  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_TuneEventConfig,tuneEventType);
2501 }
2502 
2503 /**
2504  * @brief Set video rectangle property
2505  */
2507 {
2508  if(!rectProperty)
2509  {
2511  {
2512  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_EnableRectPropertyCfg,false);
2513  }
2514  else
2515  {
2516  AAMPLOG_WARN("Skipping the configuration value[%d], since westerossink is disabled", rectProperty);
2517  }
2518  }
2519  else
2520  {
2521  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_EnableRectPropertyCfg,true);
2522  }
2523 }
2524 
2525 /**
2526  * @brief Set audio track
2527  */
2529 {
2530  ERROR_OR_IDLE_STATE_CHECK_VOID();
2532 
2533  std::vector<AudioTrackInfo> tracks = aamp->mpStreamAbstractionAAMP->GetAvailableAudioTracks();
2534  if (!tracks.empty() && (trackId >= 0 && trackId < tracks.size()))
2535  {
2536  if (mAsyncTuneEnabled)
2537  {
2538  mScheduler.ScheduleTask(AsyncTaskObj(
2539  [tracks , trackId](void *data)
2540  {
2541  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(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__));
2544  }
2545  else
2546  {
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());
2548  }
2549  }
2550  } // end of if
2551 }
2552 
2553 /**
2554  * @brief Get current audio track index
2555  */
2557 {
2558  ERROR_OR_IDLE_STATE_CHECK_VAL(-1);
2559 
2560  return aamp->GetAudioTrack();
2561 }
2562 
2563 /**
2564  * @brief Set text track
2565  */
2566 void PlayerInstanceAAMP::SetTextTrack(int trackId, char *ccData)
2567 {
2568  ERROR_OR_IDLE_STATE_CHECK_VOID();
2570  {
2571 
2572  std::vector<TextTrackInfo> tracks = aamp->mpStreamAbstractionAAMP->GetAvailableTextTracks();
2573  AAMPLOG_INFO("trackId: %d tracks size %lu", trackId, tracks.size());
2574  if (!tracks.empty() && (MUTE_SUBTITLES_TRACKID == trackId || (trackId >= 0 && trackId < tracks.size())))
2575  {
2576  if (mAsyncTuneEnabled)
2577  {
2578  mScheduler.ScheduleTask(AsyncTaskObj(
2579  [trackId, ccData ](void *data)
2580  {
2581  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
2582  instance->SetTextTrackInternal(trackId, ccData);
2583  }, (void *) this,__FUNCTION__));
2584  }
2585  else
2586  {
2587  SetTextTrackInternal(trackId, ccData);
2588  }
2589  }
2590  else
2591  SetTextTrackInternal(trackId, ccData);
2592  }
2593 }
2594 
2595 /**
2596  * @brief Set text track by Id
2597  */
2598 void PlayerInstanceAAMP::SetTextTrackInternal(int trackId, char *data)
2599 {
2601  {
2602  aamp->SetTextTrack(trackId, data);
2603  }
2604 }
2605 
2606 
2607 /**
2608  * @brief Get current text track index
2609  */
2611 {
2612  ERROR_OR_IDLE_STATE_CHECK_VAL(-1);
2613 
2614  return aamp->GetTextTrack();
2615 }
2616 
2617 /**
2618  * @brief Set CC visibility on/off
2619  */
2621 {
2622  ERROR_STATE_CHECK_VOID();
2623 
2624  aamp->SetCCStatus(enabled);
2625 }
2626 
2627 /**
2628  * @brief Get CC visibility on/off
2629  */
2631 {
2632  return aamp->GetCCStatus();
2633 }
2634 
2635 /**
2636  * @brief Set style options for text track rendering
2637  */
2638 void PlayerInstanceAAMP::SetTextStyle(const std::string &options)
2639 {
2640  ERROR_STATE_CHECK_VOID();
2641 
2642  aamp->SetTextStyle(options);
2643 }
2644 
2645 /**
2646  * @brief Get style options for text track rendering
2647  */
2649 {
2650  ERROR_STATE_CHECK_VAL(std::string());
2651 
2652  return aamp->GetTextStyle();
2653 }
2654 
2655 /**
2656  * @brief Set Initial profile ramp down limit.
2657  */
2659 {
2660  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_InitRampDownLimit,limit);
2661 }
2662 
2663 
2664 /**
2665  * @brief Set the CEA format for force setting
2666  */
2668 {
2669 #ifdef AAMP_CC_ENABLED
2670  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CEAPreferred,format);
2671 #endif
2672 }
2673 
2674 
2675 /**
2676  * @brief To get the available bitrates for thumbnails.
2677  */
2679 {
2680  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2681  return aamp->GetThumbnailTracks();
2682 }
2683 
2684 /**
2685  * @brief To set a preferred bitrate for thumbnail profile.
2686  */
2688 {
2689  ERROR_OR_IDLE_STATE_CHECK_VAL(false);
2690  bool ret = false;
2692  if(thumbIndex >= 0 && aamp->mpStreamAbstractionAAMP)
2693  {
2694  ret = aamp->mpStreamAbstractionAAMP->SetThumbnailTrack(thumbIndex);
2695  }
2697  return ret;
2698 }
2699 
2700 /**
2701  * @brief To get preferred thumbnails for the duration.
2702  */
2703 std::string PlayerInstanceAAMP::GetThumbnails(double tStart, double tEnd)
2704 {
2705  ERROR_OR_IDLE_STATE_CHECK_VAL(std::string());
2706  return aamp->GetThumbnails(tStart, tEnd);
2707 }
2708 
2709 /**
2710  * @brief Set the session token for player
2711  */
2712 void PlayerInstanceAAMP::SetSessionToken(std::string sessionToken)
2713 {
2714  ERROR_STATE_CHECK_VOID();
2715  // Stored as tune setting , this will get cleared after one tune session
2716  SETCONFIGVALUE(AAMP_TUNE_SETTING,eAAMPConfig_AuthToken,sessionToken);
2717  aamp->mDynamicDrmDefaultconfig.authToken = sessionToken;
2718  return;
2719 }
2720 
2721 /**
2722  * @brief Enable seekable range values in progress event
2723  */
2725 {
2726  ERROR_STATE_CHECK_VOID();
2727  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_EnableSeekRange,bValue);
2728 }
2729 
2730 /**
2731  * @brief Enable video PTS reporting in progress event
2732  */
2734 {
2735  ERROR_STATE_CHECK_VOID();
2736  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_ReportVideoPTS,bValue);
2737 }
2738 
2739 /**
2740  * @brief Disable Content Restrictions - unlock
2741  */
2742 void PlayerInstanceAAMP::DisableContentRestrictions(long grace, long time, bool eventChange)
2743 {
2744  ERROR_OR_IDLE_STATE_CHECK_VOID();
2745  aamp->DisableContentRestrictions(grace, time, eventChange);
2746 }
2747 
2748 /**
2749  * @brief Enable Content Restrictions - lock
2750  */
2752 {
2753  ERROR_OR_IDLE_STATE_CHECK_VOID();
2755 }
2756 
2757 /**
2758  * @brief Manage async tune configuration for specific contents
2759  */
2760 void PlayerInstanceAAMP::ManageAsyncTuneConfig(const char* mainManifestUrl)
2761 {
2763  mFormat = aamp->GetMediaFormatType(mainManifestUrl);
2764  if(mFormat == eMEDIAFORMAT_HDMI || mFormat == eMEDIAFORMAT_COMPOSITE || mFormat == eMEDIAFORMAT_OTA)
2765  {
2766  SetAsyncTuneConfig(false);
2767  }
2768 }
2769 
2770 /**
2771  * @brief Set async tune configuration
2772  */
2774 {
2775  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_AsyncTune,bValue);
2776  // Start it for the playerinstance if default not started and App wants
2777  // Stop Async operation for the playerinstance if default started and App doesnt want
2778  AsyncStartStop();
2779 }
2780 
2781 /**
2782  * @brief Enable/Disable async operation
2783  */
2785 {
2786  // Check if global configuration is set to false
2787  // Additional check added here, since this API can be called from jsbindings/native app
2790  {
2791  AAMPLOG_WARN("Enable async tune operation!!" );
2792  mAsyncRunning = true;
2793  //mScheduler.StartScheduler();
2795  }
2796  else if(!mAsyncTuneEnabled && mAsyncRunning)
2797  {
2798  AAMPLOG_WARN("Disable async tune operation!!");
2800  //mScheduler.StopScheduler();
2801  mAsyncRunning = false;
2802  }
2803 }
2804 
2805 /**
2806  * @brief Enable/disable configuration to persist ABR profile over seek/SAP
2807  */
2809 {
2810  ERROR_STATE_CHECK_VOID();
2811  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PersistentBitRateOverSeek,bValue);
2812 }
2813 
2814 
2815 /**
2816  * @brief Stop playback and release resources.
2817  */
2818 void PlayerInstanceAAMP::StopInternal(bool sendStateChangeEvent)
2819 {
2820  PrivAAMPState state;
2821 
2822  aamp->StopPausePositionMonitoring("Stop() called");
2823 
2824  aamp->GetState(state);
2825  if(!aamp->IsTuneCompleted())
2826  {
2827  aamp->TuneFail(true);
2828 
2829  }
2830 
2831  AAMPLOG_WARN("aamp_stop PlayerState=%d",state);
2832 
2833  if (sendStateChangeEvent)
2834  {
2836  }
2837 
2838  AAMPLOG_WARN("%s PLAYER[%d] Stopping Playback at Position '%lld'.\n",(aamp->mbPlayEnabled?STRFGPLAYER:STRBGPLAYER), aamp->mPlayerId, aamp->GetPositionMilliseconds());
2839  aamp->Stop();
2840  // Revert all custom specific setting, tune specific setting and stream specific setting , back to App/default setting
2842  mConfig.RestoreConfiguration(AAMP_TUNE_SETTING, mLogObj);
2843  mConfig.RestoreConfiguration(AAMP_STREAM_SETTING, mLogObj);
2844  aamp->mIsStream4K = false;
2845 }
2846 
2847 /**
2848  * @brief To set preferred paused state behavior
2849  */
2851 {
2852  ERROR_STATE_CHECK_VOID();
2853 
2854  if(behavior >= 0 && behavior < ePAUSED_BEHAVIOR_MAX)
2855  {
2856  AAMPLOG_WARN("Player Paused behavior : %d", behavior);
2857  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_LivePauseBehavior,behavior);
2858  }
2859 }
2860 
2861 
2862 /**
2863  * @brief To set UseAbsoluteTimeline for DASH
2864  */
2866 {
2867  ERROR_STATE_CHECK_VOID();
2868  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_UseAbsoluteTimeline,configState);
2869 
2870 }
2871 
2872 /**
2873  * @brief To set the repairIframes flag
2874  */
2876 {
2877  ERROR_STATE_CHECK_VOID();
2878  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_RepairIframes,configState);
2879 
2880 }
2881 
2882 /**
2883  * @brief InitAAMPConfig - Initialize the media player session with json config
2884  */
2886 {
2887  bool retVal = false;
2888  cJSON *cfgdata = NULL;
2889  if(jsonStr)
2890  {
2891  cfgdata = cJSON_Parse(jsonStr);
2892  if(cfgdata != NULL)
2893  {
2894  retVal = mConfig.ProcessConfigJson(cfgdata,AAMP_APPLICATION_SETTING);
2895  }
2896  }
2897  mConfig.DoCustomSetting(AAMP_APPLICATION_SETTING);
2898  if(GETCONFIGOWNER(eAAMPConfig_AsyncTune) == AAMP_APPLICATION_SETTING)
2899  {
2900  AsyncStartStop();
2901  }
2902 
2903  if(cfgdata != NULL){
2904  cJSON *drmConfig = cJSON_GetObjectItem(cfgdata,"drmConfig");
2905  if(drmConfig) {
2906  std::string LicenseServerUrl = "";
2907  GETCONFIGVALUE(eAAMPConfig_PRLicenseServerUrl, LicenseServerUrl);
2908  aamp->mDynamicDrmDefaultconfig.licenseEndPoint.insert(std::pair<std::string, std::string>("com.microsoft.playready", LicenseServerUrl.c_str()));
2909  GETCONFIGVALUE(eAAMPConfig_WVLicenseServerUrl, LicenseServerUrl);
2910  aamp->mDynamicDrmDefaultconfig.licenseEndPoint.insert(std::pair<std::string, std::string>("com.widevine.alpha",LicenseServerUrl.c_str()));
2911  GETCONFIGVALUE(eAAMPConfig_CKLicenseServerUrl, LicenseServerUrl);
2912  aamp->mDynamicDrmDefaultconfig.licenseEndPoint.insert(std::pair<std::string, std::string>("org.w3.clearkey",LicenseServerUrl.c_str()));
2913  std::string customData = "";
2914  GETCONFIGVALUE(eAAMPConfig_CustomLicenseData,customData);
2915  aamp->mDynamicDrmDefaultconfig.customData = customData;
2916  }
2917  cJSON_Delete(cfgdata);
2918  }
2919  return retVal;
2920 }
2921 
2922 /**
2923  * @brief GetAAMPConfig - GetAamp Config as JSON string
2924  */
2926 {
2927  std::string jsonStr;
2928  mConfig.GetAampConfigJSONStr(jsonStr);
2929  return jsonStr;
2930 }
2931 
2932 /**
2933  * @brief To set whether the JS playback session is from XRE or not.
2934  */
2936 {
2937  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_XRESupportedTune,xreSupported);
2938 }
2939 
2940 
2941 /**
2942  * @brief Set auxiliary language
2943  */
2944 void PlayerInstanceAAMP::SetAuxiliaryLanguage(const std::string &language)
2945 {
2946  if(mAsyncTuneEnabled)
2947  {
2948 
2949  mScheduler.ScheduleTask(AsyncTaskObj([language](void *data)
2950  {
2951  PlayerInstanceAAMP *instance = static_cast<PlayerInstanceAAMP *>(data);
2952  instance->SetAuxiliaryLanguageInternal(language);
2953  }, (void *)this , __FUNCTION__));
2954  }
2955  else
2956  {
2957  SetAuxiliaryLanguageInternal(language);
2958  }
2959 
2960 }
2961 
2962 /**
2963  * @brief Set auxiluerry track language.
2964  */
2965 void PlayerInstanceAAMP::SetAuxiliaryLanguageInternal(const std::string &language)
2966 {
2967  ERROR_STATE_CHECK_VOID();
2968 #ifdef AAMP_AUXILIARY_AUDIO_ENABLED
2969  //Can set the property only for BT enabled device
2970 
2971  std::string currentLanguage = aamp->GetAuxiliaryAudioLanguage();
2972  AAMPLOG_WARN("aamp_SetAuxiliaryLanguage(%s)->(%s)", currentLanguage.c_str(), language.c_str());
2973 
2974  if(language != currentLanguage)
2975  {
2976  // There is no active playback session, save the language for later
2977  if (state == eSTATE_IDLE || state == eSTATE_RELEASED)
2978  {
2979  aamp->SetAuxiliaryLanguage(language);
2980  }
2981  // check if language is supported in manifest languagelist
2982  else if((aamp->IsAudioLanguageSupported(language.c_str())) || (!aamp->mMaxLanguageCount))
2983  {
2984  aamp->SetAuxiliaryLanguage(language);
2986  {
2987  AAMPLOG_WARN("aamp_SetAuxiliaryLanguage(%s) retuning", language.c_str());
2988 
2989  aamp->discardEnteringLiveEvt = true;
2990 
2992  aamp->TeardownStream(false);
2994 
2995  aamp->discardEnteringLiveEvt = false;
2996  }
2997  }
2998  }
2999 #else
3000  AAMPLOG_ERR("Auxiliary audio language is not supported in this platform, ignoring the input!");
3001 #endif
3002 }
3003 
3004 /**
3005  * @brief Set License Custom Data
3006  */
3007 void PlayerInstanceAAMP::SetLicenseCustomData(const char *customData)
3008 {
3009  ERROR_STATE_CHECK_VOID();
3010  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CustomLicenseData,std::string(customData));
3011 }
3012 
3013 /**
3014  * @brief Get playback statistics formated for partner apps
3015  */
3017 {
3018  std::string stats;
3019  if(aamp)
3020  {
3021  stats = aamp->GetPlaybackStats();
3022  }
3023  return stats;
3024 }
3025 
3027 {
3028  ERROR_STATE_CHECK_VOID();
3029  AAMPLOG_INFO("ProcessContentProtectionDataConfig received DRM config data from app");
3030  if(aamp){
3031  std::vector<uint8_t> tempKeyId;
3032  DynamicDrmInfo dynamicDrmCache;
3033  if(aamp->vDynamicDrmData.size()>9)
3034  {
3035  aamp->vDynamicDrmData.erase(aamp->vDynamicDrmData.begin());
3036  }
3037  int empty_config;
3038  cJSON *cfgdata = cJSON_Parse(jsonbuffer);
3039  empty_config = cJSON_GetArraySize(cfgdata);
3040  if(cfgdata)
3041  {
3042  cJSON *arryitem = cJSON_GetObjectItem(cfgdata, "keyID" );
3043  if(arryitem) {
3044  cJSON *iterator = NULL;
3045  cJSON_ArrayForEach(iterator, arryitem) {
3046  if (cJSON_IsNumber(iterator)) {
3047  tempKeyId.push_back(iterator->valueint);
3048  }
3049  }
3050  dynamicDrmCache.keyID=tempKeyId;
3051  }
3052  else {
3053  AAMPLOG_WARN("Response message doesn't have keyID ignoring the message");
3054  return;
3055  }
3056 
3057  //Remove old config if response keyId already in cache
3058  int iter1 = 0;
3059  while (iter1 < aamp->vDynamicDrmData.size()) {
3060  DynamicDrmInfo dynamicDrmCache = aamp->vDynamicDrmData.at(iter1);
3061  if(tempKeyId == dynamicDrmCache.keyID) {
3062  AAMPLOG_WARN("Deleting old config and updating new config");
3063  aamp->vDynamicDrmData.erase(aamp->vDynamicDrmData.begin()+iter1);
3064  break;
3065  }
3066  iter1++;
3067  }
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());
3073 
3074  }
3075  dynamicDrmCache.licenseEndPoint.insert(std::pair<std::string, std::string>("com.microsoft.playready",playreadyurl.c_str()));
3076 
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());
3082  }
3083  dynamicDrmCache.licenseEndPoint.insert(std::pair<std::string, std::string>("com.widevine.alpha",widevineurl.c_str()));
3084 
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());
3090  }
3091  dynamicDrmCache.licenseEndPoint.insert(std::pair<std::string, std::string>("org.w3.clearkey",clearkeyurl.c_str()));
3092 
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());
3098  }
3099  dynamicDrmCache.customData = customdata;
3100 
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());
3106  }
3107  dynamicDrmCache.authToken = authToken;
3108 
3109  cJSON *licenseResponseObject = cJSON_GetObjectItem(cfgdata, "licenseResponse");
3110  if(licenseResponseObject) {
3111  std::string licenseResponse = licenseResponseObject->valuestring;
3112  if(!licenseResponse.empty()) {
3113  AAMPLOG_TRACE("App configured License Response");
3114  }
3115  }
3116  if(empty_config == 1){
3117  aamp->mDynamicDrmDefaultconfig.keyID=tempKeyId;
3118  AAMPLOG_WARN("Received empty config applying default config");
3119  aamp->vDynamicDrmData.push_back(aamp->mDynamicDrmDefaultconfig);
3120  DynamicDrmInfo dynamicDrmCache = aamp->mDynamicDrmDefaultconfig;
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;
3125  }
3126  if(strcasecmp("com.widevine.alpha",itr->first.c_str())==0) {
3127  widevineurl = itr->second;
3128  }
3129  if(strcasecmp("org.w3.clearkey",itr->first.c_str())==0) {
3130  clearkeyurl = itr->second;
3131  }
3132  }
3133  authToken = dynamicDrmCache.authToken;
3134  customdata = dynamicDrmCache.customData;
3135  }
3136  else {
3137  aamp->vDynamicDrmData.push_back(dynamicDrmCache);
3138  }
3139 
3140  if(tempKeyId == aamp->mcurrent_keyIdArray){
3141  AAMPLOG_WARN("Player received the config for requested keyId applying the configs");
3142  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_PRLicenseServerUrl,playreadyurl);
3143  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_WVLicenseServerUrl,widevineurl);
3144  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CKLicenseServerUrl,clearkeyurl);
3145  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_CustomLicenseData,customdata);
3146  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_AuthToken,authToken);
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);
3151  }
3152 
3153  }
3154  cJSON_Delete(cfgdata);
3155  }
3156 }
3157 
3158 /**
3159  * @brief To set the dynamic drm update on key rotation timeout value.
3160  *
3161  * @param[in] preferred timeout value
3162  */
3164 {
3165  ERROR_STATE_CHECK_VOID();
3166  int timeout_ms = timeout * 1000;
3167  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_ContentProtectionDataUpdateTimeout,timeout);
3168 }
3169 
3170 /**
3171  * @brief To set Dynamic DRM feature by Application
3172  */
3174 {
3175  SETCONFIGVALUE(AAMP_APPLICATION_SETTING,eAAMPConfig_RuntimeDRMConfig,DynamicDRMSupported);
3176 }
3177 
3178 /**
3179  * @fn IsOOBCCRenderingSupported
3180  *
3181  * @return bool, True if Out of Band Closed caption/subtitle rendering supported
3182  */
3184 {
3185 #ifdef AAMP_CC_ENABLED
3187 #else
3188  return false;
3189 #endif
3190 }
3191 
3192 
3193 /**
3194  * @}
3195  */
PlayerInstanceAAMP::SetAsyncTuneConfig
void SetAsyncTuneConfig(bool bValue)
Set async tune configuration.
Definition: main_aamp.cpp:2773
PlayerInstanceAAMP::GetInitialBitrate
long GetInitialBitrate(void)
To get the initial bitrate value.
Definition: main_aamp.cpp:1962
eAAMPConfig_CurlDownloadStartTimeout
@ eAAMPConfig_CurlDownloadStartTimeout
Definition: AampConfig.h:273
PlayerInstanceAAMP::GetInitialBufferDuration
int GetInitialBufferDuration(void)
Get initial buffer duration in seconds.
Definition: main_aamp.cpp:444
PlayerInstanceAAMP::ApplyArtificialDownloadDelay
void ApplyArtificialDownloadDelay(unsigned int DownloadDelayInMs)
to optionally configure simulated per-download network latency for negative testing
Definition: main_aamp.cpp:2262
PlayerInstanceAAMP::GetMinimumBitrate
long GetMinimumBitrate(void)
Get minimum bitrate value.
Definition: main_aamp.cpp:511
PrivateInstanceAAMP::mProgressReportOffset
double mProgressReportOffset
Definition: priv_aamp.h:1065
eAAMPConfig_PlaylistTimeout
@ eAAMPConfig_PlaylistTimeout
Definition: AampConfig.h:285
PlayerInstanceAAMP::GetVideoBitrate
long GetVideoBitrate(void)
To get the bitrate of current video profile.
Definition: main_aamp.cpp:1787
PrivateInstanceAAMP::SetLiveOffsetAppRequest
void SetLiveOffsetAppRequest(bool LiveOffsetAppRequest)
set LiveOffset Request flag Status
Definition: priv_aamp.cpp:11648
PrivateInstanceAAMP::GetAuxiliaryAudioLanguage
std::string GetAuxiliaryAudioLanguage()
Get auxiliary language.
Definition: priv_aamp.h:3624
aamp_Free
void aamp_Free(void *ptr)
wrapper for g_free, used for segment allocation
Definition: AampMemoryUtils.cpp:56
PrivateInstanceAAMP::GetAudioTrack
int GetAudioTrack()
Get current audio track index.
Definition: priv_aamp.cpp:9976
PlayerInstanceAAMP::IsValidRate
bool IsValidRate(int rate)
Check given rate is valid.
Definition: main_aamp.cpp:547
PlayerInstanceAAMP::SetManifestTimeout
void SetManifestTimeout(double timeout)
Optionally override default HLS main manifest download timeout with app-specific value.
Definition: main_aamp.cpp:2000
PlayerInstanceAAMP::GetVideoRectangle
std::string GetVideoRectangle()
Get the video window co-ordinates.
Definition: main_aamp.cpp:2470
AampScheduler::ScheduleTask
int ScheduleTask(AsyncTaskObj obj)
To schedule a task to be executed later.
Definition: AampScheduler.cpp:64
eDRM_WideVine
@ eDRM_WideVine
Definition: AampDrmSystems.h:36
PlayerInstanceAAMP::SetRampDownLimit
void SetRampDownLimit(int limit)
Set profile ramp down limit.
Definition: main_aamp.cpp:462
eAAMPConfig_InterruptHandling
@ eAAMPConfig_InterruptHandling
Definition: AampConfig.h:183
eMEDIAFORMAT_PROGRESSIVE
@ eMEDIAFORMAT_PROGRESSIVE
Definition: AampDrmMediaFormat.h:36
eAAMPConfig_MaxFragmentCached
@ eAAMPConfig_MaxFragmentCached
Definition: AampConfig.h:220
PlayerInstanceAAMP::aamp
class PrivateInstanceAAMP * aamp
Definition: main_aamp.h:1943
PlayerInstanceAAMP::GetPlaybackPosition
double GetPlaybackPosition(void)
To get the current playback position.
Definition: main_aamp.cpp:1729
eAAMPConfig_NewDiscontinuity
@ eAAMPConfig_NewDiscontinuity
Definition: AampConfig.h:165
AampConfig::logging
AampLogManager logging
Definition: AampConfig.h:462
eAAMPConfig_LiveOffset4K
@ eAAMPConfig_LiveOffset4K
Definition: AampConfig.h:289
AampDrmHelper.h
Implented DRM helper functionalities.
eAAMPConfig_HLSAVTrackSyncUsingStartTime
@ eAAMPConfig_HLSAVTrackSyncUsingStartTime
Definition: AampConfig.h:117
PrivateInstanceAAMP::preferredLanguagesString
std::string preferredLanguagesString
Definition: priv_aamp.h:964
eDRM_PlayReady
@ eDRM_PlayReady
Definition: AampDrmSystems.h:37
eAAMPConfig_StereoOnly
@ eAAMPConfig_StereoOnly
Definition: AampConfig.h:110
eAAMPConfig_SubTitleLanguage
@ eAAMPConfig_SubTitleLanguage
Definition: AampConfig.h:302
PlayerInstanceAAMP::mJSBinding_DL
void * mJSBinding_DL
Definition: main_aamp.h:2022
PlayerInstanceAAMP::SetPropagateUriParameters
void SetPropagateUriParameters(bool bValue)
to configure URI parameters for fragment downloads
Definition: main_aamp.cpp:2254
PrivateInstanceAAMP::mIsIframeTrackPresent
bool mIsIframeTrackPresent
Definition: priv_aamp.h:993
eSTATE_INITIALIZED
@ eSTATE_INITIALIZED
Definition: AampEvent.h:160
StreamAbstractionAAMP::GetESChangeStatus
bool GetESChangeStatus(void)
Get elementary stream type change status for reconfigure the pipeline..
Definition: StreamAbstractionAAMP.h:725
PrivateInstanceAAMP::mpStreamAbstractionAAMP
class StreamAbstractionAAMP * mpStreamAbstractionAAMP
Definition: priv_aamp.h:807
PlayerInstanceAAMP::EnableContentRestrictions
void EnableContentRestrictions()
Enable Content Restrictions - lock.
Definition: main_aamp.cpp:2751
PlayerInstanceAAMP::GetTextTrackInfo
std::string GetTextTrackInfo()
Get current audio track index.
Definition: main_aamp.cpp:2448
eAAMPConfig_WVLicenseServerUrl
@ eAAMPConfig_WVLicenseServerUrl
Definition: AampConfig.h:300
eAAMPConfig_CurlDownloadLowBWTimeout
@ eAAMPConfig_CurlDownloadLowBWTimeout
Definition: AampConfig.h:274
PlayerInstanceAAMP::SetThumbnailTrack
bool SetThumbnailTrack(int thumbIndex)
To set a preferred bitrate for thumbnail profile.
Definition: main_aamp.cpp:2687
StreamAbstractionAAMP::GetAudioFwdToAuxStatus
bool GetAudioFwdToAuxStatus()
Get audio forward to aux pipeline status.
Definition: StreamAbstractionAAMP.h:1298
PrivateInstanceAAMP::mbDetached
bool mbDetached
Definition: priv_aamp.h:1073
PlayerInstanceAAMP::SetBulkTimedMetaReport
void SetBulkTimedMetaReport(bool bValue)
Set Bulk TimedMetadata Reporting flag.
Definition: main_aamp.cpp:2079
PlayerInstanceAAMP::UnRegisterEvents
void UnRegisterEvents(EventListener *eventListener)
UnRegister event handler.
Definition: main_aamp.cpp:411
eDRM_ClearKey
@ eDRM_ClearKey
Definition: AampDrmSystems.h:41
eTUNETYPE_SEEK
@ eTUNETYPE_SEEK
Definition: priv_aamp.h:194
PlayerInstanceAAMP::SetVideoZoom
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
Definition: main_aamp.cpp:1282
PlayerInstanceAAMP::SetSlowMotionPlayRate
void SetSlowMotionPlayRate(float rate)
Set slow motion player speed.
Definition: main_aamp.cpp:1167
PrivateInstanceAAMP::NotifyFirstBufferProcessed
void NotifyFirstBufferProcessed()
Notify if first buffer processed by gstreamer.
Definition: priv_aamp.cpp:8471
eAAMPConfig_PlaybackOffset
@ eAAMPConfig_PlaybackOffset
Definition: AampConfig.h:287
PrivateInstanceAAMP::TuneHelper
void TuneHelper(TuneType tuneType, bool seekWhilePaused=false)
The helper function which perform tuning Common tune operations used on Tune, Seek,...
Definition: priv_aamp.cpp:4874
PlayerInstanceAAMP::ManageAsyncTuneConfig
void ManageAsyncTuneConfig(const char *url)
Manage async tune configuration for specific contents.
Definition: main_aamp.cpp:2760
PrivateInstanceAAMP::SetPreferredLanguages
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
Definition: priv_aamp.cpp:10744
PrivateInstanceAAMP::mbSeeked
bool mbSeeked
Definition: priv_aamp.h:1074
TuneType
TuneType
Tune Typea.
Definition: priv_aamp.h:190
PrivateInstanceAAMP::GetPlaybackStats
std::string GetPlaybackStats()
Get playback stats for the session so far.
Definition: priv_aamp.cpp:11744
EventListener
Class for sed event to Listener.
Definition: AampEventListener.h:35
PlayerInstanceAAMP::SetNetworkProxy
void SetNetworkProxy(const char *proxy)
To set the network proxy.
Definition: main_aamp.cpp:2115
PlayerInstanceAAMP::SetLicenseCaching
void SetLicenseCaching(bool bValue)
Set license caching.
Definition: main_aamp.cpp:2218
PlayerInstanceAAMP::InitAAMPConfig
bool InitAAMPConfig(char *jsonStr)
InitAAMPConfig - Initialize the media player session with json config.
Definition: main_aamp.cpp:2885
StreamSink::Stream
virtual void Stream(void)
Start the stream.
Definition: main_aamp.h:441
PlayerInstanceAAMP::SetContentProtectionDataUpdateTimeout
void SetContentProtectionDataUpdateTimeout(int timeout)
To set default timeout for Dynamic ContentProtectionDataUpdate on Key Rotation.
Definition: main_aamp.cpp:3163
StreamAbstractionAAMP.h
Base classes of HLS/MPD collectors. Implements common caching/injection logic.
AampConfig::GetAampConfigJSONStr
bool GetAampConfigJSONStr(std::string &str)
GetAampConfigJSONStr - Function to Complete Config as JSON str.
Definition: AampConfig.cpp:1287
logprintf
void logprintf(const char *format,...)
Print logs to console / log fil.
Definition: aamplogging.cpp:432
PrivateInstanceAAMP::GetThumbnails
std::string GetThumbnails(double start, double end)
Get the Thumbnail Tile data.
Definition: priv_aamp.cpp:6505
PrivateInstanceAAMP::IsTuneCompleted
bool IsTuneCompleted()
Check if tune completed or not.
Definition: priv_aamp.cpp:8835
PlayerInstanceAAMP::GetPreferredDRM
DRMSystems GetPreferredDRM()
Get Preferred DRM.
Definition: main_aamp.cpp:2379
StreamAbstractionAAMP::GetVideoBitrates
virtual std::vector< long > GetVideoBitrates(void)=0
Get available video bitrates.
PlayerInstanceAAMP::IsLive
bool IsLive()
To check whether the asset is live or not.
Definition: main_aamp.cpp:1503
main_aamp.h
Types and APIs exposed by the AAMP player.
PrivateInstanceAAMP::SetAudioVolume
void SetAudioVolume(int volume)
Set audio volume.
Definition: priv_aamp.cpp:6732
PlayerInstanceAAMP::SetStallTimeout
void SetStallTimeout(int timeoutMS)
To set the timeout value to be used for playback stall detection.
Definition: main_aamp.cpp:1693
PrivateInstanceAAMP::SetVideoMute
void SetVideoMute(bool muted)
Enable/ Disable Video.
Definition: priv_aamp.cpp:6712
PlayerInstanceAAMP::SetSegmentDecryptFailCount
void SetSegmentDecryptFailCount(int value)
Set retry limit on Segment drm decryption failure.
Definition: main_aamp.cpp:427
PrivateInstanceAAMP::Tune
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.
Definition: priv_aamp.cpp:5349
PrivateInstanceAAMP::SetState
void SetState(PrivAAMPState state)
Set player state.
Definition: priv_aamp.cpp:7731
AAMPGstPlayer
Class declaration of Gstreamer based player.
Definition: aampgstplayer.h:64
PrivateInstanceAAMP::LogPlayerPreBuffered
void LogPlayerPreBuffered(void)
Profile Player changed from background to foreground i.e prebuffred.
Definition: priv_aamp.cpp:3115
eAAMPConfig_LicenseServerUrl
@ eAAMPConfig_LicenseServerUrl
Definition: AampConfig.h:297
GrowableBuffer::len
size_t len
Definition: AampMemoryUtils.h:42
PrivateInstanceAAMP::getAampCacheHandler
AampCacheHandler * getAampCacheHandler()
Get AampCacheHandler instance.
Definition: priv_aamp.cpp:6277
PrivateInstanceAAMP::RegisterEvents
void RegisterEvents(EventListener *eventListener)
Register event listener.
Definition: priv_aamp.h:1985
PlayerInstanceAAMP::SetDownloadStartTimeout
void SetDownloadStartTimeout(long startTimeout)
To set the curl download start timeout.
Definition: main_aamp.cpp:2145
ContentType_VOD
@ ContentType_VOD
Definition: AampProfiler.h:103
PlayerInstanceAAMP::GetPlaybackRate
int GetPlaybackRate(void)
To get the current playback rate.
Definition: main_aamp.cpp:1884
PrivateInstanceAAMP::SetTextStyle
void SetTextStyle(const std::string &options)
Set style options for text track rendering.
Definition: priv_aamp.cpp:10441
eAAMPConfig_ReportProgressInterval
@ eAAMPConfig_ReportProgressInterval
Definition: AampConfig.h:286
PlayerInstanceAAMP::StopInternal
void StopInternal(bool sendStateChangeEvent)
Stop playback and release resources.
Definition: main_aamp.cpp:2818
PlayerInstanceAAMP::EnableSeekableRange
void EnableSeekableRange(bool enabled)
Enable seekable range values in progress event.
Definition: main_aamp.cpp:2724
PlayerInstanceAAMP::GetAudioTrack
int GetAudioTrack()
Get current audio track index.
Definition: main_aamp.cpp:2556
PlayerInstanceAAMP::SetPreferredSubtitleLanguage
void SetPreferredSubtitleLanguage(const char *language)
Set preferred subtitle language.
Definition: main_aamp.cpp:2169
PrivateInstanceAAMP::mSeekFromPausedState
bool mSeekFromPausedState
Definition: priv_aamp.h:1061
PrivateInstanceAAMP::AcquireStreamLock
void AcquireStreamLock()
acquire streamsink lock
Definition: priv_aamp.cpp:10671
PlayerInstanceAAMP::RemoveEventListener
void RemoveEventListener(AAMPEventType eventType, EventListener *eventListener)
Remove event listener for eventType.
Definition: main_aamp.cpp:1493
AampCacheHandler::StartPlaylistCache
void StartPlaylistCache()
Start playlist caching.
Definition: AampCacheHandler.cpp:347
eAAMPConfig_BulkTimedMetaReport
@ eAAMPConfig_BulkTimedMetaReport
Definition: AampConfig.h:168
manager.hpp
It contains class referenced by manager.cpp file.
ISCONFIGSET
#define ISCONFIGSET(x)
Definition: AampConfig.h:84
PlayerInstanceAAMP::SetLicenseCustomData
void SetLicenseCustomData(const char *customData)
Set License Custom Data.
Definition: main_aamp.cpp:3007
eAAMPConfig_NativeCCRendering
@ eAAMPConfig_NativeCCRendering
Definition: AampConfig.h:170
PlayerInstanceAAMP::SetVideoRectangle
void SetVideoRectangle(int x, int y, int w, int h)
Set video rectangle.
Definition: main_aamp.cpp:1270
PlayerInstanceAAMP::SubscribeResponseHeaders
void SubscribeResponseHeaders(std::vector< std::string > responseHeaders)
Subscribe array of http response headers.
Definition: main_aamp.cpp:1430
PrivateInstanceAAMP::RemoveEventListener
void RemoveEventListener(AAMPEventType eventType, EventListener *eventListener)
Deregister event lister, Remove listener to aamp events.
Definition: priv_aamp.cpp:2253
PrivateInstanceAAMP::SetPreferredTextLanguages
void SetPreferredTextLanguages(const char *param)
Set Preferred Text Language.
Definition: priv_aamp.cpp:11142
eMEDIAFORMAT_COMPOSITE
@ eMEDIAFORMAT_COMPOSITE
Definition: AampDrmMediaFormat.h:40
PlayerInstanceAAMP::SetInitialBufferDuration
void SetInitialBufferDuration(int durationSec)
Set initial buffer duration in seconds.
Definition: main_aamp.cpp:435
eAAMPConfig_AuthToken
@ eAAMPConfig_AuthToken
Definition: AampConfig.h:308
eAAMPConfig_ReportVideoPTS
@ eAAMPConfig_ReportVideoPTS
Definition: AampConfig.h:131
PlayerInstanceAAMP::AsyncStartStop
void AsyncStartStop()
Enable/Disable async operation.
Definition: main_aamp.cpp:2784
PlayerInstanceAAMP::SetRepairIframes
void SetRepairIframes(bool configState)
To set the repairIframes flag.
Definition: main_aamp.cpp:2875
PlayerInstanceAAMP::mAsyncRunning
bool mAsyncRunning
Definition: main_aamp.h:2024
PlayerInstanceAAMP::GetPreferredLanguages
const char * GetPreferredLanguages()
Get current preferred language list.
Definition: main_aamp.cpp:2387
eAAMPConfig_InitRampDownLimit
@ eAAMPConfig_InitRampDownLimit
Definition: AampConfig.h:235
PlayerInstanceAAMP::GetPlaybackStats
std::string GetPlaybackStats()
Get playback statistics formated for partner apps.
Definition: main_aamp.cpp:3016
eMEDIAFORMAT_DASH
@ eMEDIAFORMAT_DASH
Definition: AampDrmMediaFormat.h:35
PrivateInstanceAAMP::mDynamicDrmDefaultconfig
DynamicDrmInfo mDynamicDrmDefaultconfig
Definition: priv_aamp.h:1096
PlayerInstanceAAMP::XRESupportedTune
void XRESupportedTune(bool xreSupported)
To set whether the JS playback session is from XRE or not.
Definition: main_aamp.cpp:2935
eAAMPConfig_EnableSeekRange
@ eAAMPConfig_EnableSeekRange
Definition: AampConfig.h:159
PlayerInstanceAAMP::SetUseAbsoluteTimeline
void SetUseAbsoluteTimeline(bool configState)
To set UseAbsoluteTimeline for DASH.
Definition: main_aamp.cpp:2865
PlayerInstanceAAMP::PersistBitRateOverSeek
void PersistBitRateOverSeek(bool value)
Enable/disable configuration to persist ABR profile over seek/SAP.
Definition: main_aamp.cpp:2808
PlayerInstanceAAMP::SetAnonymousRequest
void SetAnonymousRequest(bool isAnonymous)
Indicates if session token has to be used with license request or not.
Definition: main_aamp.cpp:1620
PrivateInstanceAAMP::IsTSBSupported
bool IsTSBSupported()
Checking whether TSB enabled or not.
Definition: priv_aamp.h:1679
PrivateInstanceAAMP::GetDurationMs
long long GetDurationMs(void)
Get asset duration in milliseconds.
Definition: priv_aamp.cpp:6798
PlayerInstanceAAMP::GetVideoZoom
int GetVideoZoom(void)
To get video zoom mode.
Definition: main_aamp.cpp:1852
PrivateInstanceAAMP::IsFragmentCachingRequired
bool IsFragmentCachingRequired()
Check if fragment caching is required.
Definition: priv_aamp.cpp:8189
PlayerInstanceAAMP::GetAvailableVideoTracks
std::string GetAvailableVideoTracks()
Get available video tracks.
Definition: main_aamp.cpp:2410
PlayerInstanceAAMP::SetAlternateContents
void SetAlternateContents(const std::string &adBreakId, const std::string &adId, const std::string &url)
Setting the alternate contents' (Ads/blackouts) URL.
Definition: main_aamp.cpp:2106
PrivateInstanceAAMP::SetTextTrack
void SetTextTrack(int trackId, char *data=NULL)
Set text track.
Definition: priv_aamp.cpp:10240
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
eAAMPConfig_CurlStallTimeout
@ eAAMPConfig_CurlStallTimeout
Definition: AampConfig.h:272
PlayerInstanceAAMP::PauseAtInternal
void PauseAtInternal(double secondsRelativeToTuneTime)
Set PauseAt position - Internal function.
Definition: main_aamp.cpp:859
PlayerInstanceAAMP::SetLicenseReqProxy
void SetLicenseReqProxy(const char *licenseProxy)
To set the proxy for license request.
Definition: main_aamp.cpp:2124
PlayerInstanceAAMP::SetVideoTracks
void SetVideoTracks(std::vector< long > bitrates)
Set video tracks.
Definition: main_aamp.cpp:2420
PlayerInstanceAAMP::SetPreferredCodec
void SetPreferredCodec(const char *codecList)
Set optional preferred codec list.
Definition: main_aamp.cpp:2321
eAAMPConfig_MinBitrate
@ eAAMPConfig_MinBitrate
Definition: AampConfig.h:276
StreamAbstractionAAMP::GetVideoBitrate
long GetVideoBitrate(void)
Get the bitrate of current video profile selected.
Definition: streamabstraction.cpp:2419
PlayerInstanceAAMP::AddEventListener
void AddEventListener(AAMPEventType eventType, EventListener *eventListener)
Support multiple listeners for multiple event type.
Definition: main_aamp.cpp:1483
PlayerInstanceAAMP::SetLanguageFormat
void SetLanguageFormat(LangCodePreference preferredFormat, bool useRole=false)
Set Language preferred Format.
Definition: main_aamp.cpp:480
PrivateInstanceAAMP::GetAvailableVideoTracks
std::string GetAvailableVideoTracks()
Get available video tracks.
Definition: priv_aamp.cpp:9482
PlayerInstanceAAMP::SetLinearTrickplayFPS
void SetLinearTrickplayFPS(int linearTrickplayFPS)
Set Linear Trickplay FPS.
Definition: main_aamp.cpp:1655
PrivateInstanceAAMP::GetManifestUrl
std::string & GetManifestUrl(void)
Get manifest URL.
Definition: priv_aamp.h:1890
PlayerInstanceAAMP::SetTextTrack
void SetTextTrack(int trackId, char *ccData=NULL)
Set text track.
Definition: main_aamp.cpp:2566
PlayerInstanceAAMP::SetInitRampdownLimit
void SetInitRampdownLimit(int limit)
Set Initial profile ramp down limit.
Definition: main_aamp.cpp:2658
eAAMPConfig_NetworkTimeout
@ eAAMPConfig_NetworkTimeout
Definition: AampConfig.h:283
StreamAbstractionAAMP::IsStreamerAtLivePoint
bool IsStreamerAtLivePoint()
Whether we are playing at live point or not.
Definition: StreamAbstractionAAMP.h:856
PlayerInstanceAAMP::GetAvailableAudioTracks
std::string GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
Definition: main_aamp.cpp:2428
PlayerInstanceAAMP::GetVideoBitrates
std::vector< long > GetVideoBitrates(void)
To get the available video bitrates.
Definition: main_aamp.cpp:1893
PlayerInstanceAAMP::SetLanguage
void SetLanguage(const char *language)
Set Audio language.
Definition: main_aamp.cpp:1389
PrivateInstanceAAMP::StopDownloads
void StopDownloads()
Stop downloads of all tracks. Used by aamp internally to manage states.
Definition: priv_aamp.cpp:3148
PrivateInstanceAAMP::SetSubtitleMute
void SetSubtitleMute(bool muted)
Set subtitle mute state.
Definition: priv_aamp.cpp:6722
AampConfig
AAMP Config Class defn.
Definition: AampConfig.h:457
PrivateInstanceAAMP::SetScheduler
void SetScheduler(AampScheduler *instance)
Set the scheduler instance to schedule tasks.
Definition: priv_aamp.h:3558
AampConfig::GetConfigValue
bool GetConfigValue(AAMPConfigSettings cfg, std::string &value)
GetConfigValue - Gets configuration for string data type.
Definition: AampConfig.cpp:748
VideoZoomMode
VideoZoomMode
Video zoom mode.
Definition: main_aamp.h:129
PlayerInstanceAAMP::SetInitFragTimeoutRetryCount
void SetInitFragTimeoutRetryCount(int count)
To set the max retry attempts for init frag curl timeout failures.
Definition: main_aamp.cpp:1718
PrivateInstanceAAMP::LockGetPositionMilliseconds
bool LockGetPositionMilliseconds()
Lock GetPositionMilliseconds() returns true if successfull.
Definition: priv_aamp.cpp:6861
PlayerInstanceAAMP::SetRuntimeDRMConfigSupport
void SetRuntimeDRMConfigSupport(bool DynamicDRMSupported)
To set Dynamic DRM feature by Application.
Definition: main_aamp.cpp:3173
PrivateInstanceAAMP::GetState
void GetState(PrivAAMPState &state)
Get player state.
Definition: priv_aamp.cpp:7769
PlayerInstanceAAMP::SetLiveOffset4K
void SetLiveOffset4K(double liveoffset)
Set Live Offset.
Definition: main_aamp.cpp:1674
PlayerInstanceAAMP::mAsyncTuneEnabled
bool mAsyncTuneEnabled
Definition: main_aamp.h:2025
PlayerInstanceAAMP::GetCurrentDRM
const char * GetCurrentDRM()
Get current drm.
Definition: main_aamp.cpp:1547
PlayerInstanceAAMP::SetNewAdBreakerConfig
void SetNewAdBreakerConfig(bool bValue)
Configure New AdBreaker Enable/Disable.
Definition: main_aamp.cpp:2400
eAAMPConfig_ManifestTimeout
@ eAAMPConfig_ManifestTimeout
Definition: AampConfig.h:284
PlayerInstanceAAMP::SetLiveOffset
void SetLiveOffset(double liveoffset)
Set Live Offset.
Definition: main_aamp.cpp:1664
PlayerInstanceAAMP::SetReportVideoPTS
void SetReportVideoPTS(bool enabled)
Enable video PTS reporting in progress event.
Definition: main_aamp.cpp:2733
PlayerInstanceAAMP::SetMaximumBitrate
void SetMaximumBitrate(long bitrate)
Set maximum bitrate value.
Definition: main_aamp.cpp:521
eSTATE_PREPARING
@ eSTATE_PREPARING
Definition: AampEvent.h:161
eAAMPConfig_Disable4K
@ eAAMPConfig_Disable4K
Definition: AampConfig.h:181
AampConfig::ProcessConfigJson
bool ProcessConfigJson(const char *cfg, ConfigPriority owner)
ProcessConfigJson - Function to parse and process json configuration string.
Definition: AampConfig.cpp:889
eAAMPConfig_RampDownLimit
@ eAAMPConfig_RampDownLimit
Definition: AampConfig.h:234
PlayerInstanceAAMP::SetVODTrickplayFPS
void SetVODTrickplayFPS(int vodTrickplayFPS)
Set VOD Trickplay FPS.
Definition: main_aamp.cpp:1646
StreamAbstractionAAMP::StartInjection
virtual void StartInjection(void)=0
Start injection of fragments.
eSTATE_ERROR
@ eSTATE_ERROR
Definition: AampEvent.h:170
PlayerInstanceAAMP::TuneInternal
void TuneInternal(const char *mainManifestUrl, bool autoPlay, const char *contentType, bool bFirstAttempt, bool bFinalAttempt, const char *traceUUID, bool audioDecoderStreamSync)
Tune to a URL.
Definition: main_aamp.cpp:351
AampConfig::ReadOperatorConfiguration
void ReadOperatorConfiguration()
ReadOperatorConfiguration - Reads Operator configuration from RFC and env variables.
Definition: AampConfig.cpp:1789
PlayerInstanceAAMP::Seek
void Seek(double secondsRelativeToTuneTime, bool keepPaused=false)
Seek to a time.
Definition: main_aamp.cpp:971
AampConfig::ReadAampCfgJsonFile
bool ReadAampCfgJsonFile()
ReadAampCfgJsonFile - Function to parse and process configuration file in json format.
Definition: AampConfig.cpp:1523
PlayerInstanceAAMP::GetMaximumBitrate
long GetMaximumBitrate(void)
Get maximum bitrate value.
Definition: main_aamp.cpp:537
PlayerInstanceAAMP::UnloadJS
void UnloadJS(void *context)
Definition: FakePlayerInstanceAamp.cpp:50
AampSecManager::DestroyInstance
static void DestroyInstance()
To release AampSecManager singelton instance.
Definition: AampSecManager.cpp:47
eAAMPConfig_NetworkProxy
@ eAAMPConfig_NetworkProxy
Definition: AampConfig.h:306
PlayerInstanceAAMP::SetPausedBehavior
void SetPausedBehavior(int behavior)
To set preferred paused state behavior.
Definition: main_aamp.cpp:2850
PlayerInstanceAAMP::SetCCStatus
void SetCCStatus(bool enabled)
Set CC visibility on/off.
Definition: main_aamp.cpp:2620
PrivateInstanceAAMP::UnRegisterEvents
void UnRegisterEvents(EventListener *eventListener)
UnRegister event listener.
Definition: priv_aamp.h:1996
PlayerInstanceAAMP::SetCEAFormat
void SetCEAFormat(int format)
Set the CEA format for force setting.
Definition: main_aamp.cpp:2667
PlayerInstanceAAMP::SetParallelPlaylistDL
void SetParallelPlaylistDL(bool bValue)
Set parallel playlist download config value.
Definition: main_aamp.cpp:2192
PrivateInstanceAAMP::GetThumbnailTracks
std::string GetThumbnailTracks()
Get available thumbnail tracks.
Definition: priv_aamp.cpp:6461
StreamAbstractionAAMP::GetAudioBitrate
long GetAudioBitrate(void)
Get the bitrate of current audio profile selected.
Definition: streamabstraction.cpp:2428
PrivateInstanceAAMP::mAudioTuple
AudioTrackTuple mAudioTuple
Definition: priv_aamp.h:981
AampScheduler::SetLogger
void SetLogger(AampLogManager *logObj)
Set the logger instance for the Scheduler.
Definition: AampScheduler.h:169
PlayerInstanceAAMP::SetPlaylistTimeout
void SetPlaylistTimeout(double timeout)
Optionally override default HLS main manifest download timeout with app-specific value.
Definition: main_aamp.cpp:2009
AampCCManager::DestroyInstance
static void DestroyInstance()
Destroy instance.
Definition: AampCCManager.cpp:817
PlayerInstanceAAMP::SetAuxiliaryLanguage
void SetAuxiliaryLanguage(const std::string &language)
Set auxiliary language.
Definition: main_aamp.cpp:2944
PlayerInstanceAAMP::SetParallelPlaylistRefresh
void SetParallelPlaylistRefresh(bool bValue)
Set parallel playlist download config value for linear.
Definition: main_aamp.cpp:2201
eAAMPConfig_PlaylistParallelFetch
@ eAAMPConfig_PlaylistParallelFetch
Definition: AampConfig.h:166
eAAMPConfig_LimitResolution
@ eAAMPConfig_LimitResolution
Definition: AampConfig.h:175
DynamicDrmInfo
Definition: priv_aamp.h:366
AampSecManager.h
Class to communicate with SecManager Thunder plugin.
PlayerInstanceAAMP::SetDisable4K
void SetDisable4K(bool value)
Disable 4K Support in player.
Definition: main_aamp.cpp:2069
eAAMPConfig_EnableGstPositionQuery
@ eAAMPConfig_EnableGstPositionQuery
Definition: AampConfig.h:150
PlayerInstanceAAMP::PauseAt
void PauseAt(double position)
Set PauseAt position.
Definition: main_aamp.cpp:837
PrivateInstanceAAMP::TuneFail
void TuneFail(bool fail)
Profiler for failure tune.
Definition: priv_aamp.cpp:3018
PrivateInstanceAAMP::GetPositionMilliseconds
long long GetPositionMilliseconds(void)
Get current stream playback position in milliseconds.
Definition: priv_aamp.cpp:6888
eAAMPConfig_DRMDecryptThreshold
@ eAAMPConfig_DRMDecryptThreshold
Definition: AampConfig.h:236
AampScheduler::StartScheduler
void StartScheduler()
To start scheduler thread.
Definition: AampScheduler.cpp:52
PlayerInstanceAAMP::SetAuxiliaryLanguageInternal
void SetAuxiliaryLanguageInternal(const std::string &language)
Set auxiluerry track language.
Definition: main_aamp.cpp:2965
StreamAbstractionAAMP::SetThumbnailTrack
virtual bool SetThumbnailTrack(int)=0
Set thumbnail bitrate.
eAAMPConfig_AnonymousLicenseRequest
@ eAAMPConfig_AnonymousLicenseRequest
Definition: AampConfig.h:116
eAAMPConfig_CustomLicenseData
@ eAAMPConfig_CustomLicenseData
Definition: AampConfig.h:320
AAMP_CUSTOM_DEV_CFG_SETTING
@ AAMP_CUSTOM_DEV_CFG_SETTING
Definition: AampDefine.h:216
PrivateInstanceAAMP::ReleaseStreamLock
void ReleaseStreamLock()
release streamsink lock
Definition: priv_aamp.cpp:10689
AampCacheHandler::RetrieveFromPlaylistCache
bool RetrieveFromPlaylistCache(const std::string url, GrowableBuffer *buffer, std::string &effectiveUrl)
Retrieve playlist from cache.
Definition: AampCacheHandler.cpp:111
PlayerInstanceAAMP::GetPreferredTextProperties
std::string GetPreferredTextProperties()
Get preferred text prioperties.
Definition: main_aamp.cpp:2355
PlayerInstanceAAMP
Player interface class for the JS pluggin.
Definition: main_aamp.h:692
PlayerInstanceAAMP::SetOutputResolutionCheck
void SetOutputResolutionCheck(bool bValue)
Set Display resolution check for video profile filtering.
Definition: main_aamp.cpp:2227
eAAMPConfig_EnableRectPropertyCfg
@ eAAMPConfig_EnableRectPropertyCfg
Definition: AampConfig.h:130
eAAMPConfig_DisableEC3
@ eAAMPConfig_DisableEC3
Definition: AampConfig.h:107
AsyncTaskObj
Async task operations.
Definition: AampScheduler.h:57
PrivateInstanceAAMP::PositionInfo::getTimeSinceUpdateMs
long long getTimeSinceUpdateMs() const
For objects containing real data (check using isPopulated()) this returns the number of milliseconds ...
Definition: priv_aamp.h:882
PlayerInstanceAAMP::GetAudioTrackInfo
std::string GetAudioTrackInfo()
Get current audio track index.
Definition: main_aamp.cpp:2438
PlayerInstanceAAMP::mPrvAampMtx
static std::mutex mPrvAampMtx
Definition: main_aamp.h:2023
eSTATE_INITIALIZING
@ eSTATE_INITIALIZING
Definition: AampEvent.h:159
PlayerInstanceAAMP::SetStallErrorCode
void SetStallErrorCode(int errorCode)
To set the error code to be used for playback stalled error.
Definition: main_aamp.cpp:1684
AampScheduler::ResumeScheduler
void ResumeScheduler()
To release execution lock.
Definition: AampScheduler.cpp:208
PrivateInstanceAAMP::playerStartedWithTrickPlay
bool playerStartedWithTrickPlay
Definition: priv_aamp.h:1092
AampCCManagerBase::IsOOBCCRenderingSupported
bool IsOOBCCRenderingSupported()
To check whether Out of Band Closed caption/Subtile rendering supported or not.
Definition: AampCCManager.cpp:781
PlayerInstanceAAMP::GetCCStatus
bool GetCCStatus(void)
Get CC visibility on/off.
Definition: main_aamp.cpp:2630
eAAMPConfig_LiveOffset
@ eAAMPConfig_LiveOffset
Definition: AampConfig.h:288
PlayerInstanceAAMP::SetDownloadBufferSize
void SetDownloadBufferSize(int bufferSize)
To set the download buffer size value.
Definition: main_aamp.cpp:2018
PrivateInstanceAAMP::GetAvailableAudioTracks
std::string GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
Definition: priv_aamp.cpp:9572
eAAMPConfig_CKLicenseServerUrl
@ eAAMPConfig_CKLicenseServerUrl
Definition: AampConfig.h:298
eAAMPConfig_RuntimeDRMConfig
@ eAAMPConfig_RuntimeDRMConfig
Definition: AampConfig.h:201
PlayerInstanceAAMP::GetInitialBitrate4k
long GetInitialBitrate4k(void)
To get the initial bitrate value for 4K assets.
Definition: main_aamp.cpp:1981
gpGlobalConfig
AampConfig * gpGlobalConfig
Global configuration.
Definition: main_aamp.cpp:48
eAAMPConfig_LanguageCodePreference
@ eAAMPConfig_LanguageCodePreference
Definition: AampConfig.h:233
libIBus.h
RDK IARM-Bus API Declarations.
PlayerInstanceAAMP::ResetConfiguration
void ResetConfiguration()
API to reset configuration across tunes for single player instance.
Definition: main_aamp.cpp:264
eAAMPConfig_UseWesterosSink
@ eAAMPConfig_UseWesterosSink
Definition: AampConfig.h:153
PlayerInstanceAAMP::IsJsInfoLoggingEnabled
bool IsJsInfoLoggingEnabled()
Get jsinfo config value (default false)
Definition: main_aamp.cpp:1514
PrivateInstanceAAMP::PositionCache::GetInfo
PositionInfo< TPOSITIONCACHE > GetInfo()
Retrieve the stored position information.
Definition: priv_aamp.h:934
PrivateInstanceAAMP::DisableContentRestrictions
void DisableContentRestrictions(long grace=0, long time=-1, bool eventChange=false)
Disable Content Restrictions - unlock.
Definition: priv_aamp.cpp:10599
PrivateInstanceAAMP::GetPreferredDRM
DRMSystems GetPreferredDRM()
Get Preferred DRM.
Definition: priv_aamp.cpp:8843
PlayerInstanceAAMP::SetAudioVolume
void SetAudioVolume(int volume)
Set Audio Volume.
Definition: main_aamp.cpp:1361
eAAMPConfig_XRESupportedTune
@ eAAMPConfig_XRESupportedTune
Definition: AampConfig.h:193
GrowableBuffer::ptr
char * ptr
Definition: AampMemoryUtils.h:41
PrivateInstanceAAMP::GetTextStyle
std::string GetTextStyle()
Get style options for text track rendering.
Definition: priv_aamp.cpp:10464
aampgstplayer.h
Gstreamer based player for AAMP.
getWorkingTrickplayRate
float getWorkingTrickplayRate(float rate)
Get compatible trickplay for 6s cadense of iframe track from the given rates.
Definition: AampUtils.cpp:944
eAAMPConfig_AvgBWForABR
@ eAAMPConfig_AvgBWForABR
Definition: AampConfig.h:169
eAAMPConfig_DisableAC3
@ eAAMPConfig_DisableAC3
Definition: AampConfig.h:112
AampConfig::DoCustomSetting
void DoCustomSetting(ConfigPriority owner)
DoCustomSetting - Function to do override , to avoid complexity with multiple configs.
Definition: AampConfig.cpp:1993
PlayerInstanceAAMP::detach
void detach()
Soft stop the player instance.
Definition: main_aamp.cpp:385
PlayerInstanceAAMP::SetAudioTrackInternal
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..
Definition: main_aamp.cpp:2306
PrivateInstanceAAMP::SetStreamSink
void SetStreamSink(StreamSink *streamSink)
Setting the stream sink.
Definition: priv_aamp.cpp:7034
PrivateInstanceAAMP::StopPausePositionMonitoring
void StopPausePositionMonitoring(std::string reason)
stop the PausePositionMonitoring thread used for PauseAt functionality
Definition: priv_aamp.cpp:1839
StreamSink::Pause
virtual bool Pause(bool pause, bool forceStopGstreamerPreBuffering)
Enabled or disable playback pause.
Definition: main_aamp.h:491
PlayerInstanceAAMP::SeekInternal
void SeekInternal(double secondsRelativeToTuneTime, bool keepPaused)
Seek to a time - Internal function.
Definition: main_aamp.cpp:996
PrivateInstanceAAMP::Stop
void Stop(void)
Stop playback and release resources.
Definition: priv_aamp.cpp:7068
PlayerInstanceAAMP::SetTextTrackInternal
void SetTextTrackInternal(int trackId, char *data)
Set text track by Id.
Definition: main_aamp.cpp:2598
PlayerInstanceAAMP::GetPreferredAudioProperties
std::string GetPreferredAudioProperties()
Get preferred audio prioperties.
Definition: main_aamp.cpp:2345
eAAMPConfig_RetuneForGSTError
@ eAAMPConfig_RetuneForGSTError
Definition: AampConfig.h:156
PlayerInstanceAAMP::SetSubtitleMute
void SetSubtitleMute(bool muted)
Enable/ Disable Subtitle.
Definition: main_aamp.cpp:1338
PrivateInstanceAAMP::GetTextTrackInfo
std::string GetTextTrackInfo()
Get current audio track index.
Definition: priv_aamp.cpp:10095
eAAMPConfig_JsInfoLogging
@ eAAMPConfig_JsInfoLogging
Definition: AampConfig.h:206
PlayerInstanceAAMP::ProcessContentProtectionDataConfig
void ProcessContentProtectionDataConfig(const char *jsonbuffer)
Definition: main_aamp.cpp:3026
PrivateInstanceAAMP::TeardownStream
void TeardownStream(bool newTune)
Terminate the stream.
Definition: priv_aamp.cpp:4641
PrivateInstanceAAMP::GetContentType
ContentType GetContentType() const
Get Content Type.
Definition: priv_aamp.cpp:6193
AampCacheHandler.h
Cache handler for AAMP.
eSTATE_RELEASED
@ eSTATE_RELEASED
Definition: AampEvent.h:171
StreamAbstractionAAMP::GetAvailableAudioTracks
virtual std::vector< AudioTrackInfo > & GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
Definition: StreamAbstractionAAMP.h:1105
eAAMPConfig_LicenseProxy
@ eAAMPConfig_LicenseProxy
Definition: AampConfig.h:307
PlayerInstanceAAMP::SetAvgBWForABR
void SetAvgBWForABR(bool useAvgBW)
Indicates average BW to be used for ABR Profiling.
Definition: main_aamp.cpp:1629
eDRM_MAX_DRMSystems
@ eDRM_MAX_DRMSystems
Definition: AampDrmSystems.h:42
AampScheduler::StopScheduler
void StopScheduler()
To stop scheduler and associated resources.
Definition: AampScheduler.cpp:173
PrivateInstanceAAMP::IsLive
bool IsLive(void)
Checking if the stream is live or not.
Definition: priv_aamp.cpp:7042
PrivateInstanceAAMP::GetPreferredAudioProperties
std::string GetPreferredAudioProperties()
get the current audio preference set by user
Definition: priv_aamp.cpp:9431
AampConfig.h
Configurations for AAMP.
eTUNETYPE_SEEKTOLIVE
@ eTUNETYPE_SEEKTOLIVE
Definition: priv_aamp.h:195
eAAMPConfig_LinearTrickPlayFPS
@ eAAMPConfig_LinearTrickPlayFPS
Definition: AampConfig.h:226
PlayerInstanceAAMP::GetState
PrivAAMPState GetState(void)
To get the current AAMP state.
Definition: main_aamp.cpp:1765
PrivateInstanceAAMP::TryStreamLock
bool TryStreamLock()
try to acquire streamsink lock
Definition: priv_aamp.cpp:10680
PrivateInstanceAAMP::NotifySpeedChanged
void NotifySpeedChanged(float rate, bool changeState=true)
Notify speed change event to listeners.
Definition: priv_aamp.cpp:2582
PlayerInstanceAAMP::SetRate
void SetRate(float rate, int overshootcorrection=0)
Set playback rate.
Definition: main_aamp.cpp:561
PrivateInstanceAAMP::seek_pos_seconds
double seek_pos_seconds
Definition: priv_aamp.h:954
PrivateInstanceAAMP::IsOTAContent
bool IsOTAContent()
Checking whether OTA content or not.
Definition: priv_aamp.h:1706
eAAMPConfig_DisableATMOS
@ eAAMPConfig_DisableATMOS
Definition: AampConfig.h:108
PlayerInstanceAAMP::SetInitialBitrate
void SetInitialBitrate(long bitrate)
To set the initial bitrate value.
Definition: main_aamp.cpp:1953
PlayerInstanceAAMP::GetCurrentAudioLanguage
const char * GetCurrentAudioLanguage()
Get current audio language.
Definition: main_aamp.cpp:1523
PrivateInstanceAAMP::SetVideoTracks
void SetVideoTracks(std::vector< long > bitrateList)
set birate for video tracks selection
Definition: priv_aamp.cpp:9546
PlayerInstanceAAMP::SetPreferredTextLanguages
void SetPreferredTextLanguages(const char *param)
Set optional preferred language list.
Definition: main_aamp.cpp:2371
eAAMPConfig_TuneEventConfig
@ eAAMPConfig_TuneEventConfig
Definition: AampConfig.h:224
eAAMPConfig_SslVerifyPeer
@ eAAMPConfig_SslVerifyPeer
Definition: AampConfig.h:126
eAAMPConfig_SegmentInjectThreshold
@ eAAMPConfig_SegmentInjectThreshold
Definition: AampConfig.h:237
PlayerInstanceAAMP::SetSessionToken
void SetSessionToken(std::string sessionToken)
Set the session token for player.
Definition: main_aamp.cpp:2712
AampConfig::ReadDeviceCapability
void ReadDeviceCapability()
Definition: AampConfig.cpp:609
StreamSink
GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin.
Definition: main_aamp.h:385
eMEDIAFORMAT_OTA
@ eMEDIAFORMAT_OTA
Definition: AampDrmMediaFormat.h:38
PlayerInstanceAAMP::Tune
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...
Definition: main_aamp.cpp:312
PlayerInstanceAAMP::SetPreferredLanguages
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.
Definition: main_aamp.cpp:2363
eAAMPConfig_ABRBufferCheckEnabled
@ eAAMPConfig_ABRBufferCheckEnabled
Definition: AampConfig.h:164
AAMPLOG_TRACE
#define AAMPLOG_TRACE(FORMAT,...)
AAMP logging defines, this can be enabled through setLogLevel() as per the need.
Definition: AampLogManager.h:83
PlayerInstanceAAMP::GetThumbnails
std::string GetThumbnails(double sduration, double eduration)
To get preferred thumbnails for the duration.
Definition: main_aamp.cpp:2703
StreamAbstractionAAMP::NotifyPlaybackPaused
virtual void NotifyPlaybackPaused(bool paused)
Function called when playback is paused to update related flags.
Definition: streamabstraction.cpp:2245
AampConfig::RestoreConfiguration
void RestoreConfiguration(ConfigPriority owner, AampLogManager *mLogObj)
RestoreConfiguration - Function is restore last configuration value from current ownership.
Definition: AampConfig.cpp:2147
PlayerInstanceAAMP::SetAudioBitrate
void SetAudioBitrate(long bitrate)
To set a preferred bitrate for audio profile.
Definition: main_aamp.cpp:1844
eAAMPConfig_ForceEC3
@ eAAMPConfig_ForceEC3
Definition: AampConfig.h:106
eAAMPConfig_PropogateURIParam
@ eAAMPConfig_PropogateURIParam
Definition: AampConfig.h:152
PrivateInstanceAAMP::IsActiveInstancePresent
static bool IsActiveInstancePresent()
Check if any active PrivateInstanceAAMP available.
Definition: priv_aamp.cpp:10472
GrowableBuffer
Structure of GrowableBuffer.
Definition: AampMemoryUtils.h:39
AampConfig::ShowOperatorSetConfiguration
void ShowOperatorSetConfiguration()
ShowOperatorSetConfiguration - List all operator configured settings.
Definition: AampConfig.cpp:1909
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
PlayerInstanceAAMP::GetPlaybackDuration
double GetPlaybackDuration(void)
To get the current asset's duration.
Definition: main_aamp.cpp:1738
PrivAAMPState
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
Definition: AampEvent.h:156
PlayerInstanceAAMP::SetNetworkTimeout
void SetNetworkTimeout(double timeout)
To override default curl timeout for playlist/fragment downloads.
Definition: main_aamp.cpp:1991
eAAMPConfig_LivePauseBehavior
@ eAAMPConfig_LivePauseBehavior
Definition: AampConfig.h:250
PlayerInstanceAAMP::GetTextTrack
int GetTextTrack()
Get current text track index.
Definition: main_aamp.cpp:2610
AampLogManager::setPlayerId
void setPlayerId(int playerId)
Set PlayerId.
Definition: AampLogManager.h:243
PlayerInstanceAAMP::SetPreferredDRM
void SetPreferredDRM(DRMSystems drmType)
Set Preferred DRM.
Definition: main_aamp.cpp:2027
PlayerInstanceAAMP::GetAudioBitrate
long GetAudioBitrate(void)
To get the bitrate of current audio profile.
Definition: main_aamp.cpp:1826
PrivateInstanceAAMP::mIsStream4K
bool mIsStream4K
Definition: priv_aamp.h:1107
StreamAbstractionAAMP::GetAvailableTextTracks
virtual std::vector< TextTrackInfo > & GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
Definition: StreamAbstractionAAMP.h:1112
eMEDIAFORMAT_HLS
@ eMEDIAFORMAT_HLS
Definition: AampDrmMediaFormat.h:34
eAAMPConfig_AsyncTune
@ eAAMPConfig_AsyncTune
Definition: AampConfig.h:173
PlayerInstanceAAMP::SetMaxPlaylistCacheSize
void SetMaxPlaylistCacheSize(int cacheSize)
Set Maximum Cache Size for storing playlist.
Definition: main_aamp.cpp:454
PlayerInstanceAAMP::LoadJS
void LoadJS(void *context)
Definition: FakePlayerInstanceAamp.cpp:49
PlayerInstanceAAMP::SetRateAndSeek
void SetRateAndSeek(int rate, double secondsRelativeToTuneTime)
Seek to a time and playback with a new rate.
Definition: main_aamp.cpp:1202
PrivateInstanceAAMP::SetAuxiliaryLanguage
void SetAuxiliaryLanguage(const std::string &language)
Set auxiliary language.
Definition: priv_aamp.h:3617
irMgr.h
IARM-Bus IR Manager API.
PrivateInstanceAAMP::UnlockGetPositionMilliseconds
void UnlockGetPositionMilliseconds()
Unlock GetPositionMilliseconds()
Definition: priv_aamp.cpp:6873
PrivateInstanceAAMP::mbPlayEnabled
bool mbPlayEnabled
Definition: priv_aamp.h:1043
PrivateInstanceAAMP::AddCustomHTTPHeader
void AddCustomHTTPHeader(std::string headerName, std::vector< std::string > headerValue, bool isLicenseHeader)
Add/Remove a custom HTTP header and value.
Definition: priv_aamp.cpp:8384
eAAMPConfig_MaxPlaylistCacheSize
@ eAAMPConfig_MaxPlaylistCacheSize
Definition: AampConfig.h:230
AampScheduler::SuspendScheduler
void SuspendScheduler()
To acquire execution lock for synchronisation purposes.
Definition: AampScheduler.cpp:198
PlayerInstanceAAMP::SetNativeCCRendering
void SetNativeCCRendering(bool enable)
Enable/disable the native CC rendering feature.
Definition: main_aamp.cpp:2488
PrivateInstanceAAMP::GetCCStatus
bool GetCCStatus(void)
Get CC visibility on/off.
Definition: priv_aamp.cpp:10416
PrivateInstanceAAMP::IsAudioLanguageSupported
bool IsAudioLanguageSupported(const char *checkLanguage)
Checking whether audio language supported.
Definition: priv_aamp.cpp:3289
PlayerInstanceAAMP::GetAvailableTextTracks
std::string GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
Definition: main_aamp.cpp:2460
PlayerInstanceAAMP::GetVideoMute
bool GetVideoMute(void)
To get video mute status.
Definition: main_aamp.cpp:1861
PrivateInstanceAAMP::GetMediaFormatType
MediaFormat GetMediaFormatType(const char *url)
Assign the correct mediaFormat by parsing the url.
Definition: priv_aamp.cpp:5806
PlayerInstanceAAMP::SetMatchingBaseUrlConfig
void SetMatchingBaseUrlConfig(bool bValue)
Set Matching BaseUrl Config Configuration.
Definition: main_aamp.cpp:2235
eAAMPConfig_DefaultBitrate
@ eAAMPConfig_DefaultBitrate
Definition: AampConfig.h:268
eAAMPConfig_CEAPreferred
@ eAAMPConfig_CEAPreferred
Definition: AampConfig.h:243
PlayerInstanceAAMP::SetRateInternal
void SetRateInternal(float rate, int overshootcorrection)
Set playback rate - Internal function.
Definition: main_aamp.cpp:591
PlayerInstanceAAMP::EnableVideoRectangle
void EnableVideoRectangle(bool rectProperty)
Set video rectangle property.
Definition: main_aamp.cpp:2506
PlayerInstanceAAMP::GetAudioBitrates
std::vector< long > GetAudioBitrates(void)
To get the available audio bitrates.
Definition: main_aamp.cpp:1935
PlayerInstanceAAMP::SetSegmentInjectFailCount
void SetSegmentInjectFailCount(int value)
Set retry limit on Segment injection failure.
Definition: main_aamp.cpp:419
PlayerInstanceAAMP::SetRetuneForUnpairedDiscontinuity
void SetRetuneForUnpairedDiscontinuity(bool bValue)
Set unpaired discontinuity retune flag.
Definition: main_aamp.cpp:2088
PrivateInstanceAAMP::pipeline_paused
bool pipeline_paused
Definition: priv_aamp.h:958
AampConfig::ShowDevCfgConfiguration
void ShowDevCfgConfiguration()
ShowDevCfgConfiguration - List all developer configured settings.
Definition: AampConfig.cpp:1947
StreamAbstractionAAMP::SeekPosUpdate
virtual void SeekPosUpdate(double secondsRelativeToTuneTime)=0
Update seek position when player is initialized.
PlayerInstanceAAMP::SetWesterosSinkConfig
void SetWesterosSinkConfig(bool bValue)
Set Westeros sink configuration.
Definition: main_aamp.cpp:2210
PlayerInstanceAAMP::SetDownloadStallTimeout
void SetDownloadStallTimeout(long stallTimeout)
To set the curl stall timeout value.
Definition: main_aamp.cpp:2133
PrivateInstanceAAMP::SetVideoZoom
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
Definition: priv_aamp.cpp:6704
PlayerInstanceAAMP::GetRampDownLimit
int GetRampDownLimit(void)
Get profile ramp down limit.
Definition: main_aamp.cpp:470
PrivateInstanceAAMP::mbUsingExternalPlayer
bool mbUsingExternalPlayer
Definition: priv_aamp.h:1069
PrivateInstanceAAMP::StartPausePositionMonitoring
void StartPausePositionMonitoring(long long pausePositionMilliseconds)
start the PausePositionMonitoring thread used for PauseAt functionality
Definition: priv_aamp.cpp:1811
AAMPEventType
AAMPEventType
Type of the events sending to the JSPP player.
Definition: AampEvent.h:44
PrivateInstanceAAMP::SetVideoRectangle
void SetVideoRectangle(int x, int y, int w, int h)
Set video rectangle.
Definition: priv_aamp.cpp:6667
PlayerInstanceAAMP::GetManifest
std::string GetManifest(void)
To get the available manifest.
Definition: main_aamp.cpp:1911
AampCCManager::GetInstance
static AampCCManagerBase * GetInstance()
Get the singleton instance.
Definition: AampCCManager.cpp:799
PlayerInstanceAAMP::SetAudioTrack
void SetAudioTrack(std::string language="", std::string rendition="", std::string type="", std::string codec="", unsigned int channel=0, std::string label="")
Set audio track.
Definition: main_aamp.cpp:2282
AAMP_MAXIMUM_AUDIO_LEVEL
#define AAMP_MAXIMUM_AUDIO_LEVEL
Definition: priv_aamp.h:131
PlayerInstanceAAMP::GetAvailableThumbnailTracks
std::string GetAvailableThumbnailTracks(void)
To get the available bitrates for thumbnails.
Definition: main_aamp.cpp:2678
eTUNETYPE_SEEKTOEND
@ eTUNETYPE_SEEKTOEND
Definition: priv_aamp.h:199
eAAMPConfig_DisableAC4
@ eAAMPConfig_DisableAC4
Definition: AampConfig.h:109
PrivateInstanceAAMP::mcurrent_keyIdArray
std::vector< uint8_t > mcurrent_keyIdArray
Definition: priv_aamp.h:1095
eSTATE_IDLE
@ eSTATE_IDLE
Definition: AampEvent.h:158
PlayerInstanceAAMP::SetStereoOnlyPlayback
void SetStereoOnlyPlayback(bool bValue)
Set Stereo Only Playback.
Definition: main_aamp.cpp:2044
PlayerInstanceAAMP::SetAppName
void SetAppName(std::string name)
Set the application name which has created PlayerInstanceAAMP, for logging purposes.
Definition: main_aamp.cpp:2480
PlayerInstanceAAMP::SetLicenseServerURL
void SetLicenseServerURL(const char *url, DRMSystems type=eDRM_MAX_DRMSystems)
Set License Server URL.
Definition: main_aamp.cpp:1590
PlayerInstanceAAMP::DisableContentRestrictions
void DisableContentRestrictions(long grace, long time, bool eventChange)
Disable Content Restrictions - unlock.
Definition: main_aamp.cpp:2742
PlayerInstanceAAMP::Stop
void Stop(bool sendStateChangeEvent=true)
Stop playback and release resources.
Definition: main_aamp.cpp:282
eAAMPConfig_PlaylistParallelRefresh
@ eAAMPConfig_PlaylistParallelRefresh
Definition: AampConfig.h:167
eAAMPConfig_VODTrickPlayFPS
@ eAAMPConfig_VODTrickPlayFPS
Definition: AampConfig.h:225
PlayerInstanceAAMP::IsOOBCCRenderingSupported
bool IsOOBCCRenderingSupported()
Definition: main_aamp.cpp:3183
eDRM_NONE
@ eDRM_NONE
Definition: AampDrmSystems.h:35
eAAMPConfig_RetuneForUnpairDiscontinuity
@ eAAMPConfig_RetuneForUnpairDiscontinuity
Definition: AampConfig.h:155
ContentType
ContentType
Asset's content types.
Definition: AampProfiler.h:99
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
eAAMPConfig_DefaultBitrate4K
@ eAAMPConfig_DefaultBitrate4K
Definition: AampConfig.h:269
PlayerInstanceAAMP::SetPreCacheTimeWindow
void SetPreCacheTimeWindow(int nTimeWindow)
SetPreCacheTimeWindow Function to Set PreCache Time.
Definition: main_aamp.cpp:1637
PrivateInstanceAAMP::SetEventPriorityAsyncTune
void SetEventPriorityAsyncTune(bool bValue)
Set async tune configuration for EventPriority.
Definition: priv_aamp.cpp:6631
PlayerInstanceAAMP::GetId
int GetId(void)
Definition: main_aamp.cpp:1750
eAAMPConfig_MaxBitrate
@ eAAMPConfig_MaxBitrate
Definition: AampConfig.h:277
PlayerInstanceAAMP::SetVideoBitrate
void SetVideoBitrate(long bitrate)
To set a preferred bitrate for video profile.
Definition: main_aamp.cpp:1805
PlayerInstanceAAMP::~PlayerInstanceAAMP
~PlayerInstanceAAMP()
PlayerInstanceAAMP Destructor.
Definition: main_aamp.cpp:203
PrivateInstanceAAMP::mApplyCachedVideoMute
bool mApplyCachedVideoMute
Definition: priv_aamp.h:1094
eAAMPConfig_SetLicenseCaching
@ eAAMPConfig_SetLicenseCaching
Definition: AampConfig.h:162
PrivateInstanceAAMP::GetCurrentDRM
std::shared_ptr< AampDrmHelper > GetCurrentDRM()
Get current drm.
Definition: priv_aamp.cpp:6453
PlayerInstanceAAMP::SetTextStyle
void SetTextStyle(const std::string &options)
Set style options for text track rendering.
Definition: main_aamp.cpp:2638
DRMSystems
DRMSystems
DRM system types.
Definition: AampDrmSystems.h:33
PrivateInstanceAAMP::GetPauseOnFirstVideoFrameDisp
bool GetPauseOnFirstVideoFrameDisp(void)
GetPauseOnFirstVideoFrameDisplay.
Definition: priv_aamp.cpp:11571
PlayerInstanceAAMP::PlayerInstanceAAMP
PlayerInstanceAAMP(StreamSink *streamSink=NULL, std::function< void(uint8_t *, int, int, int) > exportFrames=nullptr)
PlayerInstanceAAMP Constructor.
Definition: main_aamp.cpp:105
eMEDIAFORMAT_HLS_MP4
@ eMEDIAFORMAT_HLS_MP4
Definition: AampDrmMediaFormat.h:37
PlayerInstanceAAMP::GetAAMPConfig
std::string GetAAMPConfig()
GetAAMPConfig - GetAamp Config as JSON string.
Definition: main_aamp.cpp:2925
PlayerInstanceAAMP::SetDownloadLowBWTimeout
void SetDownloadLowBWTimeout(long lowBWTimeout)
To set the curl download low bandwidth timeout value.
Definition: main_aamp.cpp:2157
PrivateInstanceAAMP::SetCCStatus
void SetCCStatus(bool enabled)
Set CC visibility on/off.
Definition: priv_aamp.cpp:10394
eAAMPConfig_EnableABR
@ eAAMPConfig_EnableABR
Definition: AampConfig.h:97
PrivateInstanceAAMP::EnableContentRestrictions
void EnableContentRestrictions()
Enable Content Restrictions - lock.
Definition: priv_aamp.cpp:10618
PlayerInstanceAAMP::GetTextStyle
std::string GetTextStyle()
Get style options for text track rendering.
Definition: main_aamp.cpp:2648
StreamAbstractionAAMP::GetAudioBitrates
virtual std::vector< long > GetAudioBitrates(void)=0
Get available audio bitrates.
PlayerInstanceAAMP::sp_aamp
std::shared_ptr< PrivateInstanceAAMP > sp_aamp
Definition: main_aamp.h:1944
PlayerInstanceAAMP::SeekToLive
void SeekToLive(bool keepPaused=false)
Seek to live point.
Definition: main_aamp.cpp:1144
PrivateInstanceAAMP::SetAlternateContents
void SetAlternateContents(const std::string &adBreakId, const std::string &adId, const std::string &url)
Setting the alternate contents' (Ads/blackouts) URL.
Definition: priv_aamp.cpp:8868
PlayerInstanceAAMP::GetAudioVolume
int GetAudioVolume(void)
To get the current audio volume.
Definition: main_aamp.cpp:1870
PrivateInstanceAAMP::GetAvailableTextTracks
std::string GetAvailableTextTracks(bool alltrack=false)
Get available text tracks.
Definition: priv_aamp.cpp:9676
PlayerInstanceAAMP::AddPageHeaders
void AddPageHeaders(std::map< std::string, std::string > customHttpHeaders)
Applies the custom http headers for page (Injector bundle) received from the js layer.
Definition: main_aamp.cpp:1563
PlayerInstanceAAMP::SetPreferredRenditions
void SetPreferredRenditions(const char *renditionList)
Set optional preferred rendition list.
Definition: main_aamp.cpp:2337
eAAMPConfig_PersistentBitRateOverSeek
@ eAAMPConfig_PersistentBitRateOverSeek
Definition: AampConfig.h:161
PrivateInstanceAAMP::GetTextTrack
int GetTextTrack()
Get current text track index.
Definition: priv_aamp.cpp:10362
PlayerInstanceAAMP::SetSubscribedTags
void SetSubscribedTags(std::vector< std::string > subscribedTags)
Set array of subscribed tags.
Definition: main_aamp.cpp:1415
PrivateInstanceAAMP::GetPositionSeconds
double GetPositionSeconds(void)
Definition: priv_aamp.h:1607
eAAMPConfig_MatchBaseUrl
@ eAAMPConfig_MatchBaseUrl
Definition: AampConfig.h:157
eAAMPConfig_PreCachePlaylistTime
@ eAAMPConfig_PreCachePlaylistTime
Definition: AampConfig.h:242
PrivateInstanceAAMP::EnableDownloads
void EnableDownloads(void)
Enable downloads after aamp_DisableDownloads. Called after stopping fragment collector thread.
Definition: priv_aamp.cpp:6761
PlayerInstanceAAMP::mInternalStreamSink
StreamSink * mInternalStreamSink
Definition: main_aamp.h:2021
StreamSink::Configure
virtual void Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false)
Configure output formats.
Definition: main_aamp.h:400
PrivateInstanceAAMP::GetPreferredTextProperties
std::string GetPreferredTextProperties()
get the current text preference set by user
Definition: priv_aamp.cpp:9384
PlayerInstanceAAMP::SetMinimumBitrate
void SetMinimumBitrate(long bitrate)
Set minimum bitrate value.
Definition: main_aamp.cpp:494
PlayerInstanceAAMP::RegisterEvents
void RegisterEvents(EventListener *eventListener)
Register event handler.
Definition: main_aamp.cpp:403
AampScheduler::RemoveAllTasks
void RemoveAllTasks()
To remove all scheduled tasks and prevent further tasks from scheduling.
Definition: AampScheduler.cpp:156
PlayerInstanceAAMP::AddCustomHTTPHeader
void AddCustomHTTPHeader(std::string headerName, std::vector< std::string > headerValue, bool isLicenseHeader=false)
Add/Remove a custom HTTP header and value.
Definition: main_aamp.cpp:1579
AampCCManager.h
Integration layer of ClosedCaption in AAMP.
PrivateInstanceAAMP::NotifyOnEnteringLive
void NotifyOnEnteringLive()
Notify when entering live point to listeners.
Definition: priv_aamp.cpp:2910
PlayerInstanceAAMP::SetVideoMute
void SetVideoMute(bool muted)
Enable/ Disable Video.
Definition: main_aamp.cpp:1303
eMEDIAFORMAT_HDMI
@ eMEDIAFORMAT_HDMI
Definition: AampDrmMediaFormat.h:39
MediaFormat
MediaFormat
Media format types.
Definition: AampDrmMediaFormat.h:32
AampConfig::ReadAampCfgTxtFile
bool ReadAampCfgTxtFile()
ReadAampCfgTxtFile - Function to parse and process configuration file in text format.
Definition: AampConfig.cpp:1574
PrivateInstanceAAMP::GetAudioTrackInfo
std::string GetAudioTrackInfo()
Get current audio track index.
Definition: priv_aamp.cpp:9991
LangCodePreference
LangCodePreference
Language Code Preference types.
Definition: main_aamp.h:165
PlayerInstanceAAMP::SetTuneEventConfig
void SetTuneEventConfig(int tuneEventType)
To set the vod-tune-event according to the player.
Definition: main_aamp.cpp:2498
PrivateInstanceAAMP::SetAppName
void SetAppName(std::string name)
Set the application name which has created PlayerInstanceAAMP, for logging purposes.
Definition: priv_aamp.cpp:9791
eAAMPConfig_AllowPageHeaders
@ eAAMPConfig_AllowPageHeaders
Definition: AampConfig.h:195
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38
eAAMPConfig_UseAbsoluteTimeline
@ eAAMPConfig_UseAbsoluteTimeline
Definition: AampConfig.h:176
eAAMPConfig_InitFragmentRetryCount
@ eAAMPConfig_InitFragmentRetryCount
Definition: AampConfig.h:238
eMEDIAFORMAT_UNKNOWN
@ eMEDIAFORMAT_UNKNOWN
Definition: AampDrmMediaFormat.h:43
PlayerInstanceAAMP::SetRetuneForGSTInternalError
void SetRetuneForGSTInternalError(bool bValue)
Set retune configuration for gstpipeline internal data stream error.
Definition: main_aamp.cpp:2097
PrivateInstanceAAMP::rate
float rate
Definition: priv_aamp.h:955
PrivateInstanceAAMP::mJumpToLiveFromPause
bool mJumpToLiveFromPause
Definition: priv_aamp.h:1060
eAAMPConfig_ContentProtectionDataUpdateTimeout
@ eAAMPConfig_ContentProtectionDataUpdateTimeout
Definition: AampConfig.h:263
eSTATE_SEEKING
@ eSTATE_SEEKING
Definition: AampEvent.h:165
PrivateInstanceAAMP::SetStateBufferingIfRequired
bool SetStateBufferingIfRequired()
Set eSTATE_BUFFERING if required.
Definition: priv_aamp.cpp:9889
PlayerInstanceAAMP::SetReportInterval
void SetReportInterval(int reportInterval)
To set the Playback Position reporting interval.
Definition: main_aamp.cpp:1702
eAAMPConfig_PRLicenseServerUrl
@ eAAMPConfig_PRLicenseServerUrl
Definition: AampConfig.h:299
PrivateInstanceAAMP::ResumeDownloads
void ResumeDownloads()
Resume downloads of all tracks. Used by aamp internally to manage states.
Definition: priv_aamp.cpp:3163
PlayerInstanceAAMP::SetNewABRConfig
void SetNewABRConfig(bool bValue)
Configure New ABR Enable/Disable.
Definition: main_aamp.cpp:2243
eAAMPConfig_RepairIframes
@ eAAMPConfig_RepairIframes
Definition: AampConfig.h:179
PlayerInstanceAAMP::SetPreferredLabels
void SetPreferredLabels(const char *lableList)
Set optional preferred label list.
Definition: main_aamp.cpp:2329
PrivateInstanceAAMP::detach
void detach()
Soft stop the player instance.
Definition: priv_aamp.cpp:6248
PlayerInstanceAAMP::SetInitialBitrate4K
void SetInitialBitrate4K(long bitrate4K)
To set the initial bitrate value for 4K assets.
Definition: main_aamp.cpp:1972
PrivateInstanceAAMP::AddEventListener
void AddEventListener(AAMPEventType eventType, EventListener *eventListener)
Add listener to aamp events.
Definition: priv_aamp.cpp:2244
PlayerInstanceAAMP::SetSslVerifyPeerConfig
void SetSslVerifyPeerConfig(bool bValue)
Configure URI parameters.
Definition: main_aamp.cpp:2273
eAAMPConfig_PreferredDRM
@ eAAMPConfig_PreferredDRM
Definition: AampConfig.h:223