Rialto  0.1
Rialto media pipeline API
Public Member Functions | List of all members
firebolt::rialto::IMediaPipelineClient Class Referenceabstract

The Rialto media player client interface. More...

#include <IMediaPipelineClient.h>

Public Member Functions

virtual ~IMediaPipelineClient ()
 Virtual destructor.
 
virtual void notifyDuration (int64_t duration)=0
 Notifies the client of the total duration of the media. More...
 
virtual void notifyPosition (int64_t position)=0
 Notifies the client of the current playback position. More...
 
virtual void notifyNativeSize (uint32_t width, uint32_t height, double aspect=1.0)=0
 Notifies the client of the native size of the video and the pixel aspect ratio. More...
 
virtual void notifyNetworkState (NetworkState state)=0
 Notifies the client of the network state. More...
 
virtual void notifyPlaybackState (PlaybackState state)=0
 Notifies the client of the playback state. More...
 
virtual void notifyVideoData (bool hasData)=0
 Notifies the client that video data is available. More...
 
virtual void notifyAudioData (bool hasData)=0
 Notifies the client that audio data is available. More...
 
virtual void notifyNeedMediaData (int32_t sourceId, size_t frameCount, uint32_t needDataRequestId, const std::shared_ptr< MediaPlayerShmInfo > &shmInfo)=0
 Notifies the client that we need media data. More...
 
virtual void notifyCancelNeedMediaData (int32_t sourceId)=0
 Notifies the client to cancel any outstand need request. More...
 
virtual void notifyQos (int32_t sourceId, const QosInfo &qosInfo)=0
 Notifies the client of a Quality Of Service update from the Player. More...
 
virtual void notifyBufferUnderflow (int32_t sourceId)=0
 Notifies the client that buffer underflow occurred. More...
 
virtual void notifyPlaybackError (int32_t sourceId, PlaybackError error)=0
 Notifies the client that a non-fatal error has occurred in the player. More...
 
virtual void notifySourceFlushed (int32_t sourceId)=0
 Notifies the client that the source has been flushed. More...
 

Detailed Description

The Rialto media player client interface.

This is The Rialto media player client abstract base class. It should be implemented by any object that wishes to be notified by changes in the state of the player or that provides data for media playback.

Member Function Documentation

◆ notifyAudioData()

virtual void firebolt::rialto::IMediaPipelineClient::notifyAudioData ( bool  hasData)
pure virtual

Notifies the client that audio data is available.

Parameters
[in]hasDatatrue if audio data is available.

◆ notifyBufferUnderflow()

virtual void firebolt::rialto::IMediaPipelineClient::notifyBufferUnderflow ( int32_t  sourceId)
pure virtual

Notifies the client that buffer underflow occurred.

Notification shall be sent whenever a video/audio buffer underflow occurs

Parameters
[in]sourceId: The id of the source that produced the buffer underflow

◆ notifyCancelNeedMediaData()

virtual void firebolt::rialto::IMediaPipelineClient::notifyCancelNeedMediaData ( int32_t  sourceId)
pure virtual

Notifies the client to cancel any outstand need request.

This method notifies the client to cancel any data request made using notifyNeedMediaData(). It is not an error to cancel a request for data when one is not pending.

Parameters
[in]sourceId: The source id to cancel the request for.

◆ notifyDuration()

virtual void firebolt::rialto::IMediaPipelineClient::notifyDuration ( int64_t  duration)
pure virtual

Notifies the client of the total duration of the media.

This method notifies the client of the total duration of the media in nanoseconds. If this is unknown or undefined then a value of kDurationUnknown. If the stream is unending, for example live, then a value of kDurationUnending should be used.

Parameters
[in]duration: The duration of the media in seconds.

◆ notifyNativeSize()

virtual void firebolt::rialto::IMediaPipelineClient::notifyNativeSize ( uint32_t  width,
uint32_t  height,
double  aspect = 1.0 
)
pure virtual

Notifies the client of the native size of the video and the pixel aspect ratio.

This method should be called one or more times to reporting the native video size. If the video size changes the method should be called with the updated size or aspect ratio.

Parameters
[in]width: The width in pixels.
[in]height: The height in pixels.
[in]aspect: The pixel aspect ratio.

◆ notifyNeedMediaData()

virtual void firebolt::rialto::IMediaPipelineClient::notifyNeedMediaData ( int32_t  sourceId,
size_t  frameCount,
uint32_t  needDataRequestId,
const std::shared_ptr< MediaPlayerShmInfo > &  shmInfo 
)
pure virtual

Notifies the client that we need media data.

This method notifies the client that we need media data from the client. This is only used when Media Source Extensions are used. In that case media is read by JavaScript and buffered by the browser before being passed to this API for decoding.

You cannot request data if a data request is currently pending.

The frames the client sends should meet the criteria: numFramesSent <= frameCount numBytesSent <= maxMediaBytes

Parameters
[in]sourceId: The source to read data from.
[in]frameCount: The number of frames to read.
[in]needDataRequestId: Need data request id.
[in]shmInfo: Information for populating the shared memory (null if not applicable to the client).

◆ notifyNetworkState()

virtual void firebolt::rialto::IMediaPipelineClient::notifyNetworkState ( NetworkState  state)
pure virtual

Notifies the client of the network state.

The network state reflects the state of the network. For backend streaming, this is important as the backend uses the network to obtain the media data directly.

For streaming that uses the browser to obtain data, say Media Source Extensions playback, only the states NetworkState::IDLE, NetworkState::BUFFERED and NetworkState::DECODE_ERROR should be indicated by the backend.

Parameters
[in]state: The new network state.

◆ notifyPlaybackError()

virtual void firebolt::rialto::IMediaPipelineClient::notifyPlaybackError ( int32_t  sourceId,
PlaybackError  error 
)
pure virtual

Notifies the client that a non-fatal error has occurred in the player.

PlaybackState remains unchanged when an error occurs.

Parameters
[in]sourceId: The id of the source that produced the error.
[in]error: The type of error that occured.

◆ notifyPlaybackState()

virtual void firebolt::rialto::IMediaPipelineClient::notifyPlaybackState ( PlaybackState  state)
pure virtual

Notifies the client of the playback state.

The player will start IDLE. Once play() has been called the player will be PLAYING, or once pause() has been called the player will be PAUSED. A seek() request will result in SEEKING and once the seek is complete SEEK_DONE will be issued followed by PLAYING. The STOPPED state will be issued after a stop() request.

Parameters
[in]state: The new playback state.

◆ notifyPosition()

virtual void firebolt::rialto::IMediaPipelineClient::notifyPosition ( int64_t  position)
pure virtual

Notifies the client of the current playback position.

This method notifies the client of the current playback position in nanoseconds.

When playing this should be called often enough to provide sufficient granularity of position reporting. Typically this will be every 0.25s.

Parameters
[in]position: The playback position in nanoseconds.

◆ notifyQos()

virtual void firebolt::rialto::IMediaPipelineClient::notifyQos ( int32_t  sourceId,
const QosInfo qosInfo 
)
pure virtual

Notifies the client of a Quality Of Service update from the Player.

Notification shall be sent whenever a video/audio buffer drops a frame/sample.

Parameters
[in]sourceId: The id of the source that produced the Qos.
[in]qosInfo: The information provided in the update.

◆ notifySourceFlushed()

virtual void firebolt::rialto::IMediaPipelineClient::notifySourceFlushed ( int32_t  sourceId)
pure virtual

Notifies the client that the source has been flushed.

Notification shall be sent whenever a flush procedure is finished.

Parameters
[in]sourceId: The id of the source that has been flushed.

◆ notifyVideoData()

virtual void firebolt::rialto::IMediaPipelineClient::notifyVideoData ( bool  hasData)
pure virtual

Notifies the client that video data is available.

Parameters
[in]hasDatatrue if video data is available.

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