Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
IAEStream Class Referenceabstract

#include <AEStream.h>

Inheritance diagram for IAEStream:
ActiveAE::CActiveAEStream

Classes

struct  ExtData
 

Public Member Functions

virtual unsigned int GetSpace ()=0
 
virtual unsigned int AddData (const uint8_t *const *data, unsigned int offset, unsigned int frames, ExtData *extData)=0
 
virtual double GetDelay ()=0
 
virtual CAESyncInfo GetSyncInfo ()=0
 
virtual bool IsBuffering ()=0
 
virtual double GetCacheTime ()=0
 
virtual double GetCacheTotal ()=0
 
virtual double GetMaxDelay ()=0
 
virtual void Pause ()=0
 
virtual void Resume ()=0
 
virtual void Drain (bool wait)=0
 
virtual bool IsDraining ()=0
 
virtual bool IsDrained ()=0
 
virtual void Flush ()=0
 
virtual float GetVolume ()=0
 
virtual void SetVolume (float volume)=0
 
virtual float GetReplayGain ()=0
 
virtual void SetReplayGain (float factor)=0
 
virtual float GetAmplification ()=0
 
virtual void SetAmplification (float amplify)=0
 
virtual void SetFFmpegInfo (int profile, enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type)=0
 
virtual unsigned int GetFrameSize () const =0
 
virtual unsigned int GetChannelCount () const =0
 
virtual unsigned int GetSampleRate () const =0
 
virtual enum AEDataFormat GetDataFormat () const =0
 
virtual double GetResampleRatio ()=0
 
virtual void SetResampleRatio (double ratio)=0
 
virtual void SetResampleMode (int mode)=0
 
virtual void RegisterAudioCallback (IAudioCallback *pCallback)=0
 
virtual void UnRegisterAudioCallback ()=0
 
virtual void FadeVolume (float from, float target, unsigned int time)
 
virtual bool IsFading ()
 
virtual void RegisterSlave (IAEStream *stream)=0
 

Protected Member Functions

 IAEStream ()=default
 
virtual ~IAEStream ()=default
 

Friends

class IAE
 

Detailed Description

IAEStream Stream Interface for streaming audio

Constructor & Destructor Documentation

◆ IAEStream()

IAEStream::IAEStream ( )
protecteddefault

◆ ~IAEStream()

virtual IAEStream::~IAEStream ( )
protectedvirtualdefault

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.

◆ Flush()

virtual void IAEStream::Flush ( )
pure virtual

Flush all buffers dropping the audio data

Implemented 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.

◆ IsDrained()

virtual bool IAEStream::IsDrained ( )
pure virtual

Returns true if the is stream has finished draining

Implemented in ActiveAE::CActiveAEStream.

◆ IsDraining()

virtual bool IAEStream::IsDraining ( )
pure virtual

Returns true if the is stream draining

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.

◆ Pause()

virtual void IAEStream::Pause ( )
pure virtual

Pauses the stream playback

Implemented 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.

◆ RegisterSlave()

virtual void IAEStream::RegisterSlave ( IAEStream * stream)
pure virtual

Slave a stream to resume when this stream has drained

Implemented in ActiveAE::CActiveAEStream.

◆ Resume()

virtual void IAEStream::Resume ( )
pure virtual

Resumes the stream after pausing

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.

◆ SetResampleMode()

virtual void IAEStream::SetResampleMode ( int mode)
pure virtual

Sets the resamplling on/ff

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.

◆ UnRegisterAudioCallback()

virtual void IAEStream::UnRegisterAudioCallback ( )
pure virtual

Unregisters the current audio callback

Implemented in ActiveAE::CActiveAEStream.

Friends And Related Symbol Documentation

◆ IAE

friend class IAE
friend

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