kodi
Classes | Public Member Functions | Friends | List of all members
IAEStream Class Referenceabstract

IAEStream Stream Interface for streaming audio. More...

#include <AEStream.h>

Inheritance diagram for IAEStream:
Inheritance graph
[legend]

Classes

struct  ExtData
 

Public Member Functions

virtual unsigned int GetSpace ()=0
 Returns the amount of space available in the stream. More...
 
virtual unsigned int AddData (const uint8_t *const *data, unsigned int offset, unsigned int frames, ExtData *extData)=0
 Add planar or interleaved PCM data to the stream. More...
 
virtual double GetDelay ()=0
 Returns the time in seconds that it will take for the next added packet to be heard from the speakers. More...
 
virtual CAESyncInfo GetSyncInfo ()=0
 Returns info about audio to clock synchronization. More...
 
virtual bool IsBuffering ()=0
 Returns if the stream is buffering. More...
 
virtual double GetCacheTime ()=0
 Returns the time in seconds of the stream's cached audio samples. More...
 
virtual double GetCacheTotal ()=0
 Returns the total time in seconds of the cache. More...
 
virtual double GetMaxDelay ()=0
 Returns the total time in seconds of maximum delay. More...
 
virtual void Pause ()=0
 Pauses the stream playback.
 
virtual void Resume ()=0
 Resumes the stream after pausing.
 
virtual void Drain (bool wait)=0
 Start draining the stream. More...
 
virtual bool IsDraining ()=0
 Returns true if the is stream draining.
 
virtual bool IsDrained ()=0
 Returns true if the is stream has finished draining.
 
virtual void Flush ()=0
 Flush all buffers dropping the audio data.
 
virtual float GetVolume ()=0
 Return the stream's current volume level. More...
 
virtual void SetVolume (float volume)=0
 Set the stream's volume level. More...
 
virtual float GetReplayGain ()=0
 Returns the stream's current replay gain factor. More...
 
virtual void SetReplayGain (float factor)=0
 Sets the stream's replay gain factor, this is used by formats such as MP3 that have attenuation information in their streams. More...
 
virtual float GetAmplification ()=0
 Gets the stream's volume amplification in linear units. More...
 
virtual void SetAmplification (float amplify)=0
 Sets the stream's volume amplification in linear units. More...
 
virtual void SetFFmpegInfo (int profile, enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type)=0
 Sets the stream ffmpeg information if present. More...
 
virtual unsigned int GetFrameSize () const =0
 Returns the size of one audio frame in bytes (channelCount * resolution) More...
 
virtual unsigned int GetChannelCount () const =0
 Returns the number of channels the stream is configured to accept. More...
 
virtual unsigned int GetSampleRate () const =0
 Returns the stream's sample rate, if the stream is using a dynamic sample rate, this value will NOT reflect any changes made by calls to SetResampleRatio() More...
 
virtual enum AEDataFormat GetDataFormat () const =0
 Return the data format the stream has been configured with. More...
 
virtual double GetResampleRatio ()=0
 Return the resample ratio. More...
 
virtual void SetResampleRatio (double ratio)=0
 Sets the resample ratio. More...
 
virtual void SetResampleMode (int mode)=0
 Sets the resamplling on/ff.
 
virtual void RegisterAudioCallback (IAudioCallback *pCallback)=0
 Registers the audio callback to call with each block of data, this is used by Audio Visualizations. More...
 
virtual void UnRegisterAudioCallback ()=0
 Unregisters the current audio callback.
 
virtual void FadeVolume (float from, float target, unsigned int time)
 Fade the volume level over the specified time. More...
 
virtual bool IsFading ()
 Returns if a fade is still running. More...
 
virtual void RegisterSlave (IAEStream *stream)=0
 Slave a stream to resume when this stream has drained.
 

Friends

class IAE
 

Detailed Description

IAEStream Stream Interface for streaming audio.

Member Function Documentation

◆ AddData()

virtual unsigned int IAEStream::AddData ( const uint8_t *const *  data,
unsigned int  offset,
unsigned int  frames,
ExtData extData 
)
pure virtual

Add planar or interleaved PCM data to the stream.

Parameters
dataarray of pointers to the planes
offsetto frame in frames
framesnumber of frames
ptstimestamp
Returns
The number of frames consumed

Implemented in ActiveAE::CActiveAEStream.

◆ Drain()

virtual void IAEStream::Drain ( bool  wait)
pure virtual

Start draining the stream.

Note
Once called AddData will not consume more data.

Implemented in ActiveAE::CActiveAEStream.

◆ FadeVolume()

virtual void IAEStream::FadeVolume ( float  from,
float  target,
unsigned int  time 
)
inlinevirtual

Fade the volume level over the specified time.

Parameters
fromThe volume level to fade from (0.0f-1.0f) - See notes
targetThe volume level to fade to (0.0f-1.0f)
timeThe amount of time in milliseconds for the fade to occur
Note
The from parameter does not set the streams volume, it is only used to calculate the fade time properly

Reimplemented in ActiveAE::CActiveAEStream.

◆ GetAmplification()

virtual float IAEStream::GetAmplification ( )
pure virtual

Gets the stream's volume amplification in linear units.

Returns
The volume amplification factor between 1.0 and 1000.0

Implemented in ActiveAE::CActiveAEStream.

◆ GetCacheTime()

virtual double IAEStream::GetCacheTime ( )
pure virtual

Returns the time in seconds of the stream's cached audio samples.

Engine buffers excluded.

Returns
seconds

Implemented in ActiveAE::CActiveAEStream.

◆ GetCacheTotal()

virtual double IAEStream::GetCacheTotal ( )
pure virtual

Returns the total time in seconds of the cache.

Returns
seconds

Implemented in ActiveAE::CActiveAEStream.

◆ GetChannelCount()

virtual unsigned int IAEStream::GetChannelCount ( ) const
pure virtual

Returns the number of channels the stream is configured to accept.

Returns
The channel count

Implemented in ActiveAE::CActiveAEStream.

◆ GetDataFormat()

virtual enum AEDataFormat IAEStream::GetDataFormat ( ) const
pure virtual

Return the data format the stream has been configured with.

Returns
The stream's data format (eg, AE_FMT_S16LE)

Implemented in ActiveAE::CActiveAEStream.

◆ GetDelay()

virtual double IAEStream::GetDelay ( )
pure virtual

Returns the time in seconds that it will take for the next added packet to be heard from the speakers.

Returns
seconds

Implemented in ActiveAE::CActiveAEStream.

◆ GetFrameSize()

virtual unsigned int IAEStream::GetFrameSize ( ) const
pure virtual

Returns the size of one audio frame in bytes (channelCount * resolution)

Returns
The size in bytes of one frame

Implemented in ActiveAE::CActiveAEStream.

◆ GetMaxDelay()

virtual double IAEStream::GetMaxDelay ( )
pure virtual

Returns the total time in seconds of maximum delay.

Returns
seconds

Implemented in ActiveAE::CActiveAEStream.

◆ GetReplayGain()

virtual float IAEStream::GetReplayGain ( )
pure virtual

Returns the stream's current replay gain factor.

Returns
The replay gain factor between 0.0 and 1.0

Implemented in ActiveAE::CActiveAEStream.

◆ GetResampleRatio()

virtual double IAEStream::GetResampleRatio ( )
pure virtual

Return the resample ratio.

Note
This will return an undefined value if the stream is not resampling
Returns
the current resample ratio or undefined if the stream is not resampling

Implemented in ActiveAE::CActiveAEStream.

◆ GetSampleRate()

virtual unsigned int IAEStream::GetSampleRate ( ) const
pure virtual

Returns the stream's sample rate, if the stream is using a dynamic sample rate, this value will NOT reflect any changes made by calls to SetResampleRatio()

Returns
The stream's sample rate (eg, 48000)

Implemented in ActiveAE::CActiveAEStream.

◆ GetSpace()

virtual unsigned int IAEStream::GetSpace ( )
pure virtual

Returns the amount of space available in the stream.

Returns
The number of bytes AddData will consume

Implemented in ActiveAE::CActiveAEStream.

◆ GetSyncInfo()

virtual CAESyncInfo IAEStream::GetSyncInfo ( )
pure virtual

Returns info about audio to clock synchronization.

Returns
CAESyncInfo

Implemented in ActiveAE::CActiveAEStream.

◆ GetVolume()

virtual float IAEStream::GetVolume ( )
pure virtual

Return the stream's current volume level.

Returns
The volume level between 0.0 and 1.0

Implemented in ActiveAE::CActiveAEStream.

◆ IsBuffering()

virtual bool IAEStream::IsBuffering ( )
pure virtual

Returns if the stream is buffering.

Returns
True if the stream is buffering

Implemented in ActiveAE::CActiveAEStream.

◆ IsFading()

virtual bool IAEStream::IsFading ( )
inlinevirtual

Returns if a fade is still running.

Returns
true if a fade is in progress, otherwise false

Reimplemented in ActiveAE::CActiveAEStream.

◆ RegisterAudioCallback()

virtual void IAEStream::RegisterAudioCallback ( IAudioCallback pCallback)
pure virtual

Registers the audio callback to call with each block of data, this is used by Audio Visualizations.

Warning
Currently the callbacks require stereo float data in blocks of 512 samples, any deviation from this may crash XBMC, or cause junk to be rendered
Parameters
pCallbackThe callback

Implemented in ActiveAE::CActiveAEStream.

◆ SetAmplification()

virtual void IAEStream::SetAmplification ( float  amplify)
pure virtual

Sets the stream's volume amplification in linear units.

Parameters
Thevolume amplification factor between 1.0 and 1000.0

Implemented in ActiveAE::CActiveAEStream.

◆ SetFFmpegInfo()

virtual void IAEStream::SetFFmpegInfo ( int  profile,
enum AVMatrixEncoding  matrix_encoding,
enum AVAudioServiceType  audio_service_type 
)
pure virtual

Sets the stream ffmpeg information if present.

  • Parameters
    profile
    matrix_encoding
    audio_service_type

Implemented in ActiveAE::CActiveAEStream.

◆ SetReplayGain()

virtual void IAEStream::SetReplayGain ( float  factor)
pure virtual

Sets the stream's replay gain factor, this is used by formats such as MP3 that have attenuation information in their streams.

Parameters
factorThe replay gain factor

Implemented in ActiveAE::CActiveAEStream.

◆ SetResampleRatio()

virtual void IAEStream::SetResampleRatio ( double  ratio)
pure virtual

Sets the resample ratio.

Note
This function may return false if the stream is not resampling, if you wish to use this be sure to set the AESTREAM_FORCE_RESAMPLE option
Parameters
ratiothe new sample rate ratio, calculated by ((double)desiredRate / (double)GetSampleRate())

Implemented in ActiveAE::CActiveAEStream.

◆ SetVolume()

virtual void IAEStream::SetVolume ( float  volume)
pure virtual

Set the stream's volume level.

Parameters
volumeThe new volume level between 0.0 and 1.0

Implemented in ActiveAE::CActiveAEStream.


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