|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
28 std::map<string,getCommandInfo> Get::getCommands = std::map<string,getCommandInfo>();
29 std::vector<std::string> Get::commands(0);
34 int opt, value1, value2;
39 if (sscanf(cmd,
"get %s", command) == 1)
41 if(isdigit(command[0]))
43 getCmd = atoi(command);
47 std::map<string,getCommandInfo>::iterator getCmdItr;
48 getCmdItr = getCommands.find(command);
50 if(getCmdItr != getCommands.end())
52 getCmd = getCmdItr->second.value;
56 if(0 == strncmp(
"help", command, 4))
68 printf(
"[AAMPCLI] GETTING CURRENT STATE: %d\n", (
int) playerInstanceAamp->
GetState());
72 sscanf(cmd,
"get %d %d %d",&opt, &value1, &value2);
73 printf(
"[AAMPCLI] GETTING THUMBNAIL TIME RANGE DATA for duration(%d,%d): %s\n",value1,value2,playerInstanceAamp->
GetThumbnails(value1, value2).c_str());
77 printf(
"[AAMPCLI] CURRENT AUDIO TRACK NUMBER: %d\n", playerInstanceAamp->
GetAudioTrack() );
85 printf(
"[AAMPCLI] CURRENT AUDIO TRACK INFO: %s\n", playerInstanceAamp->
GetAudioTrackInfo().c_str() );
89 printf(
"[AAMPCLI] CURRENT TEXT TRACK INFO: %s\n", playerInstanceAamp->
GetTextTrackInfo().c_str() );
101 printf(
"[AAMPCLI] CC VISIBILITY STATUS: %s\n",playerInstanceAamp->
GetCCStatus()?
"ENABLED":
"DISABLED");
105 printf(
"[AAMPCLI] CURRENT TEXT TRACK: %d\n", playerInstanceAamp->
GetTextTrack() );
124 printf(
"[AAMPCLI] AVAILABLE TEXT TRACKS: %s\n", playerInstanceAamp->
GetAvailableTextTracks(
false).c_str() );
128 printf(
"[AAMPCLI] CURRRENT AUDIO LANGUAGE = %s\n",
133 printf(
"[AAMPCLI] CURRRENT DRM = %s\n",
138 printf(
"[AAMPCLI] PLAYBACK POSITION = %lf\n",
143 printf(
"[AAMPCLI] PLAYBACK DURATION = %lf\n",
148 printf(
"[AAMPCLI] CURRENT VIDEO PROFILE BITRATE = %ld\n",
153 printf(
"[AAMPCLI] INITIAL BITRATE = %ld \n",
158 printf(
"[AAMPCLI] INITIAL BITRATE 4K = %ld \n",
163 printf(
"[AAMPCLI] MINIMUM BITRATE = %ld \n",
168 printf(
"[AAMPCLI] MAXIMUM BITRATE = %ld \n",
173 printf(
"[AAMPCLI] AUDIO BITRATE = %ld\n",
178 printf(
"[AAMPCLI] Video Zoom mode: %s\n",
179 (playerInstanceAamp->
GetVideoZoom())?
"None(Normal)":
"Full(Enabled)");
183 printf(
"[AAMPCLI] Video Mute status:%s\n",
188 printf(
"[AAMPCLI] AUDIO VOLUME = %d\n",
193 printf(
"[AAMPCLI] PLAYBACK RATE = %d\n",
199 std::vector<long int> videoBitrates;
200 printf(
"[AAMPCLI] VIDEO BITRATES = [ ");
202 for(
int i=0; i < videoBitrates.size(); i++){
203 printf(
"%ld, ", videoBitrates[i]);
211 std::vector<long int> audioBitrates;
212 printf(
"[AAMPCLI] AUDIO BITRATES = [ ");
214 for(
int i=0; i < audioBitrates.size(); i++){
215 printf(
"%ld, ", audioBitrates[i]);
223 printf(
"[AAMPCLI] PREFERRED LANGUAGES = \"%s\"\n", prefferedLanguages? prefferedLanguages :
"<NULL>");
229 printf(
"[AAMPCLI] RAMP DOWN LIMIT= %d\n", playerInstanceAamp->
GetRampDownLimit());
234 printf(
"[AAMPCLI] Invalid get command %s\n", cmd);
242 printf(
"[AAMPCLI] Invalid get command = %s\n", cmd);
253 addCommand(1,
"currentState",
"Get current player state");
254 addCommand(2,
"currentAudioLan",
"Get Current audio language");
255 addCommand(3,
"currentDrm",
"Get Current DRM");
256 addCommand(4,
"playbackPosition",
"Get Current Playback position");
257 addCommand(5,
"playbackDuration",
"Get Playback Duration");
258 addCommand(6,
"videoBitrate",
"Get current video bitrate");
259 addCommand(7,
"initialBitrate",
"Get Initial Bitrate");
260 addCommand(8,
"initialBitrate4k",
"Get Initial Bitrate 4K");
261 addCommand(9,
"minimumBitrate",
"Get Minimum Bitrate");
262 addCommand(10,
"maximumBitrate",
"Get Maximum Bitrate");
263 addCommand(11,
"audioBitrate",
"Get current Audio bitrate");
264 addCommand(12,
"videoZoom",
"Get Video Zoom mode");
265 addCommand(13,
"videoMute",
"Get Video Mute status");
266 addCommand(14,
"audioVolume",
"Get current Audio volume");
267 addCommand(15,
"playbackRate",
"Get Current Playback rate");
268 addCommand(16,
"videoBitrates",
"Get Video bitrates supported");
269 addCommand(17,
"audioBitrates",
"Get Audio bitrates supported");
270 addCommand(18,
"currentPreferredLanguages",
"Get Current preferred languages");
271 addCommand(19,
"rampDownLimit",
"Get number of Ramp down limit during playback");
272 addCommand(20,
"availableAudioTracks",
"Get Available Audio Tracks");
273 addCommand(21,
"allAvailableAudioTracks",
"Get All Available Audio Tracks information from manifest");
274 addCommand(22,
"availableTextTracks",
"Get Available Text Tracks");
275 addCommand(23,
"allAvailableTextTracks",
"Get All Available Text Tracks information from manifest");
276 addCommand(24,
"audioTrack",
"Get Audio Track");
277 addCommand(25,
"initialBufferDuration",
"Get Initial Buffer Duration( in sec)");
278 addCommand(26,
"audioTrackInfo",
"Get current Audio Track information in json format");
279 addCommand(27,
"textTrackInfo",
"Get current Text Track information in json format");
280 addCommand(28,
"preferredAudioProperties",
"Get current Preferred Audio properties in json format");
281 addCommand(29,
"preferredTextProperties",
"Get current Preferred Text properties in json format");
282 addCommand(30,
"ccStatus",
"Get CC Status");
283 addCommand(31,
"textTrack",
"Get Text Track");
284 addCommand(32,
"thumbnailConfig",
"Get Available ThumbnailTracks");
285 addCommand(33,
"thumbnailData",
"Get Thumbnail timerange data(int startpos, int endpos)");
286 addCommand(34,
"availableVideoTracks",
"Get All Available Video Tracks information from manifest");
287 commands.push_back(
"help");
290 void Get::addCommand(
int value,
string command,
string description)
293 lCmdInfo.value = value;
294 lCmdInfo.description = description;
296 getCommands.insert(std::make_pair(command,lCmdInfo));
297 commands.push_back(command);
306 std::map<string,getCommandInfo>::iterator getCmdItr;
308 printf(
"******************************************************************************************\n");
309 printf(
"* get <command> [<arguments>]\n");
310 printf(
"* Usage of Commands, and arguments expected\n");
311 printf(
"******************************************************************************************\n");
313 if(!commands.empty())
315 for(
auto itr:commands)
317 getCmdItr = getCommands.find(itr);
318 if(getCmdItr != getCommands.end())
320 std::cout <<
"get " << std::right << std::setw(2) << (getCmdItr->second).value <<
" / " << std::setw(35) << std::left << (getCmdItr->first).c_str() <<
"// "<< (getCmdItr->second.description).c_str() <<
"\n";
325 printf(
"****************************************************************************\n");
328 char * Get::getCommandRecommender(
const char *text,
int state)
332 static std::vector<std::string>::iterator itr;
336 itr = commands.begin();
340 while (itr != commands.end())
342 name = (
char *) itr->c_str();
344 if (strncmp(name, text, len) == 0)
long GetInitialBitrate(void)
To get the initial bitrate value.
int GetInitialBufferDuration(void)
Get initial buffer duration in seconds.
void registerGetCommands()
Show help menu with aamp command line interface.
long GetMinimumBitrate(void)
Get minimum bitrate value.
long GetVideoBitrate(void)
To get the bitrate of current video profile.
double GetPlaybackPosition(void)
To get the current playback position.
std::string GetTextTrackInfo()
Get current audio track index.
int GetPlaybackRate(void)
To get the current playback rate.
int GetAudioTrack()
Get current audio track index.
const char * GetPreferredLanguages()
Get current preferred language list.
int GetVideoZoom(void)
To get video zoom mode.
std::string GetAvailableVideoTracks()
Get available video tracks.
std::string GetAvailableAudioTracks(bool allTrack=false)
Get available audio tracks.
std::vector< long > GetVideoBitrates(void)
To get the available video bitrates.
const char * GetCurrentDRM()
Get current drm.
long GetMaximumBitrate(void)
Get maximum bitrate value.
std::string GetPreferredTextProperties()
Get preferred text prioperties.
Player interface class for the JS pluggin.
std::string GetAudioTrackInfo()
Get current audio track index.
bool GetCCStatus(void)
Get CC visibility on/off.
long GetInitialBitrate4k(void)
To get the initial bitrate value for 4K assets.
std::string GetPreferredAudioProperties()
Get preferred audio prioperties.
PrivAAMPState GetState(void)
To get the current AAMP state.
const char * GetCurrentAudioLanguage()
Get current audio language.
void ShowHelpGet()
Display Help menu for get.
std::string GetThumbnails(double sduration, double eduration)
To get preferred thumbnails for the duration.
double GetPlaybackDuration(void)
To get the current asset's duration.
int GetTextTrack()
Get current text track index.
long GetAudioBitrate(void)
To get the bitrate of current audio profile.
std::string GetAvailableTextTracks(bool allTrack=false)
Get available text tracks.
bool GetVideoMute(void)
To get video mute status.
std::vector< long > GetAudioBitrates(void)
To get the available audio bitrates.
int GetRampDownLimit(void)
Get profile ramp down limit.
std::string GetAvailableThumbnailTracks(void)
To get the available bitrates for thumbnails.
int GetAudioVolume(void)
To get the current audio volume.