xbmc
Static Public Member Functions | List of all members
ADDON::Interface_AudioEngine Struct Reference

Static Public Member Functions

static void Init (AddonGlobalInterface *addonInterface)
 
static void DeInit (AddonGlobalInterface *addonInterface)
 
static AEStreamHandle * audioengine_make_stream (void *kodiBase, AUDIO_ENGINE_FORMAT *streamFormat, unsigned int options)
 Creates and returns a new handle to an IAEStream in the format specified, this function should never fail. More...
 
static void audioengine_free_stream (void *kodiBase, AEStreamHandle *streamHandle)
 This method will remove the specified stream from the engine. More...
 
static bool get_current_sink_format (void *kodiBase, AUDIO_ENGINE_FORMAT *sinkFormat)
 Get the current sink data format. More...
 
static unsigned int aestream_get_space (void *kodiBase, AEStreamHandle *streamHandle)
 Returns the amount of space available in the stream. More...
 
static unsigned int aestream_add_data (void *kodiBase, AEStreamHandle *streamHandle, uint8_t *const *data, unsigned int offset, unsigned int frames, double pts, bool hasDownmix, double centerMixLevel)
 Add planar or interleaved PCM data to the stream. More...
 
static double aestream_get_delay (void *kodiBase, AEStreamHandle *streamHandle)
 Returns the time in seconds that it will take for the next added packet to be heard from the speakers. More...
 
static bool aestream_is_buffering (void *kodiBase, AEStreamHandle *streamHandle)
 Returns if the stream is buffering. More...
 
static double aestream_get_cache_time (void *kodiBase, AEStreamHandle *streamHandle)
 Returns the time in seconds that it will take to underrun the cache if no sample is added. More...
 
static double aestream_get_cache_total (void *kodiBase, AEStreamHandle *streamHandle)
 Returns the total time in seconds of the cache. More...
 
static void aestream_pause (void *kodiBase, AEStreamHandle *streamHandle)
 Pauses the stream playback.
 
static void aestream_resume (void *kodiBase, AEStreamHandle *streamHandle)
 Resumes the stream after pausing.
 
static void aestream_drain (void *kodiBase, AEStreamHandle *streamHandle, bool wait)
 Start draining the stream. More...
 
static bool aestream_is_draining (void *kodiBase, AEStreamHandle *streamHandle)
 Returns true if the is stream draining.
 
static bool aestream_is_drained (void *kodiBase, AEStreamHandle *streamHandle)
 Returns true if the is stream has finished draining.
 
static void aestream_flush (void *kodiBase, AEStreamHandle *streamHandle)
 Flush all buffers dropping the audio data.
 
static float aestream_get_volume (void *kodiBase, AEStreamHandle *streamHandle)
 Return the stream's current volume level. More...
 
static void aestream_set_volume (void *kodiBase, AEStreamHandle *streamHandle, float volume)
 Set the stream's volume level. More...
 
static float aestream_get_amplification (void *kodiBase, AEStreamHandle *streamHandle)
 Gets the stream's volume amplification in linear units. More...
 
static void aestream_set_amplification (void *kodiBase, AEStreamHandle *streamHandle, float amplify)
 Sets the stream's volume amplification in linear units. More...
 
static unsigned int aestream_get_frame_size (void *kodiBase, AEStreamHandle *streamHandle)
 Returns the size of one audio frame in bytes (channelCount * resolution) More...
 
static unsigned int aestream_get_channel_count (void *kodiBase, AEStreamHandle *streamHandle)
 Returns the number of channels the stream is configured to accept. More...
 
static unsigned int aestream_get_sample_rate (void *kodiBase, AEStreamHandle *streamHandle)
 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...
 
static AudioEngineDataFormat aestream_get_data_format (void *kodiBase, AEStreamHandle *streamHandle)
 Return the data format the stream has been configured with. More...
 
static double aestream_get_resample_ratio (void *kodiBase, AEStreamHandle *streamHandle)
 Return the resample ratio. More...
 
static void aestream_set_resample_ratio (void *kodiBase, AEStreamHandle *streamHandle, double ratio)
 Sets the resample ratio. More...
 
static AEChannel TranslateAEChannelToKodi (AudioEngineChannel channel)
 Translation functions to separate Kodi and addons. More...
 
static AudioEngineChannel TranslateAEChannelToAddon (AEChannel channel)
 
static AEDataFormat TranslateAEFormatToKodi (AudioEngineDataFormat format)
 
static AudioEngineDataFormat TranslateAEFormatToAddon (AEDataFormat format)
 

Member Function Documentation

◆ aestream_add_data()

unsigned int ADDON::Interface_AudioEngine::aestream_add_data ( void *  kodiBase,
AEStreamHandle *  streamHandle,
uint8_t *const *  data,
unsigned int  offset,
unsigned int  frames,
double  pts,
bool  hasDownmix,
double  centerMixLevel 
)
static

Add planar or interleaved PCM data to the stream.

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

◆ aestream_drain()

void ADDON::Interface_AudioEngine::aestream_drain ( void *  kodiBase,
AEStreamHandle *  streamHandle,
bool  wait 
)
static

Start draining the stream.

Note
Once called AddData will not consume more data.

◆ aestream_get_amplification()

float ADDON::Interface_AudioEngine::aestream_get_amplification ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Gets the stream's volume amplification in linear units.

Returns
The volume amplification factor between 1.0 and 1000.0

◆ aestream_get_cache_time()

double ADDON::Interface_AudioEngine::aestream_get_cache_time ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Returns the time in seconds that it will take to underrun the cache if no sample is added.

Returns
seconds

◆ aestream_get_cache_total()

double ADDON::Interface_AudioEngine::aestream_get_cache_total ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Returns the total time in seconds of the cache.

Returns
seconds

◆ aestream_get_channel_count()

unsigned int ADDON::Interface_AudioEngine::aestream_get_channel_count ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

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

Returns
The channel count

◆ aestream_get_data_format()

AudioEngineDataFormat ADDON::Interface_AudioEngine::aestream_get_data_format ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Return the data format the stream has been configured with.

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

◆ aestream_get_delay()

double ADDON::Interface_AudioEngine::aestream_get_delay ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

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

Returns
seconds

◆ aestream_get_frame_size()

unsigned int ADDON::Interface_AudioEngine::aestream_get_frame_size ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

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

Returns
The size in bytes of one frame

◆ aestream_get_resample_ratio()

double ADDON::Interface_AudioEngine::aestream_get_resample_ratio ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

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

◆ aestream_get_sample_rate()

unsigned int ADDON::Interface_AudioEngine::aestream_get_sample_rate ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

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)

◆ aestream_get_space()

unsigned int ADDON::Interface_AudioEngine::aestream_get_space ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Returns the amount of space available in the stream.

Returns
The number of bytes AddData will consume

◆ aestream_get_volume()

float ADDON::Interface_AudioEngine::aestream_get_volume ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Return the stream's current volume level.

Returns
The volume level between 0.0 and 1.0

◆ aestream_is_buffering()

bool ADDON::Interface_AudioEngine::aestream_is_buffering ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

Returns if the stream is buffering.

Returns
True if the stream is buffering

◆ aestream_set_amplification()

void ADDON::Interface_AudioEngine::aestream_set_amplification ( void *  kodiBase,
AEStreamHandle *  streamHandle,
float  amplify 
)
static

Sets the stream's volume amplification in linear units.

Parameters
amplifyThe volume amplification factor between 1.0 and 1000.0

◆ aestream_set_resample_ratio()

void ADDON::Interface_AudioEngine::aestream_set_resample_ratio ( void *  kodiBase,
AEStreamHandle *  streamHandle,
double  ratio 
)
static

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
[in]ratiothe new sample rate ratio, calculated by ((double)desiredRate / (double)GetSampleRate())

◆ aestream_set_volume()

void ADDON::Interface_AudioEngine::aestream_set_volume ( void *  kodiBase,
AEStreamHandle *  streamHandle,
float  volume 
)
static

Set the stream's volume level.

Parameters
volumeThe new volume level between 0.0 and 1.0

◆ audioengine_free_stream()

void ADDON::Interface_AudioEngine::audioengine_free_stream ( void *  kodiBase,
AEStreamHandle *  streamHandle 
)
static

This method will remove the specified stream from the engine.

For OSX/IOS this is essential to reconfigure the audio output.

Parameters
[in]streamHandleThe stream to be altered

◆ audioengine_make_stream()

AEStreamHandle * ADDON::Interface_AudioEngine::audioengine_make_stream ( void *  kodiBase,
AUDIO_ENGINE_FORMAT streamFormat,
unsigned int  options 
)
static

Creates and returns a new handle to an IAEStream in the format specified, this function should never fail.

Parameters
[in]streamFormatFormat to use for stream
[in]optionsA bit field of stream options (see: enum AEStreamOptions)
Returns
a new Handle to an IAEStream that will accept data in the requested format

◆ get_current_sink_format()

bool ADDON::Interface_AudioEngine::get_current_sink_format ( void *  kodiBase,
AUDIO_ENGINE_FORMAT sinkFormat 
)
static

Get the current sink data format.

Parameters
[in]sinkFormatsink data format. For more details see AUDIO_ENGINE_FORMAT.
Returns
Returns true on success, else false.

◆ TranslateAEChannelToKodi()

AEChannel ADDON::Interface_AudioEngine::TranslateAEChannelToKodi ( AudioEngineChannel  channel)
static

Translation functions to separate Kodi and addons.

This thought to make it more safe for cases as something changed inside Kodi, addons overseen and breaks API, further to have on addons a better documentation about this parts.


The documentation for this struct was generated from the following files: