RDK Documentation (Open Sourced RDK Components)
Aampcli.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 2022 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 Aampcli.cpp
22  * @brief Stand alone AAMP player with command line interface.
23  */
24 
25 #include "Aampcli.h"
26 
27 Aampcli mAampcli;
28 extern VirtualChannelMap mVirtualChannelMap;
29 extern void tsdemuxer_InduceRollover( bool enable );
30 
31 Aampcli :: Aampcli():
32  mInitialized(false),
33  mEnableProgressLog(false),
34  mbAutoPlay(true),
35  mTuneFailureDescription(""),
36  mSingleton(NULL),
37  mEventListener(NULL),
38  mAampGstPlayerMainLoop(NULL),
39  mAampMainLoopThread(NULL),
40  mPlayerInstances(std::vector<PlayerInstanceAAMP*> ())
41 {
42 };
43 
44 Aampcli::Aampcli(const Aampcli& aampcli):
45  mInitialized(false),
46  mEnableProgressLog(false),
47  mbAutoPlay(true),
48  mTuneFailureDescription(""),
49  mSingleton(NULL),
50  mEventListener(NULL),
51  mAampGstPlayerMainLoop(NULL),
52  mAampMainLoopThread(NULL),
53  mPlayerInstances(std::vector<PlayerInstanceAAMP*> ())
54 
55 {
56  mSingleton = aampcli.mSingleton;
57  mEventListener = aampcli.mEventListener;
58 };
59 
60 Aampcli& Aampcli::operator=(const Aampcli& aampcli)
61 {
62  return *this;
63 };
64 
65 Aampcli :: ~Aampcli()
66 {
67 
68  if(mSingleton != NULL)
69  {
70  SAFE_DELETE(mSingleton);
71  }
72 };
73 
74 void Aampcli::doAutomation( int startChannel, int stopChannel, int maxTuneTimeS, int playTimeS, int betweenTimeS )
75 {
76 #if defined (__APPLE__) || defined(UBUNTU)
77  std::string outPath(getenv("HOME"));
78 #else
79  std::string outPath("/opt");
80 #endif
81  outPath += "/test-results.csv";
82  const char *mod = "wb"; // initially clear file
83  CommandHandler lCommandHandler;
84 
85  if (mVirtualChannelMap.next() == NULL)
86  {
87  printf("[AAMPCLI] Can not auto channels, empty virtual channel map.\n");
88  return;
89  }
90 
91  for( int chan=startChannel; chan<=stopChannel; chan++ )
92  {
93  VirtualChannelInfo *info = mVirtualChannelMap.find(chan);
94  if( info )
95  {
96  if( strstr(info->name.c_str(),"ClearKey") ||
97  strstr(info->name.c_str(),"MultiDRM") ||
98  strstr(info->name.c_str(),"DTS Audio") ||
99  strstr(info->name.c_str(),"AC-4") )
100  {
101 #ifdef __APPLE__
102  continue; // skip unsupported DRM AND Audio formats
103 #endif
104  }
105  printf( "%d,\"%s\",%s,%s\n",
106  info->channelNumber, info->name.c_str(), info->uri.c_str(), "TUNING...");
107 
108  char cmd[32];
109  snprintf( cmd, sizeof(cmd), "%d", chan );
110  mTuneFailureDescription.clear();
111  lCommandHandler.dispatchAampcliCommands(cmd,mSingleton);
112  PrivAAMPState state = eSTATE_IDLE;
113  for(int i=0; i<maxTuneTimeS; i++ )
114  {
115  sleep(1);
116  state = mSingleton->GetState();
117  if( state == eSTATE_PLAYING || state == eSTATE_ERROR )
118  {
119  break;
120  }
121  }
122  const char *stateName;
123  switch( state )
124  {
125  case eSTATE_PLAYING:
126  sleep(playTimeS); // let play for a bit longer, as visibility sanity check
127  stateName = "OK";
128  printf( "***STOP***\n" );
129  mSingleton->Stop();
130  sleep( betweenTimeS );
131  printf( "***NEXT***\n" );
132  break;
133  case eSTATE_ERROR:
134  stateName = "FAIL";
135  break;
136  default:
137  stateName = "TIMEOUT";
138  break;
139  }
140  printf( "***%s\n", stateName );
141  FILE *f = fopen( outPath.c_str(), mod );
142  assert( f );
143  fprintf( f, "%d,\"%s\",%s,%s,%s\n",
144  info->channelNumber, info->name.c_str(), info->uri.c_str(), stateName, mTuneFailureDescription.c_str() );
145  mod = "a";
146  fclose( f );
147  }
148  }
149 }
150 
151 void Aampcli::runCommand( void* args )
152 {
153  char cmd[mMaxBufferLength] = {'\0'};
154  std::vector<std::string> *arguments;
155  std::vector<std::string> cmdVec;
156  CommandHandler lCommandHandler;
157 
158  lCommandHandler.registerAampcliCommands();
159  using_history();
160 
161  if( args )
162  {
163  arguments = static_cast<std::vector<std::string>*>(args);
164  cmdVec = *arguments;
165 
166  if(!cmdVec.empty())
167  {
168  for(auto param : cmdVec)
169  {
170  snprintf( cmd+strlen(cmd),mMaxBufferLength-strlen(cmd),"%s ", param.c_str());
171  }
172  lCommandHandler.dispatchAampcliCommands(cmd,mAampcli.mSingleton);
173  }
174 
175  }
176 
177  printf("[AAMPCLI] type 'help' for list of available commands\n");
178 
179  for(;;)
180  {
181  rl_attempted_completion_function = lCommandHandler.commandCompletion;
182  char *buffer = readline("[AAMPCLI] Enter cmd: ");
183 
184  if(buffer == NULL)
185  {
186  break;
187  }
188 
189  if(*buffer)
190  {
191  strcpy(cmd,buffer);
192  add_history(buffer);
193  free(buffer);
194 
195  if(strncmp(cmd,"history",7) == 0)
196  {
197  HISTORY_STATE *historyState = history_get_history_state ();
198 
199  for (int i = 0; i < historyState->length; i++)
200  {
201  printf ("%s\n", history_get(i+1)->line);
202  }
203  }
204 
205  if( memcmp(cmd,"autoplay",8)!=0 && // avoid false match
206  memcmp(cmd,"auto",4)==0 )
207  {
208  int start=500, end=1000;
209  int maxTuneTimeS = 6;
210  int playTimeS = 15;
211  int betweenTimeS = 15;
212  int matched = sscanf(cmd, "auto %d %d %d %d %d", &start, &end, &maxTuneTimeS, &playTimeS, &betweenTimeS );
213  mAampcli.doAutomation( start, end, maxTuneTimeS, playTimeS, betweenTimeS );
214  }
215  else
216  {
217  bool l_status = false;
218 
219  l_status = lCommandHandler.dispatchAampcliCommands(cmd,mAampcli.mSingleton);
220 
221  if(l_status == false)
222  {
223  _exit(0);
224  }
225  }
226  }
227  }
228 
229  return;
230 }
231 
232 FILE * Aampcli::getConfigFile(const std::string& cfgFile)
233 {
234  if (cfgFile.empty())
235  {
236  return NULL;
237  }
238 #ifdef __APPLE__
239  std::string cfgBasePath(getenv("HOME"));
240  std::string cfgPath = cfgBasePath + cfgFile;
241  FILE *f = fopen(cfgPath.c_str(), "rb");
242 #else
243  std::string cfgPath = "/opt" + cfgFile;
244  FILE *f = fopen(cfgPath.c_str(), "rb");
245 #endif
246 
247  return f;
248 }
249 
250 /**
251  * @brief Thread to run mainloop (for standalone mode)
252  * @param[in] arg user_data
253  * @retval void pointer
254  */
256 {
257  if (mAampcli.mAampGstPlayerMainLoop)
258  {
259  g_main_loop_run(mAampcli.mAampGstPlayerMainLoop); // blocks
260  printf("[AAMPCLI] aampGstPlayerStreamThread: exited main event loop\n");
261  }
262  g_main_loop_unref(mAampcli.mAampGstPlayerMainLoop);
263  mAampcli.mAampGstPlayerMainLoop = NULL;
264  return NULL;
265 }
266 
267 /**
268  * @brief To initialize Gstreamer and start mainloop (for standalone mode)
269  * @param[in] argc number of arguments
270  * @param[in] argv array of arguments
271  */
272 void Aampcli::initPlayerLoop(int argc, char **argv)
273 {
274  if (!mInitialized)
275  {
276  mInitialized = true;
277  gst_init(&argc, &argv);
278  mAampGstPlayerMainLoop = g_main_loop_new(NULL, FALSE);
279  mAampMainLoopThread = g_thread_new("AAMPGstPlayerLoop", &aampGstPlayerStreamThread, NULL );
280  }
281 }
282 
283 void Aampcli::newPlayerInstance( void )
284 {
286 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
287  NULL
288  ,Shader::updateYUVFrame
289 #endif
290  );
291  if( !mEventListener )
292  { // for now, use common event listener (could be instance specific)
293  printf( "allocating new MyAAMPEventListener\n");
294  mEventListener = new MyAAMPEventListener();
295  }
296  player->RegisterEvents(mEventListener);
297  int playerIndex = mPlayerInstances.size();
298  printf( "new playerInstance; index=%d\n", playerIndex );
299  mPlayerInstances.push_back(player);
300  mSingleton = player; // select
302 }
303 
304 
305 /**
306  * @brief
307  * @param argc
308  * @param argv
309  * @retval
310  */
311 int main(int argc, char **argv)
312 {
313  char driveName = (*argv)[0];
314  AampLogManager mLogManager;
315  AampLogManager::disableLogRedirection = true;
316  ABRManager mAbrManager;
317 
318  signal(SIGINT, Harvestor::harvestTerminateHandler);
319 
320  /* Set log directory path for AAMP and ABR Manager */
321  mLogManager.setLogAndCfgDirectory(driveName);
322  mAbrManager.setLogDirectory(driveName);
323 
324  printf("**************************************************************************\n");
325  printf("** ADVANCED ADAPTIVE MEDIA PLAYER (AAMP) - COMMAND LINE INTERFACE (CLI) **\n");
326  printf("**************************************************************************\n");
327 
328  mAampcli.initPlayerLoop(0,NULL);
329  mAampcli.newPlayerInstance();
330 
331  // Read/create virtual channel map
332  const std::string cfgCSV("/aampcli.csv");
333  const std::string cfgLegacy("/aampcli.cfg");
334  FILE *f;
335  if ( (f = mAampcli.getConfigFile(cfgCSV)) != NULL)
336  { // open virtual map from csv file
337  printf("[AAMPCLI] opened aampcli.csv\n");
338  mVirtualChannelMap.loadVirtualChannelMapFromCSV( f );
339  fclose( f );
340  f = NULL;
341  }
342  else if ( (f = mAampcli.getConfigFile(cfgLegacy)) != NULL)
343  { // open virtual map from legacy cfg file
344  printf("[AAMPCLI] opened aampcli.cfg\n");
345  mVirtualChannelMap.loadVirtualChannelMapLegacyFormat(f);
346  fclose(f);
347  f = NULL;
348  }
349 
350  std::vector<std::string> arguments;
351  for(int i = 1; i < argc; i++)
352  {
353  arguments.push_back(std::string(argv[i]));
354  }
355 
356  std::thread cmdThreadId;
357  try {
358  cmdThreadId = std::thread(&mAampcli.runCommand, (void *) &arguments);
359  }catch (std::exception& e)
360  {
361  printf("[AAMPCLI] Failed at create thread error %s\n",e.what()); //CID:83593 - checked return
362  }
363 
364 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
365  // Render frames in graphics plane using opengl
366  glutInit(&argc, argv);
367  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
368  glutInitWindowPosition(80, 80);
369  glutInitWindowSize(640, 480);
370  glutCreateWindow("AAMP Texture Player");
371  printf("[AAMPCLI] OpenGL Version[%s] GLSL Version[%s]\n", glGetString(GL_VERSION), glGetString(GL_SHADING_LANGUAGE_VERSION));
372 #ifndef __APPLE__
373  glewInit();
374 #endif
375  Shader l_Shader;
376  l_Shader.InitShaders();
377  glutDisplayFunc(l_Shader.glRender);
378  glutTimerFunc(40, l_Shader.timer, 0);
379 
380  glutMainLoop();
381 #else
382  // Render frames in video plane - default behavior
383 #ifdef __APPLE__
384  createAndRunCocoaWindow();
385 #endif
386 #endif
387  if(cmdThreadId.joinable())
388  {
389  cmdThreadId.join();
390  }
391 }
392 
393 const char *MyAAMPEventListener::stringifyPrivAAMPState(PrivAAMPState state)
394 {
395  static const char *stateName[] =
396  {
397  "IDLE",
398  "INITIALIZING",
399  "INITIALIZED",
400  "PREPARING",
401  "PREPARED",
402  "BUFFERING",
403  "PAUSED",
404  "SEEKING",
405  "PLAYING",
406  "STOPPING",
407  "STOPPED",
408  "COMPLETE",
409  "ERROR",
410  "RELEASED"
411  };
412  if( state>=eSTATE_IDLE && state<=eSTATE_RELEASED )
413  {
414  return stateName[state];
415  }
416  else
417  {
418  return "UNKNOWN";
419  }
420 }
421 
422 /**
423  * @brief Implementation of event callback
424  * @param e Event
425  */
426 void MyAAMPEventListener::Event(const AAMPEventPtr& e)
427 {
428  switch (e->getType())
429  {
431  {
432  StateChangedEventPtr ev = std::dynamic_pointer_cast<StateChangedEvent>(e);
433  printf("[AAMPCLI] AAMP_EVENT_STATE_CHANGED: %s (%d)\n", mAampcli.mEventListener->stringifyPrivAAMPState(ev->getState()), ev->getState());
434  break;
435  }
436  case AAMP_EVENT_SEEKED:
437  {
438  SeekedEventPtr ev = std::dynamic_pointer_cast<SeekedEvent>(e);
439  printf("[AAMPCLI] AAMP_EVENT_SEEKED: new positionMs %f\n", ev->getPosition());
440  break;
441  }
443  {
444  MediaMetadataEventPtr ev = std::dynamic_pointer_cast<MediaMetadataEvent>(e);
445  std::vector<std::string> languages = ev->getLanguages();
446  int langCount = ev->getLanguagesCount();
447  printf("[AAMPCLI] AAMP_EVENT_MEDIA_METADATA\n");
448  for (int i = 0; i < langCount; i++)
449  {
450  printf("[AAMPCLI] language: %s\n", languages[i].c_str());
451  }
452  printf("[AAMPCLI] AAMP_EVENT_MEDIA_METADATA\n\tDuration=%ld\n\twidth=%d\n\tHeight=%d\n\tHasDRM=%d\n\tProgreamStartTime=%f\n", ev->getDuration(), ev->getWidth(), ev->getHeight(), ev->hasDrm(), ev->getProgramStartTime());
453  int bitrateCount = ev->getBitratesCount();
454  std::vector<long> bitrates = ev->getBitrates();
455  printf("[AAMPCLI] Bitrates:\n");
456  for(int i = 0; i < bitrateCount; i++)
457  {
458  printf("\t[AAMPCLI] bitrate(%d)=%ld\n", i, bitrates.at(i));
459  }
460  break;
461  }
462  case AAMP_EVENT_TUNED:
463  {
464  printf("[AAMPCLI] AAMP_EVENT_TUNED\n");
465  break;
466  }
468  {
469  MediaErrorEventPtr ev = std::dynamic_pointer_cast<MediaErrorEvent>(e);
470  mAampcli.mTuneFailureDescription = ev->getDescription();
471  printf("[AAMPCLI] AAMP_EVENT_TUNE_FAILED reason=%s\n",mAampcli.mTuneFailureDescription.c_str());
472  break;
473  }
475  {
476  SpeedChangedEventPtr ev = std::dynamic_pointer_cast<SpeedChangedEvent>(e);
477  printf("[AAMPCLI] AAMP_EVENT_SPEED_CHANGED current rate=%f\n", ev->getRate());
478  break;
479  }
481  {
482  DrmMetaDataEventPtr ev = std::dynamic_pointer_cast<DrmMetaDataEvent>(e);
483  printf("[AAMPCLI] AAMP_DRM_FAILED Tune failure:%d\t\naccess status str:%s\t\naccess status val:%d\t\nResponce code:%ld\t\nIs SecClient error:%d\t\n",ev->getFailure(), ev->getAccessStatus().c_str(), ev->getAccessStatusValue(), ev->getResponseCode(), ev->getSecclientError());
484  break;
485  }
486  case AAMP_EVENT_EOS:
487  printf("[AAMPCLI] AAMP_EVENT_EOS\n");
488  mAampcli.mPlayerInstances[mLogObj->getPlayerId()]->aamp->PausePipeline(true, false);
489  break;
491  printf("[AAMPCLI] AAMP_EVENT_PLAYLIST_INDEXED\n");
492  break;
493  case AAMP_EVENT_PROGRESS:
494  {
495  ProgressEventPtr ev = std::dynamic_pointer_cast<ProgressEvent>(e);
496 #ifdef __APPLE__
497  char string[128];
498  snprintf( string, sizeof(string), "%f", ev->getPosition()/1000.0 );
499  setSimulatorWindowTitle(string);
500 #endif
501  if(mAampcli.mEnableProgressLog)
502  {
503  printf("[AAMPCLI] AAMP_EVENT_PROGRESS\n\tDuration=%lf\n\tposition=%lf\n\tstart=%lf\n\tend=%lf\n\tcurrRate=%f\n\tBufferedDuration=%lf\n\tPTS=%lld\n\ttimecode=%s\n",ev->getDuration(),ev->getPosition(),ev->getStart(),ev->getEnd(),ev->getSpeed(),ev->getBufferedDuration(),ev->getPTS(),ev->getSEITimeCode());
504  }
505  }
506  break;
508  {
509  CCHandleEventPtr ev = std::dynamic_pointer_cast<CCHandleEvent>(e);
510  printf("[AAMPCLI] AAMP_EVENT_CC_HANDLE_RECEIVED CCHandle=%lu\n",ev->getCCHandle());
511  break;
512  }
514  {
515  BitrateChangeEventPtr ev = std::dynamic_pointer_cast<BitrateChangeEvent>(e);
516  printf("[AAMPCLI] AAMP_EVENT_BITRATE_CHANGED\n\tbitrate=%ld\n\tdescription=\"%s\"\n\tresolution=%dx%d@%ffps\n\ttime=%d\n\tposition=%lf\n", ev->getBitrate(), ev->getDescription().c_str(), ev->getWidth(), ev->getHeight(), ev->getFrameRate(), ev->getTime(), ev->getPosition());
517  break;
518  }
520  printf("[AAMPCLI] AAMP_EVENT_AUDIO_TRACKS_CHANGED\n");
521  break;
523  printf("[AAMPCLI] AAMP_EVENT_TEXT_TRACKS_CHANGED\n");
524  break;
526  printf("[AAMPCLI] AAMP_EVENT_ID3_METADATA\n");
527  break;
528  case AAMP_EVENT_BLOCKED :
529  {
530  BlockedEventPtr ev = std::dynamic_pointer_cast<BlockedEvent>(e);
531  printf("[AAMPCLI] AAMP_EVENT_BLOCKED Reason:%s\n" ,ev->getReason().c_str());
532  break;
533  }
535  {
536  ContentGapEventPtr ev = std::dynamic_pointer_cast<ContentGapEvent>(e);
537  printf("[AAMPCLI] AAMP_EVENT_CONTENT_GAP\n\tStart:%lf\n\tDuration:%lf\n", ev->getTime(), ev->getDuration());
538  break;
539  }
541  {
542  WatermarkSessionUpdateEventPtr ev = std::dynamic_pointer_cast<WatermarkSessionUpdateEvent>(e);
543  printf("[AAMPCLI] AAMP_EVENT_WATERMARK_SESSION_UPDATE SessionHandle:%d Status:%d System:%s\n" ,ev->getSessionHandle(), ev->getStatus(), ev->getSystem().c_str());
544  break;
545  }
547  {
548  BufferingChangedEventPtr ev = std::dynamic_pointer_cast<BufferingChangedEvent>(e);
549  printf("[AAMPCLI] AAMP_EVENT_BUFFERING_CHANGED Sending Buffer Change event status (Buffering): %s", (ev->buffering() ? "End": "Start"));
550  break;
551  }
553  {
554  ContentProtectionDataEventPtr ev = std::dynamic_pointer_cast<ContentProtectionDataEvent>(e);
555  printf("[AMPCLI] AAMP_EVENT_CONTENT_PROTECTION_UPDATE received stream type %s\n",ev->getStreamType().c_str());
556  std::vector<uint8_t> key = ev->getKeyID();
557  printf("[AMPCLI] AAMP_EVENT_CONTENT_PROTECTION_UPDATE received key is ");
558  for(int i=0;i<key.size();i++)
559  printf("%x",key.at(i)&0xff);
560  printf("\n");
561  cJSON *root = cJSON_CreateObject();
562  cJSON *KeyId = cJSON_CreateArray();
563  for(int i=0;i<key.size();i++)
564  cJSON_AddItemToArray(KeyId, cJSON_CreateNumber(key.at(i)));
565  cJSON_AddItemToObject(root,"keyID",KeyId);
566  // cJSON_AddItemToObject(root, "com.widevine.alpha", cJSON_CreateString("mds.ccp.xcal.tv"));
567  // cJSON_AddItemToObject(root, "com.microsoft.playready", cJSON_CreateString("mds-stage.ccp.xcal.tv"));
568  std::string json = cJSON_Print(root);
569  mAampcli.mSingleton->ProcessContentProtectionDataConfig(json.c_str());
570  break;
571  }
572  default:
573  break;
574  }
575 }
main
int main(int argc, char **argv)
Definition: Aampcli.cpp:311
AAMP_EVENT_DRM_METADATA
@ AAMP_EVENT_DRM_METADATA
Definition: AampEvent.h:71
VirtualChannelInfo
Holds information of a virtual channel.
Definition: AampcliVirtualChannelMap.h:39
AAMP_EVENT_CONTENT_GAP
@ AAMP_EVENT_CONTENT_GAP
Definition: AampEvent.h:85
AampLogManager::setLogAndCfgDirectory
void setLogAndCfgDirectory(char driveName)
Set log file and cfg directory index.
Definition: aamplogging.cpp:67
VirtualChannelMap::loadVirtualChannelMapLegacyFormat
void loadVirtualChannelMapLegacyFormat(FILE *f)
Parse config entries for aamp-cli, and update mVirtualChannelMap based on the config.
Definition: AampcliVirtualChannelMap.cpp:307
AAMP_EVENT_BUFFERING_CHANGED
@ AAMP_EVENT_BUFFERING_CHANGED
Definition: AampEvent.h:64
AAMP_EVENT_TUNE_FAILED
@ AAMP_EVENT_TUNE_FAILED
Definition: AampEvent.h:48
PlayerInstanceAAMP::SetContentProtectionDataUpdateTimeout
void SetContentProtectionDataUpdateTimeout(int timeout)
To set default timeout for Dynamic ContentProtectionDataUpdate on Key Rotation.
Definition: main_aamp.cpp:3163
Aampcli
Definition: Aampcli.h:61
Aampcli.h
AAMPcli header file.
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AAMP_EVENT_WATERMARK_SESSION_UPDATE
@ AAMP_EVENT_WATERMARK_SESSION_UPDATE
Definition: AampEvent.h:87
eSTATE_ERROR
@ eSTATE_ERROR
Definition: AampEvent.h:170
AAMP_EVENT_PLAYLIST_INDEXED
@ AAMP_EVENT_PLAYLIST_INDEXED
Definition: AampEvent.h:51
AAMP_EVENT_STATE_CHANGED
@ AAMP_EVENT_STATE_CHANGED
Definition: AampEvent.h:60
Aampcli::initPlayerLoop
void initPlayerLoop(int argc, char **argv)
To initialize Gstreamer and start mainloop (for standalone mode)
Definition: Aampcli.cpp:272
MyAAMPEventListener
Definition: Aampcli.h:54
AAMP_EVENT_BLOCKED
@ AAMP_EVENT_BLOCKED
Definition: AampEvent.h:84
PlayerInstanceAAMP
Player interface class for the JS pluggin.
Definition: main_aamp.h:692
AAMP_EVENT_SPEED_CHANGED
@ AAMP_EVENT_SPEED_CHANGED
Definition: AampEvent.h:49
AAMP_EVENT_AUDIO_TRACKS_CHANGED
@ AAMP_EVENT_AUDIO_TRACKS_CHANGED
Definition: AampEvent.h:66
AAMP_EVENT_CONTENT_PROTECTION_DATA_UPDATE
@ AAMP_EVENT_CONTENT_PROTECTION_DATA_UPDATE
Definition: AampEvent.h:88
AAMP_EVENT_TEXT_TRACKS_CHANGED
@ AAMP_EVENT_TEXT_TRACKS_CHANGED
Definition: AampEvent.h:67
VirtualChannelMap
Holds all of the virtual channels.
Definition: AampcliVirtualChannelMap.h:54
PlayerInstanceAAMP::ProcessContentProtectionDataConfig
void ProcessContentProtectionDataConfig(const char *jsonbuffer)
Definition: main_aamp.cpp:3026
eSTATE_RELEASED
@ eSTATE_RELEASED
Definition: AampEvent.h:171
AAMP_EVENT_EOS
@ AAMP_EVENT_EOS
Definition: AampEvent.h:50
AAMP_EVENT_ID3_METADATA
@ AAMP_EVENT_ID3_METADATA
Definition: AampEvent.h:82
PlayerInstanceAAMP::GetState
PrivAAMPState GetState(void)
To get the current AAMP state.
Definition: main_aamp.cpp:1765
AAMP_EVENT_TUNED
@ AAMP_EVENT_TUNED
Definition: AampEvent.h:47
PrivAAMPState
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
Definition: AampEvent.h:156
AampLogManager::getPlayerId
int getPlayerId()
Get PlayerId.
Definition: AampLogManager.h:249
AAMP_EVENT_CC_HANDLE_RECEIVED
@ AAMP_EVENT_CC_HANDLE_RECEIVED
Definition: AampEvent.h:53
AAMP_EVENT_MEDIA_METADATA
@ AAMP_EVENT_MEDIA_METADATA
Definition: AampEvent.h:55
MyAAMPEventListener::Event
void Event(const AAMPEventPtr &e)
Implementation of event callback.
Definition: Aampcli.cpp:426
CommandHandler
Definition: AampcliCommandHandler.h:43
eSTATE_IDLE
@ eSTATE_IDLE
Definition: AampEvent.h:158
PlayerInstanceAAMP::Stop
void Stop(bool sendStateChangeEvent=true)
Stop playback and release resources.
Definition: main_aamp.cpp:282
Aampcli::aampGstPlayerStreamThread
static void * aampGstPlayerStreamThread(void *arg)
Thread to run mainloop (for standalone mode)
Definition: Aampcli.cpp:255
AAMP_EVENT_SEEKED
@ AAMP_EVENT_SEEKED
Definition: AampEvent.h:62
AAMP_EVENT_PROGRESS
@ AAMP_EVENT_PROGRESS
Definition: AampEvent.h:52
PlayerInstanceAAMP::RegisterEvents
void RegisterEvents(EventListener *eventListener)
Register event handler.
Definition: main_aamp.cpp:403
eSTATE_PLAYING
@ eSTATE_PLAYING
Definition: AampEvent.h:166
AAMP_EVENT_BITRATE_CHANGED
@ AAMP_EVENT_BITRATE_CHANGED
Definition: AampEvent.h:57