RDK Documentation (Open Sourced RDK Components)
aampgstplayer.cpp File Reference

Gstreamer based player impl for AAMP. More...

#include "AampMemoryUtils.h"
#include "aampgstplayer.h"
#include "AampFnLogger.h"
#include "isobmffbuffer.h"
#include "AampUtils.h"
#include "AampGstUtils.h"
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "priv_aamp.h"
#include <pthread.h>
#include <atomic>
Include dependency graph for aampgstplayer.cpp:

Go to the source code of this file.

Data Structures

struct  media_stream
 Holds stream(Audio, Video, Subtitle and Aux-Audio) specific variables. More...
 
struct  AAMPGstPlayerPriv
 Holds private variables of AAMPGstPlayer. More...
 

Macros

#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX   5
 
#define GSTPLAYERSINKBIN_EVENT_HAVE_VIDEO   0x01
 
#define GSTPLAYERSINKBIN_EVENT_HAVE_AUDIO   0x02
 
#define GSTPLAYERSINKBIN_EVENT_FIRST_VIDEO_FRAME   0x03
 
#define GSTPLAYERSINKBIN_EVENT_FIRST_AUDIO_FRAME   0x04
 
#define GSTPLAYERSINKBIN_EVENT_ERROR_VIDEO_UNDERFLOW   0x06
 
#define GSTPLAYERSINKBIN_EVENT_ERROR_AUDIO_UNDERFLOW   0x07
 
#define GSTPLAYERSINKBIN_EVENT_ERROR_VIDEO_PTS   0x08
 
#define GSTPLAYERSINKBIN_EVENT_ERROR_AUDIO_PTS   0x09
 
#define DEFAULT_BUFFERING_TO_MS   10
 
#define DEFAULT_BUFFERING_QUEUED_FRAMES_MIN   (5)
 
#define DEFAULT_BUFFERING_MAX_MS   (1000)
 
#define DEFAULT_BUFFERING_MAX_CNT   (DEFAULT_BUFFERING_MAX_MS/DEFAULT_BUFFERING_TO_MS)
 
#define AAMP_MIN_PTS_UPDATE_INTERVAL   4000
 
#define AAMP_DELAY_BETWEEN_PTS_CHECK_FOR_EOS_ON_UNDERFLOW   500
 
#define BUFFERING_TIMEOUT_PRIORITY   -70
 
#define AAMP_MIN_DECODE_ERROR_INTERVAL   10000
 
#define VIDEO_COORDINATES_SIZE   32
 

Enumerations

enum  GstPlayFlags
 Enum of configuration flags used by playbin. More...
 

gmapDecoderLoookUptable

Decoder map list lookup table convert from codec to string map list of gstreamer component.

#define PLUGINS_TO_LOWER_RANK_MAX   2
 
#define NO_PLAYBIN   1
 
#define ID3_HEADER_SIZE   10
 
static std::map< std::string, std::vector< std::string > > gmapDecoderLoookUptable
 
static const char * GstPluginNamePR = "aampplayreadydecryptor"
 
static const char * GstPluginNameWV = "aampwidevinedecryptor"
 
static const char * GstPluginNameCK = "aampclearkeydecryptor"
 
static const char * GstPluginNameVMX = "aampverimatrixdecryptor"
 
const char * plugins_to_lower_rank [2]
 
static gboolean bus_message (GstBus *bus, GstMessage *msg, AAMPGstPlayer *_this)
 Called from the mainloop when a message is available on the bus. More...
 
static GstBusSyncReply bus_sync_handler (GstBus *bus, GstMessage *msg, AAMPGstPlayer *_this)
 Invoked synchronously when a message is available on the bus. More...
 
static gboolean buffering_timeout (gpointer data)
 g_timeout callback to wait for buffering to change pipeline from paused->playing
 
static void type_check_instance (const char *str, GstElement *elem)
 check if elemement is instance (BCOM-3563)
 
static GstStateChangeReturn SetStateWithWarnings (GstElement *element, GstState targetState)
 wraps gst_element_set_state and adds log messages where applicable More...
 
static void analyze_streams (AAMPGstPlayer *_this)
 Analyze stream info from the GstPipeline. More...
 
static void need_data (GstElement *source, guint size, AAMPGstPlayer *_this)
 Callback for appsrc "need-data" signal. More...
 
static void enough_data (GstElement *source, AAMPGstPlayer *_this)
 Callback for appsrc "enough-data" signal. More...
 
static gboolean appsrc_seek (GstAppSrc *src, guint64 offset, AAMPGstPlayer *_this)
 Callback for appsrc "seek-data" signal. More...
 
static void InitializeSource (AAMPGstPlayer *_this, GObject *source, MediaType mediaType=eMEDIATYPE_VIDEO)
 Initialize properties/callback of appsrc. More...
 
static void found_source (GObject *object, GObject *orig, GParamSpec *pspec, AAMPGstPlayer *_this)
 Callback when source is added by playbin. More...
 
static void httpsoup_source_setup (GstElement *element, GstElement *source, gpointer data)
 callback when the source has been created More...
 
static gboolean IdleCallbackOnFirstFrame (gpointer user_data)
 Idle callback to notify first frame rendered event. More...
 
static gboolean IdleCallbackOnEOS (gpointer user_data)
 Idle callback to notify end-of-stream event. More...
 
static gboolean ProgressCallbackOnTimeout (gpointer user_data)
 Timer's callback to notify playback progress event. More...
 
static gboolean IdleCallback (gpointer user_data)
 Idle callback to start progress notifier timer. More...
 
static gboolean IdleCallbackFirstVideoFrameDisplayed (gpointer user_data)
 Idle callback to notify first video frame was displayed. More...
 
static void AAMPGstPlayer_OnFirstVideoFrameCallback (GstElement *object, guint arg0, gpointer arg1, AAMPGstPlayer *_this)
 Callback invoked after first video frame decoded. More...
 
static void AAMPGstPlayer_redButtonCallback (GstElement *object, guint hours, guint minutes, guint seconds, gpointer user_data)
 Callback invoked after receiving the SEI Time Code information. More...
 
static void AAMPGstPlayer_OnAudioFirstFrameAudDecoder (GstElement *object, guint arg0, gpointer arg1, AAMPGstPlayer *_this)
 Callback invoked after first audio buffer decoded. More...
 
bool AAMPGstPlayer_isVideoDecoder (const char *name, AAMPGstPlayer *_this)
 Check if gstreamer element is video decoder. More...
 
bool AAMPGstPlayer_isVideoSink (const char *name, AAMPGstPlayer *_this)
 Check if gstreamer element is video sink. More...
 
bool AAMPGstPlayer_isAudioSinkOrAudioDecoder (const char *name, AAMPGstPlayer *_this)
 Check if gstreamer element is audio sink or audio decoder. More...
 
bool AAMPGstPlayer_isVideoOrAudioDecoder (const char *name, AAMPGstPlayer *_this)
 Check if gstreamer element is audio decoder. More...
 
static gboolean VideoDecoderPtsCheckerForEOS (gpointer user_data)
 Notifies EOS if video decoder pts is stalled. More...
 
static void AAMPGstPlayer_OnGstBufferUnderflowCb (GstElement *object, guint arg0, gpointer arg1, AAMPGstPlayer *_this)
 Callback invoked when facing an underflow. More...
 
static void AAMPGstPlayer_OnGstPtsErrorCb (GstElement *object, guint arg0, gpointer arg1, AAMPGstPlayer *_this)
 Callback invoked a PTS error is encountered. More...
 
static void AAMPGstPlayer_OnGstDecodeErrorCb (GstElement *object, guint arg0, gpointer arg1, AAMPGstPlayer *_this)
 Callback invoked a Decode error is encountered. More...
 
static void AAMPGstPlayer_PlayersinkbinCB (GstElement *playersinkbin, gint status, void *arg)
 Callback for receiving playersinkbin gstreamer events. More...
 
static GstElement * AAMPGstPlayer_GetAppSrc (AAMPGstPlayer *_this, MediaType mediaType)
 Create an appsrc element for a particular format. More...
 
static int AAMPGstPlayer_SetupStream (AAMPGstPlayer *_this, MediaType streamId)
 Setup pipeline for a particular stream type. More...
 
bool hasId3Header (MediaType mediaType, const uint8_t *data, int32_t length)
 
uint32_t getId3TagSize (const uint8_t *data)
 
static void AAMPGstPlayer_SignalEOS (GstElement *source)
 
static std::string StateText (GstState state, char start, char end, GstState currentState, GstState parentState=GST_STATE_VOID_PENDING)
 Generates a state description for gst target, next and pending state i.e. not current state. More...
 
static std::string SafeName (GstElement *element)
 wraps gst_element_get_name handling unnamed elements and resource freeing More...
 
static std::string GetStatus (gpointer pElementOrBin, int &recursionCount, gpointer pParent=nullptr)
 
  • returns a string describing pElementOrBin and its children (if any). The top level elements name:state are shown along with any child elements in () separated by , State information is displayed as GST_STATE[GST_STATE_TARGET]{GST_STATE_NEXT}<GST_STATE_PENDING> Target state, next state and pending state are not always shown. Where GST_STATE_CHANGE for the element is not GST_STATE_CHANGE_SUCCESS an additional character is appended to the element name: GST_STATE_CHANGE_FAILURE: "!", GST_STATE_CHANGE_ASYNC:"~", GST_STATE_CHANGE_NO_PREROLL:"*"
More...
 
static void LogStatus (GstElement *pElementOrBin)
 
static GstState validateStateWithMsTimeout (AAMPGstPlayer *_this, GstState stateToValidate, guint msTimeOut)
 Validate pipeline state transition within a max timeout. More...
 
static void DumpFile (const char *fileName)
 Dump a file to log.
 

yes

Gstreamer based player impl for AAMP.

Definition in file aampgstplayer.cpp.

Macro Definition Documentation

◆ DEFAULT_BUFFERING_TO_MS

#define DEFAULT_BUFFERING_TO_MS   10

TimeOut interval to check buffer fullness

Definition at line 86 of file aampgstplayer.cpp.

◆ DEFAULT_BUFFERING_QUEUED_FRAMES_MIN

#define DEFAULT_BUFFERING_QUEUED_FRAMES_MIN   (5)

if the video decoder has this many queued frames start.. even at 60fps, close to 100ms...

Definition at line 91 of file aampgstplayer.cpp.

◆ DEFAULT_BUFFERING_MAX_MS

#define DEFAULT_BUFFERING_MAX_MS   (1000)

max buffering time

Definition at line 94 of file aampgstplayer.cpp.

◆ DEFAULT_BUFFERING_MAX_CNT

#define DEFAULT_BUFFERING_MAX_CNT   (DEFAULT_BUFFERING_MAX_MS/DEFAULT_BUFFERING_TO_MS)

max buffering timeout count

Definition at line 95 of file aampgstplayer.cpp.

◆ AAMP_MIN_PTS_UPDATE_INTERVAL

#define AAMP_MIN_PTS_UPDATE_INTERVAL   4000

Time duration in milliseconds if exceeded and pts has not changed; it is concluded pts is not changing

Definition at line 96 of file aampgstplayer.cpp.

◆ AAMP_DELAY_BETWEEN_PTS_CHECK_FOR_EOS_ON_UNDERFLOW

#define AAMP_DELAY_BETWEEN_PTS_CHECK_FOR_EOS_ON_UNDERFLOW   500

A timeout interval in milliseconds to check pts in case of underflow

Definition at line 97 of file aampgstplayer.cpp.

◆ BUFFERING_TIMEOUT_PRIORITY

#define BUFFERING_TIMEOUT_PRIORITY   -70

0 is DEFAULT priority whereas -100 is the HIGH_PRIORITY

Definition at line 98 of file aampgstplayer.cpp.

◆ AAMP_MIN_DECODE_ERROR_INTERVAL

#define AAMP_MIN_DECODE_ERROR_INTERVAL   10000

Minimum time interval in milliseconds between two decoder error CB to send anomaly error

Definition at line 99 of file aampgstplayer.cpp.

◆ PLUGINS_TO_LOWER_RANK_MAX

#define PLUGINS_TO_LOWER_RANK_MAX   2

Header size for ID3v2 header

Definition at line 319 of file aampgstplayer.cpp.

◆ NO_PLAYBIN

#define NO_PLAYBIN   1

Header size for ID3v2 header

Definition at line 2172 of file aampgstplayer.cpp.

◆ ID3_HEADER_SIZE

#define ID3_HEADER_SIZE   10

Header size for ID3v2 header

Definition at line 2561 of file aampgstplayer.cpp.

Enumeration Type Documentation

◆ GstPlayFlags

Enum of configuration flags used by playbin.

Enumerator
GST_PLAY_FLAG_VIDEO 

value is 0x001

GST_PLAY_FLAG_AUDIO 

value is 0x002

GST_PLAY_FLAG_TEXT 

value is 0x004

GST_PLAY_FLAG_VIS 

value is 0x008

GST_PLAY_FLAG_SOFT_VOLUME 

value is 0x010

GST_PLAY_FLAG_NATIVE_AUDIO 

value is 0x020

GST_PLAY_FLAG_NATIVE_VIDEO 

value is 0x040

GST_PLAY_FLAG_DOWNLOAD 

value is 0x080

GST_PLAY_FLAG_BUFFERING 

value is 0x100

GST_PLAY_FLAG_DEINTERLACE 

value is 0x200

GST_PLAY_FLAG_SOFT_COLORBALANCE 

value is 0x400

Definition at line 55 of file aampgstplayer.cpp.

Function Documentation

◆ bus_message()

static gboolean bus_message ( GstBus *  bus,
GstMessage *  msg,
AAMPGstPlayer _this 
)
static

Called from the mainloop when a message is available on the bus.

Parameters
[in]busthe GstBus that sent the message
[in]msgthe GstMessage
[in]_thispointer to AAMPGstPlayer instance
Return values
FALSEif the event source should be removed.

Definition at line 1302 of file aampgstplayer.cpp.

◆ bus_sync_handler()

static GstBusSyncReply bus_sync_handler ( GstBus *  bus,
GstMessage *  msg,
AAMPGstPlayer _this 
)
static

Invoked synchronously when a message is available on the bus.

Parameters
[in]busthe GstBus that sent the message
[in]msgthe GstMessage
[in]_thispointer to AAMPGstPlayer instance
Return values
GST_BUS_PASSto pass the message to the async queue

Definition at line 1566 of file aampgstplayer.cpp.

◆ SetStateWithWarnings()

static GstStateChangeReturn SetStateWithWarnings ( GstElement *  element,
GstState  targetState 
)
static

wraps gst_element_set_state and adds log messages where applicable

Parameters
[in]elementthe GstElement whose state is to be changed
[in]targetStatethe GstState to apply to element
[in]_thispointer to AAMPGstPlayer instance
Return values
Resultof the state change (from inner gst_element_set_state())

Definition at line 3423 of file aampgstplayer.cpp.

◆ analyze_streams()

static void analyze_streams ( AAMPGstPlayer _this)
static

Analyze stream info from the GstPipeline.

Parameters
[in]_thispointer to AAMPGstPlayer instance

Definition at line 509 of file aampgstplayer.cpp.

◆ need_data()

static void need_data ( GstElement *  source,
guint  size,
AAMPGstPlayer _this 
)
static

Callback for appsrc "need-data" signal.

Parameters
[in]sourcepointer to appsrc instance triggering "need-data" signal
[in]sizesize of data required
[in]_thispointer to AAMPGstPlayer instance associated with the playback

Definition at line 552 of file aampgstplayer.cpp.

◆ enough_data()

static void enough_data ( GstElement *  source,
AAMPGstPlayer _this 
)
static

Callback for appsrc "enough-data" signal.

Parameters
[in]sourcepointer to appsrc instance triggering "enough-data" signal
[in]_thispointer to AAMPGstPlayer instance associated with the playback

Definition at line 578 of file aampgstplayer.cpp.

◆ appsrc_seek()

static gboolean appsrc_seek ( GstAppSrc *  src,
guint64  offset,
AAMPGstPlayer _this 
)
static

Callback for appsrc "seek-data" signal.

Parameters
[in]srcpointer to appsrc instance triggering "seek-data" signal
[in]offsetseek position offset
[in]_thispointer to AAMPGstPlayer instance associated with the playback

Definition at line 608 of file aampgstplayer.cpp.

◆ InitializeSource()

static void InitializeSource ( AAMPGstPlayer _this,
GObject *  source,
MediaType  mediaType = eMEDIATYPE_VIDEO 
)
static

Initialize properties/callback of appsrc.

Parameters
[in]_thispointer to AAMPGstPlayer instance associated with the playback
[in]sourcepointer to appsrc instance to be initialized
[in]mediaTypestream type

Definition at line 623 of file aampgstplayer.cpp.

◆ found_source()

static void found_source ( GObject *  object,
GObject *  orig,
GParamSpec *  pspec,
AAMPGstPlayer _this 
)
static

Callback when source is added by playbin.

Parameters
[in]objecta GstObject
[in]origthe object that originated the signal
[in]pspecthe property that changed
[in]_thispointer to AAMPGstPlayer instance associated with the playback

Definition at line 672 of file aampgstplayer.cpp.

◆ httpsoup_source_setup()

static void httpsoup_source_setup ( GstElement *  element,
GstElement *  source,
gpointer  data 
)
static

callback when the source has been created

Parameters
[in]elementis the pipeline
[in]sourcethe creation of source triggered this callback
[in]datapointer to data associated with the playback

Definition at line 714 of file aampgstplayer.cpp.

◆ IdleCallbackOnFirstFrame()

static gboolean IdleCallbackOnFirstFrame ( gpointer  user_data)
static

Idle callback to notify first frame rendered event.

Parameters
[in]user_datapointer to AAMPGstPlayer instance
Return values
G_SOURCE_REMOVE,ifthe source should be removed

Definition at line 735 of file aampgstplayer.cpp.

◆ IdleCallbackOnEOS()

static gboolean IdleCallbackOnEOS ( gpointer  user_data)
static

Idle callback to notify end-of-stream event.

Parameters
[in]user_datapointer to AAMPGstPlayer instance
Return values
G_SOURCE_REMOVE,ifthe source should be removed

Definition at line 753 of file aampgstplayer.cpp.

◆ ProgressCallbackOnTimeout()

static gboolean ProgressCallbackOnTimeout ( gpointer  user_data)
static

Timer's callback to notify playback progress event.

Parameters
[in]user_datapointer to AAMPGstPlayer instance
Return values
G_SOURCE_CONTINUE,thisfunction to be called periodically

Definition at line 773 of file aampgstplayer.cpp.

◆ IdleCallback()

static gboolean IdleCallback ( gpointer  user_data)
static

Idle callback to start progress notifier timer.

Parameters
[in]user_datapointer to AAMPGstPlayer instance
Return values
G_SOURCE_REMOVE,ifthe source should be removed

Definition at line 790 of file aampgstplayer.cpp.

◆ IdleCallbackFirstVideoFrameDisplayed()

static gboolean IdleCallbackFirstVideoFrameDisplayed ( gpointer  user_data)
static

Idle callback to notify first video frame was displayed.

Parameters
[in]user_datapointer to AAMPGstPlayer instance
Return values
G_SOURCE_REMOVE,ifthe source should be removed

Definition at line 822 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_OnFirstVideoFrameCallback()

static void AAMPGstPlayer_OnFirstVideoFrameCallback ( GstElement *  object,
guint  arg0,
gpointer  arg1,
AAMPGstPlayer _this 
)
static

Callback invoked after first video frame decoded.

Parameters
[in]objectpointer to element raising the callback
[in]arg0number of arguments
[in]arg1array of arguments
[in]_thispointer to AAMPGstPlayer instance

Definition at line 921 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_redButtonCallback()

static void AAMPGstPlayer_redButtonCallback ( GstElement *  object,
guint  hours,
guint  minutes,
guint  seconds,
gpointer  user_data 
)
static

Callback invoked after receiving the SEI Time Code information.

Parameters
[in]objectpointer to element raising the callback
[in]hoursHour value of the SEI Timecode
[in]minutesMinute value of the SEI Timecode
[in]secondsSecond value of the SEI Timecode
[in]user_datapointer to AAMPGstPlayer instance

Definition at line 938 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_OnAudioFirstFrameAudDecoder()

static void AAMPGstPlayer_OnAudioFirstFrameAudDecoder ( GstElement *  object,
guint  arg0,
gpointer  arg1,
AAMPGstPlayer _this 
)
static

Callback invoked after first audio buffer decoded.

Parameters
[in]objectpointer to element raising the callback
[in]arg0number of arguments
[in]arg1array of arguments
[in]_thispointer to AAMPGstPlayer instance

Definition at line 956 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_isVideoDecoder()

bool AAMPGstPlayer_isVideoDecoder ( const char *  name,
AAMPGstPlayer _this 
)

Check if gstreamer element is video decoder.

Parameters
[in]nameName of the element
[in]_thispointer to AAMPGstPlayer instance
Return values
TRUEif element name is that of the decoder

Definition at line 969 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_isVideoSink()

bool AAMPGstPlayer_isVideoSink ( const char *  name,
AAMPGstPlayer _this 
)

Check if gstreamer element is video sink.

Parameters
[in]nameName of the element
[in]_thispointer to AAMPGstPlayer instance
Return values
TRUEif element name is that of video sink

Definition at line 985 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_isAudioSinkOrAudioDecoder()

bool AAMPGstPlayer_isAudioSinkOrAudioDecoder ( const char *  name,
AAMPGstPlayer _this 
)

Check if gstreamer element is audio sink or audio decoder.

Parameters
[in]nameName of the element
[in]_thispointer to AAMPGstPlayer instance
Return values
TRUEif element name is that of audio sink or audio decoder

Definition at line 1001 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_isVideoOrAudioDecoder()

bool AAMPGstPlayer_isVideoOrAudioDecoder ( const char *  name,
AAMPGstPlayer _this 
)

Check if gstreamer element is audio decoder.

Parameters
[in]nameName of the element
[in]_thispointer to AAMPGstPlayer instance
Return values
TRUEif element name is that of audio or video decoder

Definition at line 1018 of file aampgstplayer.cpp.

◆ VideoDecoderPtsCheckerForEOS()

static gboolean VideoDecoderPtsCheckerForEOS ( gpointer  user_data)
static

Notifies EOS if video decoder pts is stalled.

Parameters
[in]user_datapointer to AAMPGstPlayer instance
Return values
G_SOURCE_REMOVE,ifthe source should be removed

Definition at line 1055 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_OnGstBufferUnderflowCb()

static void AAMPGstPlayer_OnGstBufferUnderflowCb ( GstElement *  object,
guint  arg0,
gpointer  arg1,
AAMPGstPlayer _this 
)
static

Callback invoked when facing an underflow.

Parameters
[in]objectpointer to element raising the callback
[in]arg0number of arguments
[in]arg1array of arguments
[in]_thispointer to AAMPGstPlayer instance

Definition at line 1136 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_OnGstPtsErrorCb()

static void AAMPGstPlayer_OnGstPtsErrorCb ( GstElement *  object,
guint  arg0,
gpointer  arg1,
AAMPGstPlayer _this 
)
static

Callback invoked a PTS error is encountered.

Parameters
[in]objectpointer to element raising the callback
[in]arg0number of arguments
[in]arg1array of arguments
[in]_thispointer to AAMPGstPlayer instance

Definition at line 1199 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_OnGstDecodeErrorCb()

static void AAMPGstPlayer_OnGstDecodeErrorCb ( GstElement *  object,
guint  arg0,
gpointer  arg1,
AAMPGstPlayer _this 
)
static

Callback invoked a Decode error is encountered.

Parameters
[in]objectpointer to element raising the callback
[in]arg0number of arguments
[in]arg1array of arguments
[in]_thispointer to AAMPGstPlayer instance

Definition at line 1224 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_PlayersinkbinCB()

static void AAMPGstPlayer_PlayersinkbinCB ( GstElement *  playersinkbin,
gint  status,
void *  arg 
)
static

Callback for receiving playersinkbin gstreamer events.

Parameters
[in]playersinkbininstance of playersinkbin
[in]statusevent name
[in]arguser data (pointer to AAMPGstPlayer instance)

Definition at line 2020 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_GetAppSrc()

static GstElement* AAMPGstPlayer_GetAppSrc ( AAMPGstPlayer _this,
MediaType  mediaType 
)
static

Create an appsrc element for a particular format.

Parameters
[in]_thispointer to AAMPGstPlayer instance
[in]mediaTypemedia type
Return values
pointerto appsrc instance

Definition at line 2068 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_SetupStream()

static int AAMPGstPlayer_SetupStream ( AAMPGstPlayer _this,
MediaType  streamId 
)
static

Setup pipeline for a particular stream type.

Parameters
[in]_thispointer to AAMPGstPlayer instance
[in]streamIdstream type
Return values
0,ifsetup successfully. -1, for failure

Definition at line 2179 of file aampgstplayer.cpp.

◆ hasId3Header()

bool hasId3Header ( MediaType  mediaType,
const uint8_t *  data,
int32_t  length 
)

Header size for ID3v2 header

Definition at line 2545 of file aampgstplayer.cpp.

◆ getId3TagSize()

uint32_t getId3TagSize ( const uint8_t *  data)

Header size for ID3v2 header

Definition at line 2569 of file aampgstplayer.cpp.

◆ AAMPGstPlayer_SignalEOS()

static void AAMPGstPlayer_SignalEOS ( GstElement *  source)
static

Header size for ID3v2 header

Definition at line 3011 of file aampgstplayer.cpp.

◆ StateText()

static std::string StateText ( GstState  state,
char  start,
char  end,
GstState  currentState,
GstState  parentState = GST_STATE_VOID_PENDING 
)
static

Generates a state description for gst target, next and pending state i.e. not current state.

Parameters
[in]state- the state of the current element
[in]start- a char to place before the state text e.g. on open bracket
[in]end- a char to place after the state text e.g. a close bracket
[in]currentState- the current state from the same element as 'state'
[in]parentState- the state of the parent, if there is one
Returns
- "" unless state is 'interesting' otherwise start state description end e.g. {GST_STATE_READY}

Definition at line 3178 of file aampgstplayer.cpp.

◆ SafeName()

static std::string SafeName ( GstElement *  element)
static

wraps gst_element_get_name handling unnamed elements and resource freeing

Parameters
[in]elementa GstElement
Return values
Thename of element or "unnamed element" as a std::string

Definition at line 3198 of file aampgstplayer.cpp.

◆ GetStatus()

static std::string GetStatus ( gpointer  pElementOrBin,
int &  recursionCount,
gpointer  pParent = nullptr 
)
static

  • returns a string describing pElementOrBin and its children (if any). The top level elements name:state are shown along with any child elements in () separated by , State information is displayed as GST_STATE[GST_STATE_TARGET]{GST_STATE_NEXT}<GST_STATE_PENDING> Target state, next state and pending state are not always shown. Where GST_STATE_CHANGE for the element is not GST_STATE_CHANGE_SUCCESS an additional character is appended to the element name: GST_STATE_CHANGE_FAILURE: "!", GST_STATE_CHANGE_ASYNC:"~", GST_STATE_CHANGE_NO_PREROLL:"*"

Parameters
[in]pElementOrBin- pointer to a gst element or bin
[in]pParent- parent (optional)
recursionCount- variable shared with self calls to limit recursion depth
Returns
- description string

Definition at line 3226 of file aampgstplayer.cpp.

◆ LogStatus()

static void LogStatus ( GstElement *  pElementOrBin)
static

Header size for ID3v2 header

Definition at line 3317 of file aampgstplayer.cpp.

◆ validateStateWithMsTimeout()

static GstState validateStateWithMsTimeout ( AAMPGstPlayer _this,
GstState  stateToValidate,
guint  msTimeOut 
)
static

Validate pipeline state transition within a max timeout.

Parameters
[in]_thispointer to AAMPGstPlayer instance
[in]stateToValidatestate to be validated
[in]msTimeOutmax timeout in MS
Return values
Currentpipeline state

Definition at line 3389 of file aampgstplayer.cpp.

Variable Documentation

◆ gmapDecoderLoookUptable

std::map<std::string, std::vector<std::string> > gmapDecoderLoookUptable
static
Initial value:
=
{
{"ac-3", {"omxac3dec", "avdec_ac3", "avdec_ac3_fixed"}},
{"ac-4", {"omxac4dec"}}
}

Header size for ID3v2 header

Definition at line 109 of file aampgstplayer.cpp.

◆ GstPluginNamePR

const char* GstPluginNamePR = "aampplayreadydecryptor"
static

Header size for ID3v2 header

Definition at line 274 of file aampgstplayer.cpp.

◆ GstPluginNameWV

const char* GstPluginNameWV = "aampwidevinedecryptor"
static

Header size for ID3v2 header

Definition at line 275 of file aampgstplayer.cpp.

◆ GstPluginNameCK

const char* GstPluginNameCK = "aampclearkeydecryptor"
static

Header size for ID3v2 header

Definition at line 276 of file aampgstplayer.cpp.

◆ GstPluginNameVMX

const char* GstPluginNameVMX = "aampverimatrixdecryptor"
static

Header size for ID3v2 header

Definition at line 277 of file aampgstplayer.cpp.

◆ plugins_to_lower_rank

const char* plugins_to_lower_rank[2]
Initial value:
= {
"aacparse",
"ac3parse",
}

Header size for ID3v2 header

Definition at line 320 of file aampgstplayer.cpp.