RDK Documentation (Open Sourced RDK Components)
StreamSink Class Referenceabstract

GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin. More...

#include <main_aamp.h>

Inheritance diagram for StreamSink:
Inheritance graph
Collaboration diagram for StreamSink:
Collaboration graph

Public Member Functions

virtual void Configure (StreamOutputFormat format, StreamOutputFormat audioFormat, StreamOutputFormat auxFormat, StreamOutputFormat subFormat, bool bESChangeStatus, bool forwardAudioToAux, bool setReadyAfterPipelineCreation=false)
 Configure output formats. More...
 
virtual bool SendCopy (MediaType mediaType, const void *ptr, size_t len, double fpts, double fdts, double fDuration)=0
 API to send audio/video buffer into the sink. More...
 
virtual bool SendTransfer (MediaType mediaType, void *ptr, size_t len, double fpts, double fdts, double fDuration, bool initFragment=false)=0
 API to send audio/video buffer into the sink. More...
 
virtual void EndOfStreamReached (MediaType mediaType)
 Notifies EOS to sink. More...
 
virtual void Stream (void)
 Start the stream. More...
 
virtual void Stop (bool keepLastFrame)
 
virtual void DumpStatus (void)
 Dump the sink status for debugging purpose. More...
 
virtual void Flush (double position=0, int rate=1, bool shouldTearDown=true)
 Flush the pipeline. More...
 
virtual bool SetPlayBackRate (double rate)
 Set player rate to audio/video sink. More...
 
virtual bool AdjustPlayBackRate (double position, double rate)
 Adjust the pipeline. More...
 
virtual bool Pause (bool pause, bool forceStopGstreamerPreBuffering)
 Enabled or disable playback pause. More...
 
virtual long GetDurationMilliseconds (void)
 Get playback duration in milliseconds. More...
 
virtual long GetPositionMilliseconds (void)
 Get playback position in milliseconds. More...
 
virtual long long GetVideoPTS (void)
 Get Video 90 KHz Video PTS. More...
 
virtual unsigned long getCCDecoderHandle (void)
 Get closed caption handle. More...
 
virtual void SetVideoRectangle (int x, int y, int w, int h)
 Set video display rectangle co-ordinates. More...
 
virtual void SetVideoZoom (VideoZoomMode zoom)
 Set video zoom state. More...
 
virtual void SetVideoMute (bool muted)
 Set video mute state. More...
 
virtual void SetSubtitleMute (bool muted)
 Set subtitle mute state. More...
 
virtual void SetSubtitlePtsOffset (std::uint64_t pts_offset)
 Set subtitle pts offset in sink. More...
 
virtual void SetAudioVolume (int volume)
 Set volume level. More...
 
virtual ~StreamSink ()
 StreamSink Dtor.
 
virtual bool Discontinuity (MediaType mediaType)=0
 Process PTS discontinuity for a stream type. More...
 
virtual bool CheckForPTSChangeWithTimeout (long timeout)
 Check if PTS is changing. More...
 
virtual bool IsCacheEmpty (MediaType mediaType)
 Check whether cach is empty. More...
 
virtual void ResetEOSSignalledFlag ()
 Reset EOS SignalledFlag.
 
virtual void NotifyFragmentCachingComplete ()
 API to notify that fragment caching done. More...
 
virtual void NotifyFragmentCachingOngoing ()
 API to notify that fragment caching is ongoing. More...
 
virtual void GetVideoSize (int &w, int &h)
 Get the video dimensions. More...
 
virtual void QueueProtectionEvent (const char *protSystemId, const void *ptr, size_t len, MediaType type)
 Queue-up the protection event. More...
 
virtual void ClearProtectionEvent ()
 Clear the protection event. More...
 
virtual void SignalTrickModeDiscontinuity ()
 Signal discontinuity on trickmode if restamping is done by stream sink. More...
 
virtual void SeekStreamSink (double position, double rate)
 Seek stream sink to desired position and playback rate with a flushing seek. More...
 
virtual std::string GetVideoRectangle ()
 Get the video window co-ordinates. More...
 
virtual void StopBuffering (bool forceStop)
 Stop buffering in sink. More...
 

yes

GStreamer Abstraction class for the implementation of AAMPGstPlayer and gstaamp plugin.

Definition at line 385 of file main_aamp.h.

Member Function Documentation

◆ Configure()

virtual void StreamSink::Configure ( StreamOutputFormat  format,
StreamOutputFormat  audioFormat,
StreamOutputFormat  auxFormat,
StreamOutputFormat  subFormat,
bool  bESChangeStatus,
bool  forwardAudioToAux,
bool  setReadyAfterPipelineCreation = false 
)
inlinevirtual

Configure output formats.

Parameters
[in]format- Video output format.
[in]audioFormat- Audio output format.
[in]auxFormat- Aux audio output format.
[in]bESChangeStatus- Flag to keep force configure the pipeline value
[in]forwardAudioToAux- Flag denotes if audio buffers have to be forwarded to aux pipeline
[in]setReadyAfterPipelineCreation- Flag denotes if pipeline has to be reset to ready or not
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 400 of file main_aamp.h.

◆ SendCopy()

virtual bool StreamSink::SendCopy ( MediaType  mediaType,
const void *  ptr,
size_t  len,
double  fpts,
double  fdts,
double  fDuration 
)
pure virtual

API to send audio/video buffer into the sink.

Parameters
[in]mediaType- Type of the media.
[in]ptr- Pointer to the buffer; caller responsible of freeing memory
[in]len- Buffer length.
[in]fpts- Presentation Time Stamp.
[in]fdts- Decode Time Stamp
[in]fDuration- Buffer duration.
Returns
void

Implemented in AAMPGstPlayer.

◆ SendTransfer()

virtual bool StreamSink::SendTransfer ( MediaType  mediaType,
void *  ptr,
size_t  len,
double  fpts,
double  fdts,
double  fDuration,
bool  initFragment = false 
)
pure virtual

API to send audio/video buffer into the sink.

Parameters
[in]mediaType- Type of the media.
[in]buffer- Pointer to the GrowableBuffer; ownership is taken by the sink
[in]fpts- Presentation Time Stamp.
[in]fdts- Decode Time Stamp
[in]fDuration- Buffer duration.
[in]initFragment- flag for buffer type (init, data)
Returns
void

Implemented in AAMPGstPlayer.

◆ EndOfStreamReached()

virtual void StreamSink::EndOfStreamReached ( MediaType  mediaType)
inlinevirtual

Notifies EOS to sink.

Parameters
[in]mediaType- Media Type
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 434 of file main_aamp.h.

◆ Stream()

virtual void StreamSink::Stream ( void  )
inlinevirtual

Start the stream.

Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 441 of file main_aamp.h.

◆ Stop()

StreamSink::Stop ( bool  keepLastFrame)
inlinevirtual
Parameters
[in]keepLastFrame- Keep the last frame on screen (true/false)
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 449 of file main_aamp.h.

◆ DumpStatus()

virtual void StreamSink::DumpStatus ( void  )
inlinevirtual

Dump the sink status for debugging purpose.

Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 456 of file main_aamp.h.

◆ Flush()

virtual void StreamSink::Flush ( double  position = 0,
int  rate = 1,
bool  shouldTearDown = true 
)
inlinevirtual

Flush the pipeline.

Parameters
[in]position- playback position
[in]rate- Speed
[in]shouldTearDown- if pipeline is not in a valid state, tear down pipeline
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 466 of file main_aamp.h.

◆ SetPlayBackRate()

virtual bool StreamSink::SetPlayBackRate ( double  rate)
inlinevirtual

Set player rate to audio/video sink.

Parameters
[in]rate- Speed
Returns
true if player rate is set successfully

Reimplemented in AAMPGstPlayer.

Definition at line 474 of file main_aamp.h.

◆ AdjustPlayBackRate()

virtual bool StreamSink::AdjustPlayBackRate ( double  position,
double  rate 
)
inlinevirtual

Adjust the pipeline.

Parameters
[in]position- playback position
[in]rate- Speed
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 482 of file main_aamp.h.

◆ Pause()

virtual bool StreamSink::Pause ( bool  pause,
bool  forceStopGstreamerPreBuffering 
)
inlinevirtual

Enabled or disable playback pause.

Parameters
[in]pauseEnable/Disable
[in]forceStopGstreamerPreBuffering- true for disabling bufferinprogress
Returns
true if content successfully paused

Reimplemented in AAMPGstPlayer.

Definition at line 491 of file main_aamp.h.

◆ GetDurationMilliseconds()

virtual long StreamSink::GetDurationMilliseconds ( void  )
inlinevirtual

Get playback duration in milliseconds.

Returns
duration in ms.

Reimplemented in AAMPGstPlayer.

Definition at line 498 of file main_aamp.h.

◆ GetPositionMilliseconds()

virtual long StreamSink::GetPositionMilliseconds ( void  )
inlinevirtual

Get playback position in milliseconds.

Returns
Position in ms.

Reimplemented in AAMPGstPlayer.

Definition at line 505 of file main_aamp.h.

◆ GetVideoPTS()

virtual long long StreamSink::GetVideoPTS ( void  )
inlinevirtual

Get Video 90 KHz Video PTS.

Returns
video PTS

Reimplemented in AAMPGstPlayer.

Definition at line 512 of file main_aamp.h.

◆ getCCDecoderHandle()

virtual unsigned long StreamSink::getCCDecoderHandle ( void  )
inlinevirtual

Get closed caption handle.

Returns
Closed caption handle

Reimplemented in AAMPGstPlayer.

Definition at line 519 of file main_aamp.h.

◆ SetVideoRectangle()

virtual void StreamSink::SetVideoRectangle ( int  x,
int  y,
int  w,
int  h 
)
inlinevirtual

Set video display rectangle co-ordinates.

Parameters
[in]x- x position
[in]y- y position
[in]w- Width
[in]h- Height
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 530 of file main_aamp.h.

◆ SetVideoZoom()

virtual void StreamSink::SetVideoZoom ( VideoZoomMode  zoom)
inlinevirtual

Set video zoom state.

Parameters
[in]zoom- Zoom mode
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 538 of file main_aamp.h.

◆ SetVideoMute()

virtual void StreamSink::SetVideoMute ( bool  muted)
inlinevirtual

Set video mute state.

Parameters
[in]muted- true: video muted, false: video unmuted
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 546 of file main_aamp.h.

◆ SetSubtitleMute()

virtual void StreamSink::SetSubtitleMute ( bool  muted)
inlinevirtual

Set subtitle mute state.

Parameters
[in]muted- true: subtitle muted, false: subtitle unmuted
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 554 of file main_aamp.h.

◆ SetSubtitlePtsOffset()

virtual void StreamSink::SetSubtitlePtsOffset ( std::uint64_t  pts_offset)
inlinevirtual

Set subtitle pts offset in sink.

Parameters
[in]pts_offset- pts offset for subs display
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 562 of file main_aamp.h.

◆ SetAudioVolume()

virtual void StreamSink::SetAudioVolume ( int  volume)
inlinevirtual

Set volume level.

Parameters
[in]volume- Minimum 0, maximum 100.
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 570 of file main_aamp.h.

◆ Discontinuity()

virtual bool StreamSink::Discontinuity ( MediaType  mediaType)
pure virtual

Process PTS discontinuity for a stream type.

Parameters
[in]mediaType- Media Type
Returns
TRUE if discontinuity processed

Implemented in AAMPGstPlayer.

◆ CheckForPTSChangeWithTimeout()

virtual bool StreamSink::CheckForPTSChangeWithTimeout ( long  timeout)
inlinevirtual

Check if PTS is changing.

Parameters
[in]timeout- max time period within which PTS hasn't changed
Return values
trueif PTS is changing, false if PTS hasn't changed for timeout msecs

Reimplemented in AAMPGstPlayer.

Definition at line 592 of file main_aamp.h.

◆ IsCacheEmpty()

virtual bool StreamSink::IsCacheEmpty ( MediaType  mediaType)
inlinevirtual

Check whether cach is empty.

Parameters
[in]mediaType- Media Type
Returns
true: empty, false: not empty

Reimplemented in AAMPGstPlayer.

Definition at line 600 of file main_aamp.h.

◆ NotifyFragmentCachingComplete()

virtual void StreamSink::NotifyFragmentCachingComplete ( )
inlinevirtual

API to notify that fragment caching done.

Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 612 of file main_aamp.h.

◆ NotifyFragmentCachingOngoing()

virtual void StreamSink::NotifyFragmentCachingOngoing ( )
inlinevirtual

API to notify that fragment caching is ongoing.

Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 619 of file main_aamp.h.

◆ GetVideoSize()

virtual void StreamSink::GetVideoSize ( int &  w,
int &  h 
)
inlinevirtual

Get the video dimensions.

Parameters
[out]w- Width
[out]h- Height
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 628 of file main_aamp.h.

◆ QueueProtectionEvent()

virtual void StreamSink::QueueProtectionEvent ( const char *  protSystemId,
const void *  ptr,
size_t  len,
MediaType  type 
)
inlinevirtual

Queue-up the protection event.

Parameters
[in]protSystemId- DRM system ID.
[in]ptr- Pointer to the protection data.
[in]len- Length of the protection data.
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 638 of file main_aamp.h.

◆ ClearProtectionEvent()

virtual void StreamSink::ClearProtectionEvent ( )
inlinevirtual

Clear the protection event.

Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 645 of file main_aamp.h.

◆ SignalTrickModeDiscontinuity()

virtual void StreamSink::SignalTrickModeDiscontinuity ( )
inlinevirtual

Signal discontinuity on trickmode if restamping is done by stream sink.

Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 652 of file main_aamp.h.

◆ SeekStreamSink()

virtual void StreamSink::SeekStreamSink ( double  position,
double  rate 
)
inlinevirtual

Seek stream sink to desired position and playback rate with a flushing seek.

Parameters
[in]position- desired playback position.
[in]rate- desired playback rate.
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 661 of file main_aamp.h.

◆ GetVideoRectangle()

virtual std::string StreamSink::GetVideoRectangle ( )
inlinevirtual

Get the video window co-ordinates.

Returns
current video co-ordinates in x,y,w,h format

Reimplemented in AAMPGstPlayer.

Definition at line 668 of file main_aamp.h.

◆ StopBuffering()

virtual void StreamSink::StopBuffering ( bool  forceStop)
inlinevirtual

Stop buffering in sink.

Parameters
[in]forceStop- true if buffering to be stopped without any checks
Returns
void

Reimplemented in AAMPGstPlayer.

Definition at line 676 of file main_aamp.h.


The documentation for this class was generated from the following file: