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

The definition of the IWebAudioPlayer interface. More...

#include <IWebAudioPlayer.h>

Public Member Functions

 IWebAudioPlayer (const IWebAudioPlayer &)=delete
 
IWebAudioPlayeroperator= (const IWebAudioPlayer &)=delete
 
 IWebAudioPlayer (IWebAudioPlayer &&)=delete
 
IWebAudioPlayeroperator= (IWebAudioPlayer &&)=delete
 
virtual bool play ()=0
 Play the web audio. More...
 
virtual bool pause ()=0
 Pause the web audio. More...
 
virtual bool setEos ()=0
 Notify EOS. More...
 
virtual bool getBufferAvailable (uint32_t &availableFrames, std::shared_ptr< WebAudioShmInfo > &webAudioShmInfo)=0
 Get the available frames. More...
 
virtual bool getBufferDelay (uint32_t &delayFrames)=0
 Get the delay frames. More...
 
virtual bool writeBuffer (const uint32_t numberOfFrames, void *data)=0
 Write audio frames. More...
 
virtual bool getDeviceInfo (uint32_t &preferredFrames, uint32_t &maximumFrames, bool &supportDeferredPlay)=0
 Get device information. More...
 
virtual bool setVolume (double volume)=0
 Set level and transition of audio attenuation. More...
 
virtual bool getVolume (double &volume)=0
 Get current audio level. More...
 
virtual std::weak_ptr< IWebAudioPlayerClientgetClient ()=0
 Returns the web audio player client. More...
 

Detailed Description

The definition of the IWebAudioPlayer interface.

This interface defines the public API of Rialto for mixing PCM audio with current audio output. It should be implemented by both Rialto Client & Rialto Server.

Member Function Documentation

◆ getBufferAvailable()

virtual bool firebolt::rialto::IWebAudioPlayer::getBufferAvailable ( uint32_t &  availableFrames,
std::shared_ptr< WebAudioShmInfo > &  webAudioShmInfo 
)
pure virtual

Get the available frames.

Gets the available buffer space for sending more frames. Client should not write more than the number of frames returned by this API.

webAudioShmInfo is not required by the client application and can be ignored.

Parameters
[out]availableFrames: Number of frames available to be written.
[out]webAudioShmInfo: Location in shm to write the data (Server only).
Return values
trueon success.

◆ getBufferDelay()

virtual bool firebolt::rialto::IWebAudioPlayer::getBufferDelay ( uint32_t &  delayFrames)
pure virtual

Get the delay frames.

Gets the frame delay of the playback from Rialto. Frame delay is the number of frames left to play by the server.

Parameters
[out]delayFrames: Number of frames to be played.
Return values
trueon success.

◆ getClient()

virtual std::weak_ptr<IWebAudioPlayerClient> firebolt::rialto::IWebAudioPlayer::getClient ( )
pure virtual

Returns the web audio player client.

Return values
Theweb audio player client.

◆ getDeviceInfo()

virtual bool firebolt::rialto::IWebAudioPlayer::getDeviceInfo ( uint32_t &  preferredFrames,
uint32_t &  maximumFrames,
bool &  supportDeferredPlay 
)
pure virtual

Get device information.

Gets information for the web audio playback. This information is used to determine the preferred buffer size to commit, the maximum buffer size an application can commit and whether buffers can be committed before a Play request.

Parameters
[out]preferredFrames: preferred number of frames to be commited.
[out]maximumFrames: Maximum number of frames that can be commited.
[out]supportDeferredPlay: Whether defered play is supported.
Return values
trueon success.

◆ getVolume()

virtual bool firebolt::rialto::IWebAudioPlayer::getVolume ( double &  volume)
pure virtual

Get current audio level.

Fetches the current volume level for the pipeline.

Parameters
[out]volume: Current volume level (range 0.0 - 1.0)
Return values
trueon success false otherwise

◆ pause()

virtual bool firebolt::rialto::IWebAudioPlayer::pause ( )
pure virtual

Pause the web audio.

Sets the player to the PAUSED state (it is IDLE when created).

Return values
trueon success.

◆ play()

virtual bool firebolt::rialto::IWebAudioPlayer::play ( )
pure virtual

Play the web audio.

Sets the player to the PLAYING state (it is IDLE when created).

Return values
trueon success.

◆ setEos()

virtual bool firebolt::rialto::IWebAudioPlayer::setEos ( )
pure virtual

Notify EOS.

Notifies the player that no further frames will be provided. When all buffered frames are played the player will enter the EOS state.

Return values
trueon success.

◆ setVolume()

virtual bool firebolt::rialto::IWebAudioPlayer::setVolume ( double  volume)
pure virtual

Set level and transition of audio attenuation.

Sets the current volume for the pipeline (0.0 silent -> 1.0 full volume)

Parameters
[in]volume: Target volume level (0.0 - 1.0)
Return values
trueon success false otherwise

◆ writeBuffer()

virtual bool firebolt::rialto::IWebAudioPlayer::writeBuffer ( const uint32_t  numberOfFrames,
void *  data 
)
pure virtual

Write audio frames.

Sends a buffer of audio data for playback

Parameters
[in]numberOfFrames: Number of frames of audio in 'data'.
[in]data: Pointer to the data, byte length = numberOfFrames*sampleSize
Return values
trueon success.

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