|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
25 #ifndef AAMPGSTPLAYER_H
26 #define AAMPGSTPLAYER_H
49 TaskControlData(
const char* taskIdent) : taskID(0), taskIsPending(
false), taskName(taskIdent ? taskIdent :
"undefined") {};
78 bool SendHelper(
MediaType mediaType,
const void *ptr,
size_t len,
double fpts,
double fdts,
double duration,
bool copy,
bool initFragment = 0);
127 bool SendCopy(
MediaType mediaType,
const void *ptr,
size_t len,
double fpts,
double fdts,
double fDuration);
137 bool SendTransfer(
MediaType mediaType,
void *ptr,
size_t len,
double fpts,
double fdts,
double fDuration,
bool initFragment);
152 void Stop(
bool keepLastFrame);
163 void Flush(
double position,
int rate,
bool shouldTearDown);
170 bool Pause(
bool pause,
bool forceStopGstreamerPreBuffering);
303 void TimerAdd(GSourceFunc funcPtr,
int repeatTimeout, guint& taskId, gpointer user_data,
const char* timerName =
nullptr);
309 void TimerRemove(guint& taskId,
const char* timerName =
nullptr);
345 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
346 , std::function<
void(uint8_t *,
int,
int,
int) > exportFrames =
nullptr
378 #ifdef RENDER_FRAMES_IN_APP_CONTEXT
379 std::function< void(uint8_t *,
int,
int,
int) > cbExportYUVFrame;
386 static GstFlowReturn AAMPGstPlayer_OnVideoSample(GstElement*
object,
AAMPGstPlayer * _this);
426 static bool initialized;
456 pthread_mutex_t mBufferingLock;
457 pthread_mutex_t mProtectionLock;
461 #endif // AAMPGSTPLAYER_H
void NotifyFragmentCachingOngoing()
Set pipeline to PAUSED state to wait on NotifyFragmentCachingComplete()
void EndOfStreamReached(MediaType type)
Starts processing EOS for a particular stream type.
~AAMPGstPlayer()
AAMPGstPlayer Destructor.
StreamOutputFormat
Media output format.
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.
void NotifyEOS()
Notify EOS to core aamp asynchronously if required.
void QueueProtectionEvent(const char *protSystemId, const void *ptr, size_t len, MediaType type)
Generate a protection event.
bool CreatePipeline()
Create a new Gstreamer pipeline.
void DumpDiagnostics()
Dump diagnostic information.
bool WaitForSourceSetup(MediaType mediaType)
Wait for source element to be configured.
void IdleTaskClearFlags(TaskControlData &taskDetails)
IdleTaskClearFlags - clear async task id and pending flag in a thread safe manner e....
void TearDownStream(MediaType mediaType)
Cleanup resources and flags for a particular stream type.
void Stream(void)
To start playback.
void Configure(StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false)
Configure pipeline based on A/V formats.
Class declaration of Gstreamer based player.
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.
bool SendTransfer(MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment)
inject mp4 segment to gstreamer pipeline
bool TimerIsRunning(guint &taskId)
TimerIsRunning - Check whether timer is currently running.
void DumpStatus(void)
Log the various info related to playback.
void SetVideoMute(bool muted)
Set video mute.
long GetPositionMilliseconds(void)
Get playback position in MS.
unsigned long getCCDecoderHandle(void)
Retrieve the video decoder handle from pipeline.
long GetDurationMilliseconds(void)
Get playback duration in MS.
bool Pause(bool pause, bool forceStopGstreamerPreBuffering)
To pause/play pipeline.
void setVolumeOrMuteUnMute(void)
Set audio volume or mute.
void ForwardBuffersToAuxPipeline(GstBuffer *buffer)
Forward buffer to aux pipeline.
void SignalTrickModeDiscontinuity()
Signal trick mode discontinuity to gstreamer pipeline.
VideoZoomMode
Video zoom mode.
void SendGstEvents(MediaType mediaType, GstClockTime pts, const void *ptr, size_t len)
bool IdleTaskRemove(TaskControlData &taskDetails)
IdleTaskRemove - remove an async task in a thread safe manner, if it is queued.
bool Discontinuity(MediaType mediaType)
Process discontinuity for a stream type.
static bool IsCodecSupported(const std::string &codecName)
bool ForwardAudioBuffersToAux()
Check if audio buffers to be forwarded or not.
bool IdleTaskAdd(TaskControlData &taskDetails, BackgroundTask funcPtr)
IdleTaskAdd - add an async/idle task in a thread safe manner, assuming it is not queued.
void SetSubtitlePtsOffset(std::uint64_t pts_offset)
void TimerRemove(guint &taskId, const char *timerName=nullptr)
TimerRemove - remove a glib timer in thread safe manner, if it exists.
void NotifyFirstFrame(MediaType type)
Notify first Audio and Video frame through an idle function to make the playersinkbin halding same as...
void SetAudioVolume(int volume)
Set audio volume.
void SetVideoRectangle(int x, int y, int w, int h)
Set video display rectangle co-ordinates.
bool SetPlayBackRate(double rate)
Set playback rate to audio/video sinks.
Holds private variables of AAMPGstPlayer.
void ClearProtectionEvent()
Cleanup generated protection event.
virtual long long GetVideoPTS(void)
Gets Video PTS.
void SetVideoZoom(VideoZoomMode zoom)
Set video zoom.
Private functions and types used internally by AAMP.
AAMPGstPlayer(AampLogManager *logObj, PrivateInstanceAAMP *aamp)
AAMPGstPlayer Constructor.
void DestroyPipeline()
Cleanup an existing Gstreamer pipeline and associated resources.
GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin.
std::string GetVideoRectangle()
Get the video rectangle co-ordinates.
data for scheduling and handling asynchronous tasks
Class representing the AAMP player's private instance, which is not exposed to outside world.
void SendNewSegmentEvent(MediaType mediaType, GstClockTime startPts, GstClockTime stopPts=0)
Send new segment event to pipeline.
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
static void InitializeAAMPGstreamerPlugins(AampLogManager *logObj=NULL)
Increase the rank of AAMP decryptor plugins.
void Stop(bool keepLastFrame)
Stop playback and any idle handlers active at the time.
double RecalculatePTS(MediaType mediaType, const void *ptr, size_t len)
int(* BackgroundTask)(void *arg)
Function pointer for the idle task.
void ResetEOSSignalledFlag()
Reset EOS SignalledFlag.
void Flush(void)
Flush the buffers in pipeline.
void FlushLastId3Data()
Flush last saved ID3 metadata.
bool CheckForPTSChangeWithTimeout(long timeout)
Check if PTS is changing.
void SeekStreamSink(double position, double rate)
Flush the data in case of a new tune pipeline.
bool IsCacheEmpty(MediaType mediaType)
Check if cache empty for a media type.
void GetVideoSize(int &w, int &h)
Get video display's width and height.
void SetSubtitleMute(bool mute)
void NotifyFragmentCachingComplete()
Set pipeline to PLAYING state once fragment caching is complete.
void PauseAndFlush(bool playAfterFlush)
PauseAndFlush pipeline and flush.
bool AdjustPlayBackRate(double position, double rate)
adjust playback rate
void StopBuffering(bool forceStop)
Un-pause pipeline and notify buffer end event to player.