![]() |
RDK Documentation (Open Sourced RDK Components)
|
Class declaration of Gstreamer based player. More...
#include <aampgstplayer.h>


Public Member Functions | |
| bool | AdjustPlayBackRate (double position, double rate) |
| adjust playback rate More... | |
| bool | SetPlayBackRate (double rate) |
| Set playback rate to audio/video sinks. More... | |
| AAMPGstPlayer (const AAMPGstPlayer &)=delete | |
| AAMPGstPlayer & | operator= (const AAMPGstPlayer &)=delete |
Public Member Functions inherited from StreamSink | |
| virtual | ~StreamSink () |
| StreamSink Dtor. | |
Data Fields | |
| class PrivateInstanceAAMP * | aamp |
| bool | PipelineSetToReady |
| bool | trickTeardown |
| struct AAMPGstPlayerPriv * | privateContext |
Private Member Functions | |
| void | FlushLastId3Data () |
| Flush last saved ID3 metadata. More... | |
Private Attributes | |
| pthread_mutex_t | mBufferingLock |
| pthread_mutex_t | mProtectionLock |
| AampLogManager * | mLogObj |
Static Private Attributes | |
| static bool | initialized |
gmapDecoderLoookUptable | |
Decoder map list lookup table convert from codec to string map list of gstreamer component. | |
| 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. More... | |
| void | SendGstEvents (MediaType mediaType, GstClockTime pts, const void *ptr, size_t len) |
| double | RecalculatePTS (MediaType mediaType, const void *ptr, size_t len) |
| void | SendNewSegmentEvent (MediaType mediaType, GstClockTime startPts, GstClockTime stopPts=0) |
| Send new segment event to pipeline. More... | |
| void | PauseAndFlush (bool playAfterFlush) |
| PauseAndFlush pipeline and flush. More... | |
| void | TearDownStream (MediaType mediaType) |
| Cleanup resources and flags for a particular stream type. More... | |
| bool | CreatePipeline () |
| Create a new Gstreamer pipeline. | |
| void | DestroyPipeline () |
| Cleanup an existing Gstreamer pipeline and associated resources. | |
| void | Flush (void) |
| Flush the buffers in pipeline. More... | |
| bool | WaitForSourceSetup (MediaType mediaType) |
| Wait for source element to be configured. More... | |
| void | ForwardBuffersToAuxPipeline (GstBuffer *buffer) |
| Forward buffer to aux pipeline. More... | |
| bool | ForwardAudioBuffersToAux () |
| Check if audio buffers to be forwarded or not. More... | |
| void | Configure (StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false) |
| Configure pipeline based on A/V formats. More... | |
| 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 More... | |
| bool | SendTransfer (MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment) |
| inject mp4 segment to gstreamer pipeline More... | |
| void | EndOfStreamReached (MediaType type) |
| Starts processing EOS for a particular stream type. More... | |
| void | Stream (void) |
| To start playback. | |
| void | Stop (bool keepLastFrame) |
| Stop playback and any idle handlers active at the time. More... | |
| void | DumpStatus (void) |
| Log the various info related to playback. | |
| void | Flush (double position, int rate, bool shouldTearDown) |
| Flush cached GstBuffers and set seek position & rate. | |
| bool | Pause (bool pause, bool forceStopGstreamerPreBuffering) |
| To pause/play pipeline. More... | |
| long | GetPositionMilliseconds (void) |
| Get playback position in MS. More... | |
| long | GetDurationMilliseconds (void) |
| Get playback duration in MS. More... | |
| unsigned long | getCCDecoderHandle (void) |
| Retrieve the video decoder handle from pipeline. More... | |
| virtual long long | GetVideoPTS (void) |
| Gets Video PTS. More... | |
| void | SetVideoRectangle (int x, int y, int w, int h) |
| Set video display rectangle co-ordinates. More... | |
| bool | Discontinuity (MediaType mediaType) |
| Process discontinuity for a stream type. More... | |
| void | SetVideoZoom (VideoZoomMode zoom) |
| Set video zoom. More... | |
| void | SetVideoMute (bool muted) |
| Set video mute. More... | |
| void | SetAudioVolume (int volume) |
| Set audio volume. More... | |
| void | SetSubtitleMute (bool mute) |
| void | SetSubtitlePtsOffset (std::uint64_t pts_offset) |
| void | setVolumeOrMuteUnMute (void) |
| Set audio volume or mute. More... | |
| bool | IsCacheEmpty (MediaType mediaType) |
| Check if cache empty for a media type. More... | |
| void | ResetEOSSignalledFlag () |
| Reset EOS SignalledFlag. | |
| bool | CheckForPTSChangeWithTimeout (long timeout) |
| Check if PTS is changing. More... | |
| void | NotifyFragmentCachingComplete () |
| Set pipeline to PLAYING state once fragment caching is complete. | |
| void | NotifyFragmentCachingOngoing () |
| Set pipeline to PAUSED state to wait on NotifyFragmentCachingComplete() | |
| void | GetVideoSize (int &w, int &h) |
| Get video display's width and height. More... | |
| void | QueueProtectionEvent (const char *protSystemId, const void *ptr, size_t len, MediaType type) |
| Generate a protection event. More... | |
| void | ClearProtectionEvent () |
| Cleanup generated protection event. | |
| bool | IdleTaskAdd (TaskControlData &taskDetails, BackgroundTask funcPtr) |
| IdleTaskAdd - add an async/idle task in a thread safe manner, assuming it is not queued. More... | |
| bool | IdleTaskRemove (TaskControlData &taskDetails) |
| IdleTaskRemove - remove an async task in a thread safe manner, if it is queued. More... | |
| void | IdleTaskClearFlags (TaskControlData &taskDetails) |
| IdleTaskClearFlags - clear async task id and pending flag in a thread safe manner e.g. called when the task executes. More... | |
| 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. More... | |
| void | TimerRemove (guint &taskId, const char *timerName=nullptr) |
| TimerRemove - remove a glib timer in thread safe manner, if it exists. More... | |
| bool | TimerIsRunning (guint &taskId) |
| TimerIsRunning - Check whether timer is currently running. More... | |
| void | StopBuffering (bool forceStop) |
| Un-pause pipeline and notify buffer end event to player. More... | |
| AAMPGstPlayer (AampLogManager *logObj, PrivateInstanceAAMP *aamp) | |
| AAMPGstPlayer Constructor. | |
| ~AAMPGstPlayer () | |
| AAMPGstPlayer Destructor. | |
| void | NotifyEOS () |
| Notify EOS to core aamp asynchronously if required. More... | |
| void | NotifyFirstFrame (MediaType type) |
| Notify first Audio and Video frame through an idle function to make the playersinkbin halding same as normal(playbin) playback. More... | |
| void | DumpDiagnostics () |
| Dump diagnostic information. More... | |
| void | SignalTrickModeDiscontinuity () |
| Signal trick mode discontinuity to gstreamer pipeline. More... | |
| void | SeekStreamSink (double position, double rate) |
| Flush the data in case of a new tune pipeline. More... | |
| std::string | GetVideoRectangle () |
| Get the video rectangle co-ordinates. | |
| static void | InitializeAAMPGstreamerPlugins (AampLogManager *logObj=NULL) |
| Increase the rank of AAMP decryptor plugins. | |
| static bool | IsCodecSupported (const std::string &codecName) |
Class declaration of Gstreamer based player.
Definition at line 64 of file aampgstplayer.h.
|
private |
Inject stream buffer to gstreamer pipeline.
| [in] | mediaType | stream type |
| [in] | ptr | buffer pointer |
| [in] | len | length of buffer |
| [in] | fpts | PTS of buffer (in sec) |
| [in] | fdts | DTS of buffer (in sec) |
| [in] | duration | duration of buffer (in sec) |
| [in] | copy | to map or transfer the buffer |
| [in] | initFragment | flag for buffer type (init, data) |
Definition at line 2630 of file aampgstplayer.cpp.
|
private |
| [in] | mediaType | stream type |
| [in] | pts | PTS of next buffer |
| [in] | ptr | buffer pointer |
| [in] | len | length of buffer |
Definition at line 2432 of file aampgstplayer.cpp.
|
private |
| [in] | mediaType | stream type |
| [in] | ptr | buffer pointer |
| [in] | len | length of buffer |
Definition at line 2378 of file aampgstplayer.cpp.
|
private |
Send new segment event to pipeline.
| [in] | mediaType | stream type |
| [in] | startPts | Start Position of first buffer |
| [in] | stopPts | Stop position of last buffer |
Definition at line 2596 of file aampgstplayer.cpp.
|
virtual |
Configure pipeline based on A/V formats.
| [in] | format | video format |
| [in] | audioFormat | audio format |
| [in] | auxFormat | aux audio format |
| [in] | subFormat | subtitle format |
| [in] | bESChangeStatus | flag to indicate if the audio type changed in mid stream |
| [in] | forwardAudioToAux | if audio buffers to be forwarded to aux pipeline |
| [in] | setReadyAfterPipelineCreation | True/False for pipeline is created |
Reimplemented from StreamSink.
Definition at line 2833 of file aampgstplayer.cpp.
|
virtual |
inject HLS/ts elementary stream buffer to gstreamer pipeline
| [in] | mediaType | stream type |
| [in] | ptr | buffer pointer |
| [in] | len | length of buffer |
| [in] | fpts | PTS of buffer (in sec) |
| [in] | fdts | DTS of buffer (in sec) |
| [in] | fDuration | duration of buffer (in sec) |
Implements StreamSink.
Definition at line 2805 of file aampgstplayer.cpp.
|
virtual |
inject mp4 segment to gstreamer pipeline
| [in] | mediaType | stream type |
| [in] | buffer | buffer as GrowableBuffer pointer |
| [in] | fpts | PTS of buffer (in sec) |
| [in] | fdts | DTS of buffer (in sec) |
| [in] | fDuration | duration of buffer (in sec) |
| [in] | initFragment | flag for buffer type (init, data) |
Implements StreamSink.
Definition at line 2814 of file aampgstplayer.cpp.
|
virtual |
Starts processing EOS for a particular stream type.
| [in] | type | stream type |
Reimplemented from StreamSink.
Definition at line 3027 of file aampgstplayer.cpp.
|
virtual |
Stop playback and any idle handlers active at the time.
| [in] | keepLastFrame | denotes if last video frame should be kept |
Reimplemented from StreamSink.
Definition at line 3072 of file aampgstplayer.cpp.
|
virtual |
To pause/play pipeline.
| [in] | pause | flag to pause/play the pipeline |
| [in] | forceStopGstreamerPreBuffering | - true for disabling bufferinprogress |
| true | if content successfully paused |
Reimplemented from StreamSink.
Definition at line 3669 of file aampgstplayer.cpp.
|
virtual |
Get playback position in MS.
| playback | position in MS |
Reimplemented from StreamSink.
Definition at line 3590 of file aampgstplayer.cpp.
|
virtual |
Get playback duration in MS.
| playback | duration in MS |
Reimplemented from StreamSink.
Definition at line 3545 of file aampgstplayer.cpp.
|
virtual |
Retrieve the video decoder handle from pipeline.
| the | decoder handle |
Reimplemented from StreamSink.
Definition at line 1926 of file aampgstplayer.cpp.
|
virtual |
Gets Video PTS.
| Video | PTS value |
Reimplemented from StreamSink.
Definition at line 4230 of file aampgstplayer.cpp.
|
virtual |
Set video display rectangle co-ordinates.
| [in] | x | x co-ordinate of display rectangle |
| [in] | y | y co-ordinate of display rectangle |
| [in] | w | width of display rectangle |
| [in] | h | height of display rectangle |
Reimplemented from StreamSink.
Definition at line 3738 of file aampgstplayer.cpp.
|
virtual |
Process discontinuity for a stream type.
| mediaType | Media stream type |
| true | if discontinuity processed |
Implements StreamSink.
Definition at line 4159 of file aampgstplayer.cpp.
|
virtual |
Set video zoom.
| [in] | zoom | zoom setting to be set |
Reimplemented from StreamSink.
Definition at line 3800 of file aampgstplayer.cpp.
|
virtual |
Set video mute.
| [in] | muted | true to mute video otherwise false |
Reimplemented from StreamSink.
Definition at line 3863 of file aampgstplayer.cpp.
|
virtual |
Set audio volume.
| [in] | volume | audio volume value (0-100) |
Reimplemented from StreamSink.
Definition at line 3890 of file aampgstplayer.cpp.
|
virtual |
| [in] | muted | true to mute subtitle otherwise false |
Reimplemented from StreamSink.
Definition at line 3844 of file aampgstplayer.cpp.
|
virtual |
| [in] | pts_offset | pts offset for subs |
Reimplemented from StreamSink.
Definition at line 3830 of file aampgstplayer.cpp.
| AAMPGstPlayer::setVolumeOrMuteUnMute | ( | void | ) |
Set audio volume or mute.
Definition at line 3902 of file aampgstplayer.cpp.
|
virtual |
Check if cache empty for a media type.
| [in] | mediaType | stream type |
| true | if cache empty |
Reimplemented from StreamSink.
Definition at line 4267 of file aampgstplayer.cpp.
|
virtual |
Check if PTS is changing.
| true | if PTS changed from lastKnown PTS or timeout hasn't expired, will optimistically return true^M^M if video-pts attribute is not available from decoder |
| [in] | timeout | - to check if PTS hasn't changed within a time duration |
Reimplemented from StreamSink.
Definition at line 4193 of file aampgstplayer.cpp.
|
virtual |
Get video display's width and height.
| [out] | w | width video width |
| [out] | h | height video height |
Reimplemented from StreamSink.
Definition at line 4349 of file aampgstplayer.cpp.
|
virtual |
Generate a protection event.
| [in] | protSystemId | keysystem to be used |
| [in] | ptr | initData DRM initialization data |
| [in] | len | initDataSize DRM initialization data size |
| [in] | type | Media type |
Reimplemented from StreamSink.
Definition at line 1955 of file aampgstplayer.cpp.
| AAMPGstPlayer::IdleTaskAdd | ( | TaskControlData & | taskDetails, |
| BackgroundTask | funcPtr | ||
| ) |
IdleTaskAdd - add an async/idle task in a thread safe manner, assuming it is not queued.
| [in] | taskDetails | task control data (e.g. id, pending flag and task name) |
| [in] | funcPtr | function pointer to add to the asynchronous queue task |
Definition at line 376 of file aampgstplayer.cpp.
| AAMPGstPlayer::IdleTaskRemove | ( | TaskControlData & | taskDetails | ) |
IdleTaskRemove - remove an async task in a thread safe manner, if it is queued.
| [in] | taskDetails | task control data (e.g. id, pending flag and task name) |
Definition at line 408 of file aampgstplayer.cpp.
| AAMPGstPlayer::IdleTaskClearFlags | ( | TaskControlData & | taskDetails | ) |
IdleTaskClearFlags - clear async task id and pending flag in a thread safe manner e.g. called when the task executes.
| [in] | taskDetails | task control data (e.g. id, pending flag and task name) |
Definition at line 433 of file aampgstplayer.cpp.
| AAMPGstPlayer::TimerAdd | ( | GSourceFunc | funcPtr, |
| int | repeatTimeout, | ||
| guint & | taskId, | ||
| gpointer | user_data, | ||
| const char * | timerName = nullptr |
||
| ) |
TimerAdd - add a new glib timer in thread safe manner.
| [in] | funcPtr | function to execute on timer expiry |
| [in] | repeatTimeout | timeout between calls in ms |
| [in] | user_data | data to pass to the timer function |
| [in] | timerName | name of the timer being added |
| [out] | taskId | id of the timer to be returned |
Definition at line 452 of file aampgstplayer.cpp.
| AAMPGstPlayer::TimerRemove | ( | guint & | taskId, |
| const char * | timerName = nullptr |
||
| ) |
TimerRemove - remove a glib timer in thread safe manner, if it exists.
| [in] | taskId | id of the timer to be removed |
| [in] | timerName | name of the timer being removed (for debug) (opt) |
Definition at line 478 of file aampgstplayer.cpp.
| AAMPGstPlayer::TimerIsRunning | ( | guint & | taskId | ) |
TimerIsRunning - Check whether timer is currently running.
| [in] | taskId | id of the timer to be removed |
Definition at line 497 of file aampgstplayer.cpp.
|
virtual |
Un-pause pipeline and notify buffer end event to player.
| [in] | forceStop | - true to force end buffering |
Reimplemented from StreamSink.
Definition at line 4598 of file aampgstplayer.cpp.
|
virtual |
adjust playback rate
| [in] | position | playback seek position |
| [in] | rate | playback rate |
Reimplemented from StreamSink.
Definition at line 4875 of file aampgstplayer.cpp.
|
virtual |
Set playback rate to audio/video sinks.
| [in] | rate | playback rate |
Reimplemented from StreamSink.
Definition at line 4761 of file aampgstplayer.cpp.
| AAMPGstPlayer::NotifyEOS | ( | ) |
Notify EOS to core aamp asynchronously if required.
Definition at line 4477 of file aampgstplayer.cpp.
| AAMPGstPlayer::NotifyFirstFrame | ( | MediaType | type | ) |
Notify first Audio and Video frame through an idle function to make the playersinkbin halding same as normal(playbin) playback.
| [in] | type | media type of the frame which is decoded, either audio or video. |
Definition at line 837 of file aampgstplayer.cpp.
| AAMPGstPlayer::DumpDiagnostics | ( | ) |
Dump diagnostic information.
Definition at line 4535 of file aampgstplayer.cpp.
|
virtual |
Signal trick mode discontinuity to gstreamer pipeline.
Reimplemented from StreamSink.
Definition at line 4551 of file aampgstplayer.cpp.
|
virtual |
Flush the data in case of a new tune pipeline.
| position | playback seek position |
| rate | play rate |
Reimplemented from StreamSink.
Definition at line 4576 of file aampgstplayer.cpp.
|
static |
| [in] | codecName | - name of the codec value |
Definition at line 4370 of file aampgstplayer.cpp.
|
private |
PauseAndFlush pipeline and flush.
| playAfterFlush | denotes if it should be set to playing at the end |
Definition at line 3488 of file aampgstplayer.cpp.
|
private |
Cleanup resources and flags for a particular stream type.
| [in] | mediaType | stream type |
Definition at line 2096 of file aampgstplayer.cpp.
|
private |
Flush the buffers in pipeline.
| [in] | position | playback seek position |
| [in] | rate | playback rate |
| [in] | shouldTearDown | flag indicates if pipeline should be destroyed if in invalid state |
Definition at line 3476 of file aampgstplayer.cpp.
|
private |
Flush last saved ID3 metadata.
|
private |
Wait for source element to be configured.
| [in] | mediaType | - source element for media type |
Definition at line 4674 of file aampgstplayer.cpp.
|
private |
Forward buffer to aux pipeline.
| [in] | buffer | - input buffer to be forwarded |
Definition at line 4714 of file aampgstplayer.cpp.
|
private |
Check if audio buffers to be forwarded or not.
Definition at line 4749 of file aampgstplayer.cpp.
| bool AAMPGstPlayer::PipelineSetToReady |
To indicate the pipeline is set to ready forcefully
Definition at line 337 of file aampgstplayer.h.
| bool AAMPGstPlayer::trickTeardown |
To indicate that the tear down is initiated in trick play
Definition at line 338 of file aampgstplayer.h.