RDK Documentation (Open Sourced RDK Components)
aampgstplayer.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 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 aampgstplayer.h
22  * @brief Gstreamer based player for AAMP
23  */
24 
25 #ifndef AAMPGSTPLAYER_H
26 #define AAMPGSTPLAYER_H
27 
28 #include <stddef.h>
29 #include <functional>
30 #include <gst/gst.h>
31 #include "priv_aamp.h"
32 #include <pthread.h>
33 
34 /**
35  * @struct AAMPGstPlayerPriv
36  * @brief forward declaration of AAMPGstPlayerPriv
37  */
38 struct AAMPGstPlayerPriv;
39 
40 /**
41  * @struct TaskControlData
42  * @brief data for scheduling and handling asynchronous tasks
43  */
45 {
46  guint taskID;
47  bool taskIsPending;
48  std::string taskName;
49  TaskControlData(const char* taskIdent) : taskID(0), taskIsPending(false), taskName(taskIdent ? taskIdent : "undefined") {};
50 };
51 
52 /**
53  * @brief Function pointer for the idle task
54  * @param[in] arg - Arguments
55  * @return Idle task status
56  */
57 typedef int(*BackgroundTask)(void* arg);
58 
59 
60 /**
61  * @class AAMPGstPlayer
62  * @brief Class declaration of Gstreamer based player
63  */
64 class AAMPGstPlayer : public StreamSink
65 {
66 private:
67  /**
68  * @fn SendHelper
69  * @param[in] mediaType stream type
70  * @param[in] ptr buffer pointer
71  * @param[in] len length of buffer
72  * @param[in] fpts PTS of buffer (in sec)
73  * @param[in] fdts DTS of buffer (in sec)
74  * @param[in] duration duration of buffer (in sec)
75  * @param[in] copy to map or transfer the buffer
76  * @param[in] initFragment flag for buffer type (init, data)
77  */
78  bool SendHelper(MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double duration, bool copy, bool initFragment = 0);
79 
80  /**
81  * @fn SendGstEvents
82  * @param[in] mediaType stream type
83  * @param[in] pts PTS of next buffer
84  * @param[in] ptr buffer pointer
85  * @param[in] len length of buffer
86  */
87  void SendGstEvents(MediaType mediaType, GstClockTime pts, const void *ptr, size_t len);
88 
89  /**
90  * @fn RecalculatePTS
91  * @param[in] mediaType stream type
92  * @param[in] ptr buffer pointer
93  * @param[in] len length of buffer
94  */
95  double RecalculatePTS(MediaType mediaType, const void *ptr, size_t len);
96 
97  /**
98  * @fn SendNewSegmentEvent
99  * @param[in] mediaType stream type
100  * @param[in] startPts Start Position of first buffer
101  * @param[in] stopPts Stop position of last buffer
102  */
103  void SendNewSegmentEvent(MediaType mediaType, GstClockTime startPts ,GstClockTime stopPts = 0);
104 
105 public:
106  class PrivateInstanceAAMP *aamp;
107  /**
108  * @fn Configure
109  * @param[in] format video format
110  * @param[in] audioFormat audio format
111  * @param[in] auxFormat aux audio format
112  * @param[in] subFormat subtitle format
113  * @param[in] bESChangeStatus flag to indicate if the audio type changed in mid stream
114  * @param[in] forwardAudioToAux if audio buffers to be forwarded to aux pipeline
115  * @param[in] setReadyAfterPipelineCreation True/False for pipeline is created
116  */
117  void Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false);
118  /**
119  * @fn SendCopy
120  * @param[in] mediaType stream type
121  * @param[in] ptr buffer pointer
122  * @param[in] len length of buffer
123  * @param[in] fpts PTS of buffer (in sec)
124  * @param[in] fdts DTS of buffer (in sec)
125  * @param[in] fDuration duration of buffer (in sec)
126  */
127  bool SendCopy(MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double fDuration);
128  /**
129  * @fn SendTransfer
130  * @param[in] mediaType stream type
131  * @param[in] buffer buffer as GrowableBuffer pointer
132  * @param[in] fpts PTS of buffer (in sec)
133  * @param[in] fdts DTS of buffer (in sec)
134  * @param[in] fDuration duration of buffer (in sec)
135  * @param[in] initFragment flag for buffer type (init, data)
136  */
137  bool SendTransfer(MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment);
138  /**
139  * @fn EndOfStreamReached
140  * @param[in] type stream type
141  */
142  void EndOfStreamReached(MediaType type);
143  /**
144  * @fn Stream
145  */
146  void Stream(void);
147 
148  /**
149  * @fn Stop
150  * @param[in] keepLastFrame denotes if last video frame should be kept
151  */
152  void Stop(bool keepLastFrame);
153  /**
154  * @fn DumpStatus
155  */
156  void DumpStatus(void);
157  /**
158  * @fn Flush
159  * @param[in] position playback seek position
160  * @param[in] rate playback rate
161  * @param[in] shouldTearDown flag indicates if pipeline should be destroyed if in invalid state
162  */
163  void Flush(double position, int rate, bool shouldTearDown);
164  /**
165  * @fn Pause
166  * @param[in] pause flag to pause/play the pipeline
167  * @param[in] forceStopGstreamerPreBuffering - true for disabling bufferinprogress
168  * @retval true if content successfully paused
169  */
170  bool Pause(bool pause, bool forceStopGstreamerPreBuffering);
171  /**
172  * @fn GetPositionMilliseconds
173  * @retval playback position in MS
174  */
175  long GetPositionMilliseconds(void);
176  /**
177  * @fn GetDurationMilliseconds
178  * @retval playback duration in MS
179  */
180  long GetDurationMilliseconds(void);
181  /**
182  * @fn getCCDecoderHandle
183  * @retval the decoder handle
184  */
185  unsigned long getCCDecoderHandle(void);
186  /**
187  * @fn GetVideoPTS
188  * @retval Video PTS value
189  */
190  virtual long long GetVideoPTS(void);
191  /**
192  * @fn SetVideoRectangle
193  * @param[in] x x co-ordinate of display rectangle
194  * @param[in] y y co-ordinate of display rectangle
195  * @param[in] w width of display rectangle
196  * @param[in] h height of display rectangle
197  */
198  void SetVideoRectangle(int x, int y, int w, int h);
199  /**
200  * @fn Discontinuity
201  * @param mediaType Media stream type
202  * @retval true if discontinuity processed
203  */
204  bool Discontinuity( MediaType mediaType);
205  /**
206  * @fn SetVideoZoom
207  * @param[in] zoom zoom setting to be set
208  */
209  void SetVideoZoom(VideoZoomMode zoom);
210  /**
211  * @fn SetVideoMute
212  * @param[in] muted true to mute video otherwise false
213  */
214  void SetVideoMute(bool muted);
215  /**
216  * @fn SetAudioVolume
217  * @param[in] volume audio volume value (0-100)
218  */
219  void SetAudioVolume(int volume);
220  /**
221  * @fn SetSubtitleMute
222  * @param[in] muted true to mute subtitle otherwise false
223  */
224  void SetSubtitleMute(bool mute);
225  /**
226  * @fn SetSubtitlePtsOffset
227  * @param[in] pts_offset pts offset for subs
228  */
229  void SetSubtitlePtsOffset(std::uint64_t pts_offset);
230  /**
231  * @fn setVolumeOrMuteUnMute
232  * @note set privateContext->audioVolume before calling this function
233  */
234  void setVolumeOrMuteUnMute(void);
235  /**
236  * @fn IsCacheEmpty
237  * @param[in] mediaType stream type
238  * @retval true if cache empty
239  */
240  bool IsCacheEmpty(MediaType mediaType);
241  /**
242  * @fn ResetEOSSignalledFlag
243  */
244  void ResetEOSSignalledFlag();
245  /**
246  * @fn CheckForPTSChangeWithTimeout
247  *
248  * @param[in] timeout - to check if PTS hasn't changed within a time duration
249  */
250  bool CheckForPTSChangeWithTimeout(long timeout);
251  /**
252  * @fn NotifyFragmentCachingComplete
253  */
255  /**
256  * @fn NotifyFragmentCachingOngoing
257  */
259  /**
260  * @fn GetVideoSize
261  * @param[out] w width video width
262  * @param[out] h height video height
263  */
264  void GetVideoSize(int &w, int &h);
265  /**
266  * @fn QueueProtectionEvent
267  * @param[in] protSystemId keysystem to be used
268  * @param[in] ptr initData DRM initialization data
269  * @param[in] len initDataSize DRM initialization data size
270  * @param[in] type Media type
271  */
272  void QueueProtectionEvent(const char *protSystemId, const void *ptr, size_t len, MediaType type);
273  /**
274  * @fn ClearProtectionEvent
275  */
276  void ClearProtectionEvent();
277  /**
278  * @fn IdleTaskAdd
279  * @param[in] taskDetails task control data (e.g. id, pending flag and task name)
280  * @param[in] funcPtr function pointer to add to the asynchronous queue task
281  * @return true - if task was added
282  */
283  bool IdleTaskAdd(TaskControlData& taskDetails, BackgroundTask funcPtr);
284  /**
285  * @fn IdleTaskRemove
286  * @param[in] taskDetails task control data (e.g. id, pending flag and task name)
287  * @return true - if task was removed
288  */
289  bool IdleTaskRemove(TaskControlData& taskDetails);
290  /**
291  * @fn IdleTaskClearFlags
292  * @param[in] taskDetails task control data (e.g. id, pending flag and task name)
293  */
294  void IdleTaskClearFlags(TaskControlData& taskDetails);
295  /**
296  * @fn TimerAdd
297  * @param[in] funcPtr function to execute on timer expiry
298  * @param[in] repeatTimeout timeout between calls in ms
299  * @param[in] user_data data to pass to the timer function
300  * @param[in] timerName name of the timer being added
301  * @param[out] taskId id of the timer to be returned
302  */
303  void TimerAdd(GSourceFunc funcPtr, int repeatTimeout, guint& taskId, gpointer user_data, const char* timerName = nullptr);
304  /**
305  * @fn TimerRemove
306  * @param[in] taskId id of the timer to be removed
307  * @param[in] timerName name of the timer being removed (for debug) (opt)
308  */
309  void TimerRemove(guint& taskId, const char* timerName = nullptr);
310  /**
311  * @fn TimerIsRunning
312  * @param[in] taskId id of the timer to be removed
313  * @return true - timer is currently running
314  */
315  bool TimerIsRunning(guint& taskId);
316  /**
317  * @fn StopBuffering
318  *
319  * @param[in] forceStop - true to force end buffering
320  */
321  void StopBuffering(bool forceStop);
322  /**
323  * @fn AdjustPlayBackRate
324  * @param[in] position playback seek position
325  * @param[in] rate playback rate
326  * @return true if playrate adjusted
327  */
328  bool AdjustPlayBackRate(double position, double rate);
329 
330  /**
331  * @fn SetPlayBackRate
332  * @param[in] rate playback rate
333  * @return true if playrate adjusted
334  */
335  bool SetPlayBackRate ( double rate );
336 
337  bool PipelineSetToReady; /**< To indicate the pipeline is set to ready forcefully */
338  bool trickTeardown; /**< To indicate that the tear down is initiated in trick play */
339  struct AAMPGstPlayerPriv *privateContext;
340  /**
341  * @fn AAMPGstPlayer
342  *
343  */
345 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
346  , std::function< void(uint8_t *, int, int, int) > exportFrames = nullptr
347 #endif
348  );
349  AAMPGstPlayer(const AAMPGstPlayer&) = delete;
350  AAMPGstPlayer& operator=(const AAMPGstPlayer&) = delete;
351  /**
352  * @fn ~AAMPGstPlayer
353  */
354  ~AAMPGstPlayer();
355  /**
356  * @fn InitializeAAMPGstreamerPlugins
357  */
358  static void InitializeAAMPGstreamerPlugins(AampLogManager *logObj=NULL);
359  /**
360  * @fn NotifyEOS
361  */
362  void NotifyEOS();
363  /**
364  * @fn NotifyFirstFrame
365  * @param[in] type media type of the frame which is decoded, either audio or video.
366  */
367  void NotifyFirstFrame(MediaType type);
368  /**
369  * @fn DumpDiagnostics
370  *
371  */
372  void DumpDiagnostics();
373  /**
374  * @fn SignalTrickModeDiscontinuity
375  * @return void
376  */
378 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
379  std::function< void(uint8_t *, int, int, int) > cbExportYUVFrame;
380  /**
381  * @fn AAMPGstPlayer_OnVideoSample
382  * @param[in] object - pointer to appsink instance triggering "new-sample" signal
383  * @param[in] _this - pointer to AAMPGstPlayer instance
384  * @retval GST_FLOW_OK
385  */
386  static GstFlowReturn AAMPGstPlayer_OnVideoSample(GstElement* object, AAMPGstPlayer * _this);
387 #endif
388  /**
389  * @fn SeekStreamSink
390  * @param position playback seek position
391  * @param rate play rate
392  */
393  void SeekStreamSink(double position, double rate);
394 
395  /**
396  * @fn static IsCodecSupported
397  * @param[in] codecName - name of the codec value
398  */
399  static bool IsCodecSupported(const std::string &codecName);
400 
401  /**
402  * @fn GetVideoRectangle
403  *
404  */
405  std::string GetVideoRectangle();
406 
407 private:
408  /**
409  * @fn PauseAndFlush
410  * @param playAfterFlush denotes if it should be set to playing at the end
411  */
412  void PauseAndFlush(bool playAfterFlush);
413  /**
414  * @fn TearDownStream
415  * @param[in] mediaType stream type
416  */
417  void TearDownStream(MediaType mediaType);
418  /**
419  * @fn CreatePipeline
420  */
421  bool CreatePipeline();
422  /**
423  * @fn DestroyPipeline
424  */
425  void DestroyPipeline();
426  static bool initialized;
427  /**
428  * @fn Flush
429  */
430  void Flush(void);
431  /**
432  * @brief Flush last saved ID3 metadata
433  * @return void
434  */
435  void FlushLastId3Data();
436  /**
437  * @fn WaitForSourceSetup
438  *
439  * @param[in] mediaType - source element for media type
440  * @return bool - true if source setup completed within timeout
441  */
442  bool WaitForSourceSetup(MediaType mediaType);
443  /**
444  * @fn ForwardBuffersToAuxPipeline
445  *
446  * @param[in] buffer - input buffer to be forwarded
447  */
448  void ForwardBuffersToAuxPipeline(GstBuffer *buffer);
449  /**
450  * @fn ForwardAudioBuffersToAux
451  *
452  * @return bool - true if audio to be forwarded
453  */
455 
456  pthread_mutex_t mBufferingLock;
457  pthread_mutex_t mProtectionLock;
458  AampLogManager *mLogObj;
459 };
460 
461 #endif // AAMPGSTPLAYER_H
462 
AAMPGstPlayer::NotifyFragmentCachingOngoing
void NotifyFragmentCachingOngoing()
Set pipeline to PAUSED state to wait on NotifyFragmentCachingComplete()
Definition: aampgstplayer.cpp:4336
AAMPGstPlayer::EndOfStreamReached
void EndOfStreamReached(MediaType type)
Starts processing EOS for a particular stream type.
Definition: aampgstplayer.cpp:3027
AAMPGstPlayer::~AAMPGstPlayer
~AAMPGstPlayer()
AAMPGstPlayer Destructor.
Definition: aampgstplayer.cpp:362
StreamOutputFormat
StreamOutputFormat
Media output format.
Definition: main_aamp.h:106
AAMPGstPlayer::TimerAdd
void TimerAdd(GSourceFunc funcPtr, int repeatTimeout, guint &taskId, gpointer user_data, const char *timerName=nullptr)
TimerAdd - add a new glib timer in thread safe manner.
Definition: aampgstplayer.cpp:452
AAMPGstPlayerPriv::rate
int rate
Definition: aampgstplayer.cpp:172
AAMPGstPlayer::NotifyEOS
void NotifyEOS()
Notify EOS to core aamp asynchronously if required.
Definition: aampgstplayer.cpp:4477
AAMPGstPlayer::trickTeardown
bool trickTeardown
Definition: aampgstplayer.h:338
AAMPGstPlayer::QueueProtectionEvent
void QueueProtectionEvent(const char *protSystemId, const void *ptr, size_t len, MediaType type)
Generate a protection event.
Definition: aampgstplayer.cpp:1955
AAMPGstPlayer::CreatePipeline
bool CreatePipeline()
Create a new Gstreamer pipeline.
Definition: aampgstplayer.cpp:1827
AAMPGstPlayer::DumpDiagnostics
void DumpDiagnostics()
Dump diagnostic information.
Definition: aampgstplayer.cpp:4535
AAMPGstPlayer::WaitForSourceSetup
bool WaitForSourceSetup(MediaType mediaType)
Wait for source element to be configured.
Definition: aampgstplayer.cpp:4674
AAMPGstPlayer::IdleTaskClearFlags
void IdleTaskClearFlags(TaskControlData &taskDetails)
IdleTaskClearFlags - clear async task id and pending flag in a thread safe manner e....
Definition: aampgstplayer.cpp:433
AAMPGstPlayer::TearDownStream
void TearDownStream(MediaType mediaType)
Cleanup resources and flags for a particular stream type.
Definition: aampgstplayer.cpp:2096
AAMPGstPlayer::Stream
void Stream(void)
To start playback.
Definition: aampgstplayer.cpp:2824
AAMPGstPlayer::Configure
void Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false)
Configure pipeline based on A/V formats.
Definition: aampgstplayer.cpp:2833
AAMPGstPlayer
Class declaration of Gstreamer based player.
Definition: aampgstplayer.h:64
AAMPGstPlayer::SendHelper
bool SendHelper(MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double duration, bool copy, bool initFragment=0)
Inject stream buffer to gstreamer pipeline.
Definition: aampgstplayer.cpp:2630
AAMPGstPlayer::SendTransfer
bool SendTransfer(MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment)
inject mp4 segment to gstreamer pipeline
Definition: aampgstplayer.cpp:2814
AAMPGstPlayer::TimerIsRunning
bool TimerIsRunning(guint &taskId)
TimerIsRunning - Check whether timer is currently running.
Definition: aampgstplayer.cpp:497
AAMPGstPlayer::DumpStatus
void DumpStatus(void)
Log the various info related to playback.
Definition: aampgstplayer.cpp:3326
AAMPGstPlayer::SetVideoMute
void SetVideoMute(bool muted)
Set video mute.
Definition: aampgstplayer.cpp:3863
AAMPGstPlayer::GetPositionMilliseconds
long GetPositionMilliseconds(void)
Get playback position in MS.
Definition: aampgstplayer.cpp:3590
AAMPGstPlayer::getCCDecoderHandle
unsigned long getCCDecoderHandle(void)
Retrieve the video decoder handle from pipeline.
Definition: aampgstplayer.cpp:1926
AAMPGstPlayer::GetDurationMilliseconds
long GetDurationMilliseconds(void)
Get playback duration in MS.
Definition: aampgstplayer.cpp:3545
AAMPGstPlayer::Pause
bool Pause(bool pause, bool forceStopGstreamerPreBuffering)
To pause/play pipeline.
Definition: aampgstplayer.cpp:3669
AAMPGstPlayer::setVolumeOrMuteUnMute
void setVolumeOrMuteUnMute(void)
Set audio volume or mute.
Definition: aampgstplayer.cpp:3902
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AAMPGstPlayer::ForwardBuffersToAuxPipeline
void ForwardBuffersToAuxPipeline(GstBuffer *buffer)
Forward buffer to aux pipeline.
Definition: aampgstplayer.cpp:4714
AAMPGstPlayer::SignalTrickModeDiscontinuity
void SignalTrickModeDiscontinuity()
Signal trick mode discontinuity to gstreamer pipeline.
Definition: aampgstplayer.cpp:4551
VideoZoomMode
VideoZoomMode
Video zoom mode.
Definition: main_aamp.h:129
AAMPGstPlayer::SendGstEvents
void SendGstEvents(MediaType mediaType, GstClockTime pts, const void *ptr, size_t len)
Definition: aampgstplayer.cpp:2432
AAMPGstPlayer::IdleTaskRemove
bool IdleTaskRemove(TaskControlData &taskDetails)
IdleTaskRemove - remove an async task in a thread safe manner, if it is queued.
Definition: aampgstplayer.cpp:408
AAMPGstPlayer::Discontinuity
bool Discontinuity(MediaType mediaType)
Process discontinuity for a stream type.
Definition: aampgstplayer.cpp:4159
AAMPGstPlayer::IsCodecSupported
static bool IsCodecSupported(const std::string &codecName)
Definition: aampgstplayer.cpp:4370
AAMPGstPlayer::ForwardAudioBuffersToAux
bool ForwardAudioBuffersToAux()
Check if audio buffers to be forwarded or not.
Definition: aampgstplayer.cpp:4749
AAMPGstPlayer::IdleTaskAdd
bool IdleTaskAdd(TaskControlData &taskDetails, BackgroundTask funcPtr)
IdleTaskAdd - add an async/idle task in a thread safe manner, assuming it is not queued.
Definition: aampgstplayer.cpp:376
AAMPGstPlayer::SetSubtitlePtsOffset
void SetSubtitlePtsOffset(std::uint64_t pts_offset)
Definition: aampgstplayer.cpp:3830
AAMPGstPlayer::TimerRemove
void TimerRemove(guint &taskId, const char *timerName=nullptr)
TimerRemove - remove a glib timer in thread safe manner, if it exists.
Definition: aampgstplayer.cpp:478
MediaType
MediaType
Media types.
Definition: AampMediaType.h:37
AAMPGstPlayer::NotifyFirstFrame
void NotifyFirstFrame(MediaType type)
Notify first Audio and Video frame through an idle function to make the playersinkbin halding same as...
Definition: aampgstplayer.cpp:837
AAMPGstPlayer::SetAudioVolume
void SetAudioVolume(int volume)
Set audio volume.
Definition: aampgstplayer.cpp:3890
AAMPGstPlayer::SetVideoRectangle
void SetVideoRectangle(int x, int y, int w, int h)
Set video display rectangle co-ordinates.
Definition: aampgstplayer.cpp:3738
AAMPGstPlayer::SetPlayBackRate
bool SetPlayBackRate(double rate)
Set playback rate to audio/video sinks.
Definition: aampgstplayer.cpp:4761
AAMPGstPlayerPriv
Holds private variables of AAMPGstPlayer.
Definition: aampgstplayer.cpp:147
AAMPGstPlayer::ClearProtectionEvent
void ClearProtectionEvent()
Cleanup generated protection event.
Definition: aampgstplayer.cpp:1998
AAMPGstPlayer::GetVideoPTS
virtual long long GetVideoPTS(void)
Gets Video PTS.
Definition: aampgstplayer.cpp:4230
AAMPGstPlayer::SetVideoZoom
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
Definition: aampgstplayer.cpp:3800
AAMPGstPlayer::PipelineSetToReady
bool PipelineSetToReady
Definition: aampgstplayer.h:337
priv_aamp.h
Private functions and types used internally by AAMP.
AAMPGstPlayer::AAMPGstPlayer
AAMPGstPlayer(AampLogManager *logObj, PrivateInstanceAAMP *aamp)
AAMPGstPlayer Constructor.
Definition: aampgstplayer.cpp:328
AAMPGstPlayer::DestroyPipeline
void DestroyPipeline()
Cleanup an existing Gstreamer pipeline and associated resources.
Definition: aampgstplayer.cpp:1887
StreamSink
GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin.
Definition: main_aamp.h:385
AAMPGstPlayer::GetVideoRectangle
std::string GetVideoRectangle()
Get the video rectangle co-ordinates.
Definition: aampgstplayer.cpp:4589
TaskControlData
data for scheduling and handling asynchronous tasks
Definition: aampgstplayer.h:44
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
AAMPGstPlayer::SendNewSegmentEvent
void SendNewSegmentEvent(MediaType mediaType, GstClockTime startPts, GstClockTime stopPts=0)
Send new segment event to pipeline.
Definition: aampgstplayer.cpp:2596
AAMPGstPlayer::SendCopy
bool SendCopy(MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double fDuration)
inject HLS/ts elementary stream buffer to gstreamer pipeline
Definition: aampgstplayer.cpp:2805
AAMPGstPlayer::InitializeAAMPGstreamerPlugins
static void InitializeAAMPGstreamerPlugins(AampLogManager *logObj=NULL)
Increase the rank of AAMP decryptor plugins.
Definition: aampgstplayer.cpp:4391
AAMPGstPlayer::Stop
void Stop(bool keepLastFrame)
Stop playback and any idle handlers active at the time.
Definition: aampgstplayer.cpp:3072
AAMPGstPlayer::RecalculatePTS
double RecalculatePTS(MediaType mediaType, const void *ptr, size_t len)
Definition: aampgstplayer.cpp:2378
BackgroundTask
int(* BackgroundTask)(void *arg)
Function pointer for the idle task.
Definition: aampgstplayer.h:57
AAMPGstPlayer::ResetEOSSignalledFlag
void ResetEOSSignalledFlag()
Reset EOS SignalledFlag.
Definition: aampgstplayer.cpp:4259
AAMPGstPlayer::Flush
void Flush(void)
Flush the buffers in pipeline.
Definition: aampgstplayer.cpp:3476
AAMPGstPlayer::FlushLastId3Data
void FlushLastId3Data()
Flush last saved ID3 metadata.
AAMPGstPlayer::CheckForPTSChangeWithTimeout
bool CheckForPTSChangeWithTimeout(long timeout)
Check if PTS is changing.
Definition: aampgstplayer.cpp:4193
AAMPGstPlayer::SeekStreamSink
void SeekStreamSink(double position, double rate)
Flush the data in case of a new tune pipeline.
Definition: aampgstplayer.cpp:4576
AAMPGstPlayer::IsCacheEmpty
bool IsCacheEmpty(MediaType mediaType)
Check if cache empty for a media type.
Definition: aampgstplayer.cpp:4267
AAMPGstPlayer::GetVideoSize
void GetVideoSize(int &w, int &h)
Get video display's width and height.
Definition: aampgstplayer.cpp:4349
AAMPGstPlayer::SetSubtitleMute
void SetSubtitleMute(bool mute)
Definition: aampgstplayer.cpp:3844
AAMPGstPlayer::NotifyFragmentCachingComplete
void NotifyFragmentCachingComplete()
Set pipeline to PLAYING state once fragment caching is complete.
Definition: aampgstplayer.cpp:4315
AAMPGstPlayer::PauseAndFlush
void PauseAndFlush(bool playAfterFlush)
PauseAndFlush pipeline and flush.
Definition: aampgstplayer.cpp:3488
AAMPGstPlayer::AdjustPlayBackRate
bool AdjustPlayBackRate(double position, double rate)
adjust playback rate
Definition: aampgstplayer.cpp:4875
AAMPGstPlayer::StopBuffering
void StopBuffering(bool forceStop)
Un-pause pipeline and notify buffer end event to player.
Definition: aampgstplayer.cpp:4598
PrivateInstanceAAMP::rate
float rate
Definition: priv_aamp.h:955