RDK Documentation (Open Sourced RDK Components)
rdkmediaplayer.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt 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  * @defgroup MEDIA_PLAYER rdkmediaplayer
22  *
23  * - The rdkmediaplayer supports both ip video (hls/dash) and qam.
24  * - It's a wayland plugin using the rtRemote API.
25  * - Internally uses the AAMP player for IP and RMF player for QAM.
26  *
27  * @defgroup MEDIA_PLAYER_API Mediaplayer Data Types and API(s)
28  * This file provides the data types and API(s) used by the mediaplayer.
29  * @ingroup MEDIA_PLAYER
30  *
31  */
32 
33 /**
34  * @addtogroup MEDIA_PLAYER_API
35  * @{
36  */
37 
38 #ifndef RDKMEDIAPLAYER_H
39 #define RDKMEDIAPLAYER_H
40 
41 #include <rtRemote.h>
42 #include <rtError.h>
43 #include <string>
44 #include <map>
45 #include "rtevents.h"
46 #include "intrect.h"
47 #include "rdkmediaplayerimpl.h"
48 #ifndef DISABLE_CLOSEDCAPTIONS
49 #include "closedcaptions.h"
50 #endif
51 
52 class RDKMediaPlayer : public rtObject {
53 
54 public:
55  rtDeclareObject(RDKMediaPlayer, rtObject);
56  rtProperty(url, currentURL, setCurrentURL, rtString);
57  rtProperty(audioLanguage, audioLanguage, setAudioLanguage, rtString);
59  rtProperty(position, position, setPosition, float);
60  rtProperty(speed, speed, setSpeed, float);
61  rtProperty(volume, volume, setVolume, float);
62  rtProperty(blocked, blocked, setBlocked, rtString);
63  rtProperty(zoom, zoom, setZoom, rtString);
64  rtProperty(autoPlay, autoPlay, setAutoPlay, rtString);
68  rtProperty(contentOptions, contentOptions, setContentOptions, rtObjectRef);
69  rtProperty(tsbEnabled, tsbEnabled, setTsbEnabled, rtString);
70  rtReadOnlyProperty(duration, duration, float);
71  rtReadOnlyProperty(availableAudioLanguages, availableAudioLanguages, rtString);
73  rtReadOnlyProperty(availableSpeeds, availableSpeeds, rtString);
78  rtProperty(loadStartTime, loadStartTime, setLoadStartTime, int64_t);
79  rtMethod4ArgAndNoReturn("setVideoRectangle", setVideoRectangle, int32_t, int32_t, int32_t, int32_t);
80  rtMethodNoArgAndNoReturn("play", play);
81  rtMethodNoArgAndNoReturn("pause", pause);
82  rtMethodNoArgAndNoReturn("seekToLive", seekToLive);
83  rtMethodNoArgAndNoReturn("stop", stop);
84  rtMethod2ArgAndNoReturn("setSpeed", changeSpeed, float, int32_t);
85  rtMethod1ArgAndNoReturn("setPositionRelative", setPositionRelative, float);
86  rtMethod1ArgAndNoReturn("setAdditionalAuth", setAdditionalAuth, rtObjectRef);
87  rtMethodNoArgAndNoReturn("requestStatus", requestStatus);
88  rtMethod2ArgAndNoReturn("on", setListener, rtString, rtFunctionRef);
89  rtMethod2ArgAndNoReturn("delListener", delListener, rtString, rtFunctionRef);
90  rtMethodNoArgAndNoReturn("destroy", destroy);
91  rtMethod1ArgAndReturn("open", open, rtString, rtString);
92  rtMethod1ArgAndReturn("sendCASData", sendCASData, rtString, rtString);
93 
95  virtual ~RDKMediaPlayer();
96 
97  virtual void onInit();
98 
99  //rtRemote properties
100 
101  /**
102  * @brief This API returns current playback URL.
103  *
104  * @param[out] s current video URL
105  *
106  * @return Returns status of the operation.
107  * @retval RT_OK on success, appropriate error code otherwise.
108  */
109  rtError currentURL(rtString& s) const;
110 
111  /**
112  * @brief This API performs following functionalities.
113  *
114  * - Checks the URL is empty, if not load the URL
115  * - Updates closedcaption state.
116  * - Decides which player to choose AAMP,RMF player or there is need to use cache player.
117  * - Initiates the playback
118  *
119  * @param[in] s current video URL
120  *
121  * @return Returns status of the operation.
122  * @retval RT_OK on success, appropriate error code otherwise.
123  */
124  rtError setCurrentURL(rtString const& s);
125 
126  /**
127  * @brief This API returns the audio language selected.
128  *
129  * @param[out] s Audio Language selected.
130  *
131  * @return Returns status of the operation.
132  * @retval RT_OK on success, appropriate error code otherwise.
133  */
134  rtError audioLanguage(rtString& s) const;
135 
136  /**
137  * @brief This API is to set the audio language to the player.
138  *
139  * @param[in] s Language to set.
140  *
141  * @return Returns status of the operation.
142  * @retval RT_OK on success, appropriate error code otherwise.
143  */
144  rtError setAudioLanguage(rtString const& s);
145 
146  /**
147  * @brief Function returns the secondary audio language.
148  *
149  * @param[out] s Secondary language selected.
150  *
151  * @return Returns status of the operation.
152  * @retval RT_OK on success, appropriate error code otherwise.
153  */
154  rtError secondaryAudioLanguage(rtString& s) const;
155 
156  /**
157  * @brief This API is to set the secondary audio language.
158  *
159  * @param[in] s Secondary language to set.
160  *
161  * @return Returns status of the operation.
162  * @retval RT_OK on success, appropriate error code otherwise.
163  */
164  rtError setSecondaryAudioLanguage(rtString const& s);
165 
166  /**
167  * @brief This API returns the current position details from the progress data.
168  *
169  * @param[out] t current position
170  *
171  * @return Returns the status of the operation.
172  * @retval RT_OK on success, appropriate error code otherwise.
173  */
174  rtError position(float& t) const;
175 
176  /**
177  * @brief Moves the playhead to the absolute mediatime specified.
178  *
179  * If the value passed is outside of the current valid range, value will be clamped to the valid range.
180  *
181  * @param[in] t position to set.
182  *
183  * @return Returns the status of the operation.
184  * @retval RT_OK on success, appropriate error code otherwise.
185  */
186  rtError setPosition(float const& t);
187 
188  /**
189  * @brief This API is to return current playback rate.
190  *
191  * @param[out] t current playback rate.
192  *
193  * @return Returns the status of the operation.
194  * @retval RT_OK on success, appropriate error code otherwise.
195  */
196  rtError speed(float& t) const;
197 
198  /**
199  * @brief This API is to set the playback rate.
200  *
201  * @param[in] t playback rate.
202  *
203  * @return Returns the status of the operation.
204  * @retval RT_OK on success, appropriate error code otherwise.
205  */
206  rtError setSpeed(float const& t);
207 
208  /**
209  * @brief This API returns the current volume.
210  *
211  * @param[out] t current volume
212  *
213  * @return Returns the status of the operation.
214  * @retval RT_OK on success, appropriate error code otherwise.
215  */
216  rtError volume(float& t) const;
217 
218  /**
219  * @brief This method sets the volume level for the player instance and is persisted across different URLs.
220  *
221  * Value from 0 to 100.
222  *
223  * @param[in] t volume to set.
224  *
225  * @return Returns the status of the operation.
226  * @retval RT_OK on success, appropriate error code otherwise.
227  */
228  rtError setVolume(float const& t);
229 
230  /**
231  * @brief This API is to check video is blocked or not.
232  *
233  * @param[out] t True/False indicates video is blocked or not.
234  *
235  * @return Returns the status of the operation.
236  * @retval RT_OK on success, appropriate error code otherwise.
237  */
238  rtError blocked(rtString& t) const;
239 
240  /**
241  * @brief This method will block the video and mute the audio if flag is true.
242  *
243  * Otherwise it will unblock the video and restore the audio to the current volume setting.
244  * Any TSB buffering will be unaffected
245  *
246  * @param[in] t Value to enable/disable the blocking.
247  *
248  * @return Returns the status of the operation.
249  * @retval RT_OK on success, appropriate error code otherwise.
250  */
251  rtError setBlocked(rtString const& t);
252 
253  /**
254  * @brief This API indicates autoplay is enabled or not.
255  *
256  * @param[out] t Value indicates autoplay status.
257  *
258  * @return Returns the status of the operation.
259  * @retval RT_OK on success, appropriate error code otherwise.
260  */
261  rtError autoPlay(rtString& t) const;
262 
263  /**
264  * @brief This API sets the auto play flag of the player.
265  *
266  * If set to true the player will start playback as soon as possible.
267  * If the value is false user has to start playback.
268  *
269  * @param[in] t Value to enable/disable autoplay.
270  *
271  * @return Returns the status of the operation.
272  * @retval RT_OK on success, appropriate error code otherwise.
273  */
274  rtError setAutoPlay(rtString const& t);
275 
276  /**
277  * @brief This API is intended to check recording status.
278  *
279  * @param[out] t Recording status
280  *
281  * @return Returns the status of the operation.
282  * @retval RT_OK on success, appropriate error code otherwise.
283  */
284  rtError isInProgressRecording(rtString& t) const;
285 
286  /**
287  * @brief This API is intended to set the recording state.
288  *
289  * @param[in] t Recording state to set.
290  *
291  * @return Returns the status of the operation.
292  * @retval RT_OK on success, appropriate error code otherwise.
293  */
294  rtError setIsInProgressRecording(rtString const& t);
295 
296  /**
297  * @brief This API returns either FULL" or "NONE".
298  *
299  * When FULL, content is stretched to width and height of player.
300  * When NONE, content is best fit to width or height of player without distorting the video's aspect ratio.
301  *
302  * @param[out] t Indicates the value FULL or NONE
303  *
304  * @return Returns the status of the operation.
305  * @retval RT_OK on success, appropriate error code otherwise.
306  */
307  rtError zoom(rtString& t) const;
308 
309  /**
310  * @brief This API sets the value 0 or 1 depending on the argument "FULL" or "NONE".
311  *
312  * @param[in] t Value to set
313  *
314  * @return Returns the status of the operation.
315  * @retval RT_OK on success, appropriate error code otherwise.
316  */
317  rtError setZoom(rtString const& t);
318 
319  /**
320  * @brief This API returns the size of the buffer in milliseconds.
321  *
322  * The networkBuffer determines the number of milliseconds of the live stream
323  * that will be cached in the buffer before being consumed by the player.
324  *
325  * @param[out] t Buffer size
326  *
327  * @return Returns the status of the operation.
328  * @retval RT_OK on success, appropriate error code otherwise.
329  */
330  rtError networkBufferSize(int32_t& t) const;
331 
332  /**
333  * @brief The API sets the network buffer size.
334  *
335  * @param[in] t Buffer size in milliseconds.
336  *
337  * @return Returns the status of the operation.
338  * @retval RT_OK on success, appropriate error code otherwise.
339  */
340  rtError setNetworkBufferSize(int32_t const& t);
341 
342  /**
343  * @brief This API returns the size of the video buffer.
344  *
345  * @param[out] t size of the video buffer
346  *
347  * @return Returns the status of the operation.
348  * @retval RT_OK on success, appropriate error code otherwise.
349  */
350  rtError videoBufferLength(float& t) const;
351 
352  /**
353  * @brief This API is to set the range of buffered video.
354  *
355  * @param[in] t Length to set.
356  *
357  * @return Returns the status of the operation.
358  * @retval RT_OK on success, appropriate error code otherwise.
359  */
360  rtError setVideoBufferLength(float const& t);
361 
362  /**
363  * @brief This API checks EISS(ETV Integrated Signaling System) filter is enabled or not.
364  *
365  * @param[out] t Indicates the EISS status.
366  *
367  * @return Returns the status of the operation.
368  * @retval RT_OK on success, appropriate error code otherwise.
369  */
370  rtError eissFilterStatus(rtString& t) const;
371 
372  /**
373  * @brief This API is to enable/disable the EISS filter.
374  *
375  * @param[in] t Enable/disable value.
376  *
377  * @return Returns the status of the operation.
378  * @retval RT_OK on success, appropriate error code otherwise.
379  */
380  rtError setEissFilterStatus(rtString const& t);
381 
382  /**
383  * @brief This API returns the start time of the video.
384  *
385  * @param[out] t Start time of the video
386  *
387  * @return Returns the status of the operation.
388  * @retval RT_OK on success, appropriate error code otherwise.
389  */
390  rtError loadStartTime(int64_t& t) const;
391 
392  /**
393  * @brief This API is to set the start time of the video.
394  *
395  * @param[in] t start time to set.
396  *
397  * @return Returns the status of the operation.
398  * @retval RT_OK on success, appropriate error code otherwise.
399  */
400  rtError setLoadStartTime(int64_t const& t);
401 
402  /**
403  * @brief This API returns the closed caption status.
404  *
405  * - False indicates captioning is not enabled (default)
406  * - True indicates captioning is enabled
407  *
408  * @param[out] t Indicates the closed caption status
409  *
410  * @return Returns the status of the operation.
411  * @retval RT_OK on success, appropriate error code otherwise.
412  */
413  rtError closedCaptionsEnabled(rtString& t) const;
414 
415  /**
416  * @brief This method allows close captioning to be enabled.
417  *
418  * Close captioning is disabled by default in the player.
419  *
420  * @param[in] t Parameter to enable/disable closed caption.
421  *
422  * @return Returns the status of the operation.
423  * @retval RT_OK on success, appropriate error code otherwise.
424  */
425  rtError setClosedCaptionsEnabled(rtString const& t);
426 
427  /**
428  * @brief Returns the list of supported closed caption options supported by this player.
429  *
430  * @param[out] t closed caption options.
431  *
432  * @return Returns the status of the operation.
433  * @retval RT_OK on success, appropriate error code otherwise.
434  */
435  rtError closedCaptionsOptions(rtObjectRef& t) const;
436 
437  /**
438  * @brief Sets the close caption options to use when close captioning is enabled.
439  *
440  * List of option keys are:
441  * - textSize
442  * - fontStyle
443  * - textEdgeStyle
444  * - textEdgeColor
445  * - textForegroundColor
446  * - textForegroundOpacity
447  * - textItalicized
448  * - textUnderline
449  * - windowFillColor
450  * - windowFillOpacity
451  * - windowBorderEdgeColor
452  * - windowBorderEdgeStyle
453  *
454  * @param[in] t Options to set.
455  *
456  * @return Returns the status of the operation.
457  * @retval RT_OK on success, appropriate error code otherwise.
458  */
459  rtError setClosedCaptionsOptions(rtObjectRef const& t);
460 
461  /**
462  * @brief Returns the available closed caption tracks for this stream.
463  *
464  * @param[out] t Closed caption tracks supported.
465  *
466  * @return Returns the status of the operation.
467  * @retval RT_OK on success, appropriate error code otherwise.
468  */
469  rtError closedCaptionsTrack(rtString& t) const;
470 
471  /**
472  * @brief Sets the caption track to be played when closedCaptionEnabled is true.
473  *
474  * @param[in] t Caption track to set.
475  *
476  * @return Returns the status of the operation.
477  * @retval RT_OK on success, appropriate error code otherwise.
478  */
479  rtError setClosedCaptionsTrack(rtString const& t);
480 
481  /**
482  * @brief Returns the content options.
483  *
484  * Content options are an array of hashes containing key/value pairs that define additional properties for the video resource.
485  * Eg : contentOptions: {"assetType":"T6_LINEAR","streamId":"6295598249589545163","resumePosition":-1000,
486  * "isContentPosition":false,"mediaGuid":null,"assetEngine":"aamp",
487  * "adConfig":{"type":"clinear","terminalAddress":"20:F1:9E:2D:32:6B"}}
488  *
489  * @param[out] t Indicates the content options.
490  *
491  * @return Returns the status of the operation.
492  * @retval RT_OK on success, appropriate error code otherwise.
493  */
494  rtError contentOptions(rtObjectRef& t) const;
495 
496  /**
497  * @brief This API is to update the content option.
498  *
499  * @param[in] t Option to update.
500  *
501  * @return Returns the status of the operation.
502  * @retval RT_OK on success, appropriate error code otherwise.
503  */
504  rtError setContentOptions(rtObjectRef const& t);
505 
506  /**
507  * @brief This API returns the duration of video in milliseconds.
508  *
509  * @param[out] t Total video duration
510  *
511  * @return Returns the status of the operation.
512  * @retval RT_OK on success, appropriate error code otherwise.
513  */
514  rtError duration(float& t) const;
515 
516  /**
517  * @brief This method returns the languages available on the stream.
518  *
519  * @param[out] t Audio languages supported.
520  *
521  * @return Returns the status of the operation.
522  * @retval RT_OK on success, appropriate error code otherwise.
523  */
524  rtError availableAudioLanguages(rtString& t) const;
525 
526  /**
527  * @brief This API was supposed to return array of the available captions languages for this video.
528  *
529  * @param[out] t Closed caption languages
530  *
531  * @return Returns the status of the operation.
532  * @retval RT_OK on success, appropriate error code otherwise.
533  */
534  rtError availableClosedCaptionsLanguages(rtString& t) const;
535 
536  /**
537  * @brief This API returns available playback rates for this video.
538  *
539  * @param[out] t playback rates.
540  *
541  * @return Returns the status of the operation.
542  * @retval RT_OK on success, appropriate error code otherwise.
543  */
544  rtError availableSpeeds(rtString& t) const;
545 
546  /**
547  * @brief This API returns true, if TSB is enabled for this resource.
548  *
549  * Defaults to false.
550  *
551  * @param[out] t TSB enabled/disabled status.
552  *
553  * @return Returns the status of the operation.
554  * @retval RT_OK on success, appropriate error code otherwise.
555  */
556  rtError tsbEnabled(rtString& t) const;
557 
558  /**
559  * @brief This API is to enable/disable TSB.
560  *
561  * @param[in] t Value to set.
562  *
563  * @return Returns the status of the operation.
564  * @retval RT_OK on success, appropriate error code otherwise.
565  */
566  rtError setTsbEnabled(rtString const& t);
567 
568  //rtRemote methods
569 
570  /**
571  * @brief API to draw a rectangle.
572  *
573  * @param[in] x X co-ordinate
574  * @param[in] y Y co-ordinate
575  * @param[in] w Width of the video
576  * @param[in] h Height of the video
577  *
578  * @return Returns the status of the operation.
579  * @retval RT_OK on success, appropriate error code otherwise.
580  */
581  rtError setVideoRectangle(int32_t x, int32_t y, int32_t w, int32_t h);
582 
583  /**
584  * @brief This API starts video playback.
585  *
586  * If the stream is paused the stream will resume playback from the playhead position.
587  * If the stream is not paused the stream will start playback from the beginning of the stream.
588  *
589  * @return Returns the status of the operation.
590  * @retval RT_OK on success, appropriate error code otherwise.
591  */
592  rtError play();
593 
594  /**
595  * @brief This API pause the stream and retain the playhead position.
596  *
597  * @return Returns the status of the operation.
598  * @retval RT_OK on success, appropriate error code otherwise.
599  */
600  rtError pause();
601 
602  /**
603  * @brief Moves the playhead to the live position in the player.
604  *
605  * @return Returns the status of the operation.
606  * @retval RT_OK on success, appropriate error code otherwise.
607  */
608  rtError seekToLive();
609  /**
610  * @brief This API stops the stream and releases unnecessary resources.
611  *
612  * The playhead position will be lost and the last video frame should be cleared.
613  *
614  * @return Returns the status of the operation.
615  * @retval RT_OK on success, appropriate error code otherwise.
616  */
617  rtError stop();
618 
619  /**
620  * @brief This is an alternative to setting the speed property directly.
621  *
622  * The overshoot value is a positive or negative value which expresses the number of milliseconds
623  * which can be used to compensate for overshooting the mark when changing speeds.
624  *
625  * @param[in] speed Speed in milliseconds
626  * @param[in] overshootTime Time in milliseconds
627  *
628  * @return Returns the status of the operation.
629  * @retval RT_OK on success, appropriate error code otherwise.
630  */
631  rtError changeSpeed(float speed, int32_t overshootTime);
632 
633  /**
634  * @brief Sets the position of the video by adding the given number of seconds.
635  *
636  * Seconds may be positive or negative.
637  * But should not cause the position to be less than zero or greater than the duration.
638  *
639  * @param[in] seconds Seek time in seconds.
640  *
641  * @return Returns the status of the operation.
642  * @retval RT_OK on success, appropriate error code otherwise.
643  */
644  rtError setPositionRelative(float seconds);
645 
646  /**
647  * @brief This API requests the onStatus event to be fired.
648  *
649  * @return Returns the status of the operation.
650  * @retval RT_OK on success, appropriate error code otherwise.
651  */
652  rtError requestStatus();
653 
654  /**
655  * @brief Sets additional auth data on the player that the player may need to continue playback.
656  *
657  * @param[in] t Key/value pairs required for additional authentication and authorization.
658  *
659  * @return Returns the status of the operation.
660  * @retval RT_OK on success, appropriate error code otherwise.
661  */
662  rtError setAdditionalAuth(rtObjectRef const& t);
663 
664  /**
665  * @brief Register an event listener for the specified event name.
666  *
667  * @param[in] eventName Events associated with the mediaplayer onMediaOpened, onBuffering, onPlaying etc.
668  * @param[in] f Listener function associated with the event.
669  *
670  * @return Returns the status of the operation.
671  * @retval RT_OK on success, appropriate error code otherwise.
672  */
673  rtError setListener(rtString eventName, const rtFunctionRef& f);
674 
675  /**
676  * @brief This API deregisters the listeners associated with the event.
677  *
678  * @param[in] eventName Events associated with the mediaplayer onMediaOpened, onBuffering, onPlaying etc.
679  * @param[in] f Listener function associated with the event.
680  *
681  * @return Returns the status of the operation.
682  * @retval RT_OK on success, appropriate error code otherwise.
683  */
684  rtError delListener(rtString eventName, const rtFunctionRef& f);
685 
686  /**
687  * @brief Request to destroy the video resource.
688  *
689  * @return Returns the status of the operation.
690  * @retval RT_OK on success, appropriate error code otherwise.
691  */
692  rtError destroy();
693 
694  /**
695  * @brief Open the CAS Management Service Session for CMI.
696  *
697  * This is to create a CAS management service session
698  * to start receiving data to/from the CAS System.
699  *
700  * @param[in] param Json string OpenData to CAS
701  * @param[out] resp Response returns back to CAS Management client
702  *
703  * @return Returns the status of the operation.
704  * @retval RT_OK on success, appropriate error code otherwise.
705  */
706  rtError open(rtString param, rtString resp);
707 
708  /**
709  * @brief Send the data to CAS System.
710  *
711  * This is to pass the data to CAS system to process
712  * the result of this back through EventData asynchronously
713  *
714  * @param[in] data Json string XferInfo to CAS
715  * @param[out] resp Response returns back to CAS Management client
716  *
717  * @return Returns the status of the operation.
718  * @retval RT_OK on success, appropriate error code otherwise.
719  */
720  rtError sendCASData(rtString data, rtString resp);
721 
722  /**
723  * @brief Returns the blocked status.
724  *
725  * @return Returns the status of the operation.
726  * @retval TRUE/FALSE depending upon the status.
727  */
728  bool getIsBlocked() const;
729 
730  /**
731  * @brief Returns the system monotonic time.
732  *
733  * It is the value returned by g_get_monotonic_time()
734  *
735  * @return Returns time in microseconds.
736  */
737  const gint64& getSetURLTime() const;
738 
739  /**
740  * @brief Returns the value set using the function setLoadStartTime().
741  *
742  * @return Returns the time in microseconds.
743  */
744  const gint64& getLoadStartTime() const;
745 
746  /**
747  * @brief Returns the player start time.
748  *
749  * @return Returns the start time in microseconds.
750  */
751  const gint64& getPlayStartTime() const;
752 
753  /**
754  * @brief This function is used to trigger the events.
755  *
756  * @return Returns the reference of event emitter class .
757  */
759 
760  /**
761  * @brief This API receives the decoder handle and updates the closedcaption state.
762  *
763  * @param[in] handle Handle to check closedcaption is enabled or not.
764  */
765  void onVidHandleReceived(uint32_t handle);
766 
767  /**
768  * @brief This API requests for OnMediaOpenedEvent() to be fired and updates the media data like speed,
769  * duration,available speeds, available languages etc.
770  *
771  * @param[in] languages Available AudioLanguages
772  * @param[in] speeds Available playback rates
773  * @param[in] duration Duration of the video
774  * @param[in] width Width of the video
775  * @param[in] height Heigt of the video
776  */
777  void updateVideoMetadata(const std::string& languages, const std::string& speeds, int duration, int width, int height);
778 
779 private:
780  rtError startQueuedTune();
781  void updateClosedCaptionsState();
782 
783  std::vector<RDKMediaPlayerImpl*> m_playerCache;
784  RDKMediaPlayerImpl* m_pImpl;
785 #ifndef DISABLE_CLOSEDCAPTIONS
786  ClosedCaptions m_closedCaptions;
787 #endif
788  EventEmitter m_eventEmitter;
789 
790  std::string m_currentURL;
791  std::string m_audioLanguage;
792  std::string m_secondaryAudioLanguage;
793  IntRect m_videoRect;
794  float m_seekTime;
795  float m_speed;
796  float m_volume;
797  float m_videoBufferLength;
798  bool m_urlQueued;
799  bool m_isBlocked;
800  bool m_eissFilterStatus;
801  bool m_isInProgressRecording;
802  bool m_tsbEnabled;
803  int32_t m_zoom;
804  int32_t m_networkBufferSize;
805  int32_t m_overshootTime;
806  gint64 m_loadStartTime { 0 };
807  gint64 m_setURLTime { 0 };
808  gint64 m_playStartTime { 0 };
809  bool m_closedCaptionsEnabled;
810  std::map<std::string, std::string> m_closedCaptionsOptions;
811  std::string m_closedCaptionsTrack;
812  uint32_t m_vidDecoderHandle;
813  rtObjectRef m_contentOptions;
814  bool m_autoPlay;
815 
816  //status info
817  float m_duration;
818  std::string m_availableAudioLanguages;
819  std::string m_availableClosedCaptionsLanguages;
820  std::string m_availableSpeeds;
821 };
822 #endif // _RT_AAMP_PLAYER_H_
823 
824 /**
825  * @}
826  */
827 
828 
RDKMediaPlayer::availableAudioLanguages
rtError availableAudioLanguages(rtString &t) const
This method returns the languages available on the stream.
Definition: rdkmediaplayer.cpp:546
RDKMediaPlayer::delListener
rtError delListener(rtString eventName, const rtFunctionRef &f)
This API deregisters the listeners associated with the event.
Definition: rdkmediaplayer.cpp:698
RDKMediaPlayer::duration
rtError duration(float &t) const
This API returns the duration of video in milliseconds.
Definition: rdkmediaplayer.cpp:540
RDKMediaPlayer::setIsInProgressRecording
rtError setIsInProgressRecording(rtString const &t)
This API is intended to set the recording state.
Definition: rdkmediaplayer.cpp:368
RDKMediaPlayer::closedCaptionsTrack
rtError closedCaptionsTrack(rtString &t) const
Returns the available closed caption tracks for this stream.
Definition: rdkmediaplayer.cpp:502
RDKMediaPlayer::tsbEnabled
rtError tsbEnabled(rtString &t) const
This API returns true, if TSB is enabled for this resource.
Definition: rdkmediaplayer.cpp:564
RDKMediaPlayer::position
rtError position(float &t) const
This API returns the current position details from the progress data.
Definition: rdkmediaplayer.cpp:285
RDKMediaPlayer::getIsBlocked
bool getIsBlocked() const
Returns the blocked status.
Definition: rdkmediaplayer.cpp:814
RDKMediaPlayer::pause
rtError pause()
This API pause the stream and retain the playhead position.
Definition: rdkmediaplayer.cpp:602
RDKMediaPlayer::updateVideoMetadata
void updateVideoMetadata(const std::string &languages, const std::string &speeds, int duration, int width, int height)
This API requests for OnMediaOpenedEvent() to be fired and updates the media data like speed,...
Definition: rdkmediaplayer.cpp:846
RDKMediaPlayer::networkBufferSize
rtError networkBufferSize(int32_t &t) const
This API returns the size of the buffer in milliseconds.
Definition: rdkmediaplayer.cpp:397
RDKMediaPlayer::setSecondaryAudioLanguage
rtError setSecondaryAudioLanguage(rtString const &s)
This API is to set the secondary audio language.
Definition: rdkmediaplayer.cpp:278
RDKMediaPlayer::contentOptions
rtError contentOptions(rtObjectRef &t) const
Returns the content options.
Definition: rdkmediaplayer.cpp:515
RDKMediaPlayer::setPosition
rtError setPosition(float const &t)
Moves the playhead to the absolute mediatime specified.
Definition: rdkmediaplayer.cpp:298
RDKMediaPlayer::requestStatus
rtError requestStatus()
This API requests the onStatus event to be fired.
Definition: rdkmediaplayer.cpp:679
RDKMediaPlayer
Definition: rdkmediaplayer.h:52
RDKMediaPlayer::setEissFilterStatus
rtError setEissFilterStatus(rtString const &t)
This API is to enable/disable the EISS filter.
Definition: rdkmediaplayer.cpp:434
ClosedCaptions
Definition: closedcaptions.h:26
RDKMediaPlayer::zoom
rtError zoom(rtString &t) const
This API returns either FULL" or "NONE".
Definition: rdkmediaplayer.cpp:378
RDKMediaPlayer::setNetworkBufferSize
rtError setNetworkBufferSize(int32_t const &t)
The API sets the network buffer size.
Definition: rdkmediaplayer.cpp:403
RDKMediaPlayer::secondaryAudioLanguage
rtError secondaryAudioLanguage(rtString &s) const
Function returns the secondary audio language.
Definition: rdkmediaplayer.cpp:273
RDKMediaPlayer::setVideoRectangle
rtError setVideoRectangle(int32_t x, int32_t y, int32_t w, int32_t h)
API to draw a rectangle.
Definition: rdkmediaplayer.cpp:579
RDKMediaPlayer::setClosedCaptionsEnabled
rtError setClosedCaptionsEnabled(rtString const &t)
This method allows close captioning to be enabled.
Definition: rdkmediaplayer.cpp:463
RDKMediaPlayer::setBlocked
rtError setBlocked(rtString const &t)
This method will block the video and mute the audio if flag is true.
Definition: rdkmediaplayer.cpp:353
RDKMediaPlayer::setSpeed
rtError setSpeed(float const &t)
This API is to set the playback rate.
Definition: rdkmediaplayer.cpp:321
RDKMediaPlayer::closedCaptionsEnabled
rtError closedCaptionsEnabled(rtString &t) const
This API returns the closed caption status.
Definition: rdkmediaplayer.cpp:457
RDKMediaPlayer::setAudioLanguage
rtError setAudioLanguage(rtString const &s)
This API is to set the audio language to the player.
Definition: rdkmediaplayer.cpp:262
RDKMediaPlayer::availableClosedCaptionsLanguages
rtError availableClosedCaptionsLanguages(rtString &t) const
This API was supposed to return array of the available captions languages for this video.
Definition: rdkmediaplayer.cpp:552
RDKMediaPlayer::setPositionRelative
rtError setPositionRelative(float seconds)
Sets the position of the video by adding the given number of seconds.
Definition: rdkmediaplayer.cpp:661
RDKMediaPlayer::setVideoBufferLength
rtError setVideoBufferLength(float const &t)
This API is to set the range of buffered video.
Definition: rdkmediaplayer.cpp:418
RDKMediaPlayer::setLoadStartTime
rtError setLoadStartTime(int64_t const &t)
This API is to set the start time of the video.
Definition: rdkmediaplayer.cpp:450
RDKMediaPlayer::getPlayStartTime
const gint64 & getPlayStartTime() const
Returns the player start time.
Definition: rdkmediaplayer.cpp:829
RDKMediaPlayer::setVolume
rtError setVolume(float const &t)
This method sets the volume level for the player instance and is persisted across different URLs.
Definition: rdkmediaplayer.cpp:337
RDKMediaPlayer::getLoadStartTime
const gint64 & getLoadStartTime() const
Returns the value set using the function setLoadStartTime().
Definition: rdkmediaplayer.cpp:824
RDKMediaPlayer::volume
rtError volume(float &t) const
This API returns the current volume.
Definition: rdkmediaplayer.cpp:332
RDKMediaPlayer::blocked
rtError blocked(rtString &t) const
This API is to check video is blocked or not.
Definition: rdkmediaplayer.cpp:347
RDKMediaPlayer::setCurrentURL
rtError setCurrentURL(rtString const &s)
This API performs following functionalities.
Definition: rdkmediaplayer.cpp:227
RDKMediaPlayer::onVidHandleReceived
void onVidHandleReceived(uint32_t handle)
This API receives the decoder handle and updates the closedcaption state.
Definition: rdkmediaplayer.cpp:839
RDKMediaPlayer::setClosedCaptionsOptions
rtError setClosedCaptionsOptions(rtObjectRef const &t)
Sets the close caption options to use when close captioning is enabled.
Definition: rdkmediaplayer.cpp:482
RDKMediaPlayer::currentURL
rtError currentURL(rtString &s) const
This API returns current playback URL.
Definition: rdkmediaplayer.cpp:164
RDKMediaPlayer::audioLanguage
rtError audioLanguage(rtString &s) const
This API returns the audio language selected.
Definition: rdkmediaplayer.cpp:256
RDKMediaPlayer::loadStartTime
rtError loadStartTime(int64_t &t) const
This API returns the start time of the video.
Definition: rdkmediaplayer.cpp:444
RDKMediaPlayer::setTsbEnabled
rtError setTsbEnabled(rtString const &t)
This API is to enable/disable TSB.
Definition: rdkmediaplayer.cpp:570
RDKMediaPlayerImpl
Definition: rdkmediaplayerimpl.h:40
RDKMediaPlayer::getSetURLTime
const gint64 & getSetURLTime() const
Returns the system monotonic time.
Definition: rdkmediaplayer.cpp:819
RDKMediaPlayer::setZoom
rtError setZoom(rtString const &t)
This API sets the value 0 or 1 depending on the argument "FULL" or "NONE".
Definition: rdkmediaplayer.cpp:384
RDKMediaPlayer::stop
rtError stop()
This API stops the stream and releases unnecessary resources.
Definition: rdkmediaplayer.cpp:624
RDKMediaPlayer::setClosedCaptionsTrack
rtError setClosedCaptionsTrack(rtString const &t)
Sets the caption track to be played when closedCaptionEnabled is true.
Definition: rdkmediaplayer.cpp:508
RDKMediaPlayer::play
rtError play()
This API starts video playback.
Definition: rdkmediaplayer.cpp:589
RDKMediaPlayer::isInProgressRecording
rtError isInProgressRecording(rtString &t) const
This API is intended to check recording status.
Definition: rdkmediaplayer.cpp:363
IntRect
Definition: intrect.h:22
RDKMediaPlayer::setAutoPlay
rtError setAutoPlay(rtString const &t)
This API sets the auto play flag of the player.
Definition: rdkmediaplayer.cpp:533
RDKMediaPlayer::getEventEmitter
EventEmitter & getEventEmitter()
This function is used to trigger the events.
Definition: rdkmediaplayer.cpp:834
EventEmitter
Definition: rtevents.h:51
RDKMediaPlayer::setAdditionalAuth
rtError setAdditionalAuth(rtObjectRef const &t)
Sets additional auth data on the player that the player may need to continue playback.
Definition: rdkmediaplayer.cpp:687
RDKMediaPlayer::availableSpeeds
rtError availableSpeeds(rtString &t) const
This API returns available playback rates for this video.
Definition: rdkmediaplayer.cpp:558
RDKMediaPlayer::changeSpeed
rtError changeSpeed(float speed, int32_t overshootTime)
This is an alternative to setting the speed property directly.
Definition: rdkmediaplayer.cpp:650
RDKMediaPlayer::speed
rtError speed(float &t) const
This API is to return current playback rate.
Definition: rdkmediaplayer.cpp:308
RDKMediaPlayer::open
rtError open(rtString param, rtString resp)
Open the CAS Management Service Session for CMI.
Definition: rdkmediaplayer.cpp:709
RDKMediaPlayer::seekToLive
rtError seekToLive()
Moves the playhead to the live position in the player.
Definition: rdkmediaplayer.cpp:613
RDKMediaPlayer::closedCaptionsOptions
rtError closedCaptionsOptions(rtObjectRef &t) const
Returns the list of supported closed caption options supported by this player.
Definition: rdkmediaplayer.cpp:471
RDKMediaPlayer::eissFilterStatus
rtError eissFilterStatus(rtString &t) const
This API checks EISS(ETV Integrated Signaling System) filter is enabled or not.
Definition: rdkmediaplayer.cpp:428
RDKMediaPlayer::sendCASData
rtError sendCASData(rtString data, rtString resp)
Send the data to CAS System.
Definition: rdkmediaplayer.cpp:801
RDKMediaPlayer::destroy
rtError destroy()
Request to destroy the video resource.
Definition: rdkmediaplayer.cpp:703
RDKMediaPlayer::autoPlay
rtError autoPlay(rtString &t) const
This API indicates autoplay is enabled or not.
Definition: rdkmediaplayer.cpp:527
RDKMediaPlayer::setContentOptions
rtError setContentOptions(rtObjectRef const &t)
This API is to update the content option.
Definition: rdkmediaplayer.cpp:521
RDKMediaPlayer::setListener
rtError setListener(rtString eventName, const rtFunctionRef &f)
Register an event listener for the specified event name.
Definition: rdkmediaplayer.cpp:693
RDKMediaPlayer::videoBufferLength
rtError videoBufferLength(float &t) const
This API returns the size of the video buffer.
Definition: rdkmediaplayer.cpp:413