VLC 4.0.0-dev
|
Data Structures | |
struct | vlc_audio_loudness |
Audio loudness measurement. More... | |
struct | vlc_audio_meter_cbs |
Audio meter callback. More... | |
struct | vlc_audio_meter_plugin_owner |
Audio meter plugin owner structure. More... | |
struct | vlc_audio_meter |
Audio meter structure. More... | |
Macros | |
#define | vlc_audio_meter_Init(a, b) vlc_audio_meter_Init(a, VLC_OBJECT(b)) |
Typedefs | |
typedef struct vlc_audio_meter_plugin | vlc_audio_meter_plugin |
Audio meter plugin opaque structure. More... | |
Functions | |
void | vlc_audio_meter_Init (struct vlc_audio_meter *meter, vlc_object_t *parent) |
Initialize the audio meter structure. More... | |
void | vlc_audio_meter_Destroy (struct vlc_audio_meter *meter) |
Free allocated resource from the audio meter structure. More... | |
int | vlc_audio_meter_Reset (struct vlc_audio_meter *meter, const audio_sample_format_t *fmt) |
Set or reset the audio format. More... | |
vlc_audio_meter_plugin * | vlc_audio_meter_AddPlugin (struct vlc_audio_meter *meter, const char *chain, const struct vlc_audio_meter_plugin_owner *owner) |
Add an "audio meter" plugin. More... | |
void | vlc_audio_meter_RemovePlugin (struct vlc_audio_meter *meter, vlc_audio_meter_plugin *plugin) |
Remove an "audio meter" plugin. More... | |
void | vlc_audio_meter_Process (struct vlc_audio_meter *meter, block_t *block, vlc_tick_t date) |
Process an audio block. More... | |
void | vlc_audio_meter_Flush (struct vlc_audio_meter *meter) |
Flush all "audio meter" plugins. More... | |
#define vlc_audio_meter_Init | ( | a, | |
b | |||
) | vlc_audio_meter_Init(a, VLC_OBJECT(b)) |
typedef struct vlc_audio_meter_plugin vlc_audio_meter_plugin |
Audio meter plugin opaque structure.
This opaque structure is returned by vlc_audio_meter_AddPlugin().
vlc_audio_meter_plugin * vlc_audio_meter_AddPlugin | ( | struct vlc_audio_meter * | meter, |
const char * | chain, | ||
const struct vlc_audio_meter_plugin_owner * | owner | ||
) |
Add an "audio meter" plugin.
The module to be loaded if meter->fmt is valid, otherwise, the module will be loaded from a next call to vlc_audio_meter_Reset()
meter | audio meter structure |
chain | name of the module, can contain specific module options using the following chain convention:"name{option1=a,option2=b}" |
owner | pointer to a vlc_audio_meter_plugin_owner structure, the structure must stay valid during the lifetime of the plugin |
References vlc_audio_meter_plugin_owner::cbs, vlc_audio_meter_plugin::cfg, config_ChainCreate(), config_ChainDestroy(), vlc_filter_operations::drain_audio, vlc_audio_meter_plugin::filter, vlc_audio_meter::fmt, vlc_audio_meter_plugin::last_date, vlc_audio_meter::lock, vlc_audio_meter_plugin::name, vlc_audio_meter_plugin::node, filter_t::ops, vlc_audio_meter_plugin::owner, vlc_audio_meter::plugins, vlc_audio_meter_CreatePluginFilter(), vlc_list_append(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_TICK_INVALID.
Referenced by aout_AddMeterPlugin().
void vlc_audio_meter_Destroy | ( | struct vlc_audio_meter * | meter | ) |
Free allocated resource from the audio meter structure.
meter | allocated audio meter structure |
References vlc_audio_meter::plugins, vlc_audio_meter_RemovePlugin(), and vlc_list_foreach.
Referenced by aout_Destroy().
void vlc_audio_meter_Flush | ( | struct vlc_audio_meter * | meter | ) |
Flush all "audio meter" plugins.
vlc_audio_meter_events callbacks can be triggered from this function.
meter | audio meter structure |
References vlc_audio_meter_plugin::filter, filter_Flush(), vlc_audio_meter::lock, vlc_audio_meter::plugins, vlc_list_foreach, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by stream_Reset().
void vlc_audio_meter_Init | ( | struct vlc_audio_meter * | meter, |
vlc_object_t * | parent | ||
) |
Initialize the audio meter structure.
meter | allocated audio meter structure |
parent | object that will be used to create audio filters |
References vlc_audio_meter::fmt, vlc_audio_meter::lock, vlc_audio_meter::parent, vlc_audio_meter::plugins, vlc_list_init(), and vlc_mutex_init().
void vlc_audio_meter_Process | ( | struct vlc_audio_meter * | meter, |
block_t * | block, | ||
vlc_tick_t | date | ||
) |
Process an audio block.
vlc_audio_meter_events callbacks can be triggered from this function.
meter | audio meter structure |
block | pointer to a block, this block won't be released of modified from this function |
date | absolute date (likely in the future) when this block should be rendered |
References vlc_audio_meter_plugin::filter, vlc_filter_operations::filter_audio, vlc_frame_t::i_length, vlc_audio_meter_plugin::last_date, vlc_audio_meter::lock, filter_t::ops, vlc_audio_meter::plugins, vlc_list_foreach, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by vlc_aout_stream_Play().
void vlc_audio_meter_RemovePlugin | ( | struct vlc_audio_meter * | meter, |
vlc_audio_meter_plugin * | plugin | ||
) |
Remove an "audio meter" plugin.
meter | audio meter structure |
plugin | plugin returned by vlc_audio_meter_AddPlugin() |
References vlc_audio_meter_plugin::cfg, config_ChainDestroy(), vlc_audio_meter_plugin::filter, filter_Close(), vlc_audio_meter::lock, module_unneed, vlc_audio_meter_plugin::name, vlc_audio_meter_plugin::node, filter_t::p_module, vlc_list_remove(), vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_object_delete.
Referenced by aout_RemoveMeterPlugin(), and vlc_audio_meter_Destroy().
int vlc_audio_meter_Reset | ( | struct vlc_audio_meter * | meter, |
const audio_sample_format_t * | fmt | ||
) |
Set or reset the audio format.
This will reload all plugins added with vlc_audio_meter_AddPlugin()
meter | audio meter structure |
fmt | NULL to unload all plugins or a valid pointer to an audio format, must stay valid during the lifetime of the audio meter (until vlc_audio_meter_Reset() or vlc_audio_meter_Destroy() are called) |
References vlc_audio_meter_plugin::filter, filter_Close(), vlc_audio_meter::fmt, vlc_audio_meter_plugin::last_date, vlc_audio_meter::lock, module_unneed, filter_t::p_module, vlc_audio_meter::plugins, vlc_audio_meter_CreatePluginFilter(), VLC_EGENERIC, vlc_list_foreach, vlc_mutex_lock(), vlc_mutex_unlock(), vlc_object_delete, VLC_SUCCESS, and VLC_TICK_INVALID.
Referenced by stream_CheckReady(), vlc_aout_stream_Delete(), and vlc_aout_stream_New().