RDK Documentation (Open Sourced RDK Components)
Aampcli.h
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.h
22  * @brief AAMPcli header file
23  */
24 
25 #ifndef AAMPCLI_H
26 #define AAMPCLI_H
27 
28 #include <stdlib.h>
29 #include <stddef.h>
30 #include <errno.h>
31 #include <list>
32 #include <sstream>
33 #include <string>
34 #include <ctype.h>
35 #include <gst/gst.h>
36 #include <readline/readline.h>
37 #include <readline/history.h>
38 #include <priv_aamp.h>
39 #include <main_aamp.h>
40 #include "AampConfig.h"
41 #include "AampDefine.h"
42 #include "StreamAbstractionAAMP.h"
43 #include "AampcliCommandHandler.h"
44 #include "AampcliVirtualChannelMap.h"
45 #include "AampcliGet.h"
46 #include "AampcliSet.h"
47 #include "AampcliShader.h"
48 #include "AampcliHarvestor.h"
49 
50 #ifdef __APPLE__
51 #import <cocoa_window.h>
52 #endif
53 
55 {
56  public:
57  const char *stringifyPrivAAMPState(PrivAAMPState state);
58  void Event(const AAMPEventPtr& e);
59 };
60 
61 class Aampcli
62 {
63  public:
64  bool mInitialized;
65  bool mEnableProgressLog;
66  bool mbAutoPlay;
67  static const int mMaxBufferLength = 4096;
68  std::string mTuneFailureDescription;
69  PlayerInstanceAAMP *mSingleton;
70  MyAAMPEventListener *mEventListener;
71  GMainLoop *mAampGstPlayerMainLoop;
72  GThread *mAampMainLoopThread;
73  std::vector<PlayerInstanceAAMP*> mPlayerInstances;
74 
75  static void runCommand( void* args );
76  static void * aampGstPlayerStreamThread(void *arg);
77  void doAutomation( int startChannel, int stopChannel, int maxTuneTimeS, int playTimeS, int betweenTimeS );
78  FILE * getConfigFile(const std::string& cfgFile);
79  void initPlayerLoop(int argc, char **argv);
80  void newPlayerInstance( void );
81  Aampcli();
82  Aampcli(const Aampcli& aampcli);
83  Aampcli& operator=(const Aampcli& aampcli);
84  ~Aampcli();
85 };
86 
87 #endif // AAMPCLI_H
AampDefine.h
Macros for Aamp.
AampcliGet.h
AampcliGet header file.
cocoa_window.h
StreamAbstractionAAMP.h
Base classes of HLS/MPD collectors. Implements common caching/injection logic.
main_aamp.h
Types and APIs exposed by the AAMP player.
Aampcli
Definition: Aampcli.h:61
AAMPEventObjectListener
Class for AAMP event listening Uses shared_ptr for event objects for better memory management New AAM...
Definition: AampEventListener.h:87
AampcliSet.h
AampcliSet header file.
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
PlayerInstanceAAMP
Player interface class for the JS pluggin.
Definition: main_aamp.h:692
AampConfig.h
Configurations for AAMP.
priv_aamp.h
Private functions and types used internally by AAMP.
AampcliCommandHandler.h
AampcliCommandHandler header file.
PrivAAMPState
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
Definition: AampEvent.h:156
MyAAMPEventListener::Event
void Event(const AAMPEventPtr &e)
Implementation of event callback.
Definition: Aampcli.cpp:426
AampcliShader.h
AampcliShader header file.
Aampcli::aampGstPlayerStreamThread
static void * aampGstPlayerStreamThread(void *arg)
Thread to run mainloop (for standalone mode)
Definition: Aampcli.cpp:255
AampcliHarvestor.h
AampcliHarvestor header file.