VLC 4.0.0-dev
Collaboration diagram for Audio meter API:

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

Detailed Description

Macro Definition Documentation

◆ vlc_audio_meter_Init

#define vlc_audio_meter_Init (   a,
 
)    vlc_audio_meter_Init(a, VLC_OBJECT(b))

Typedef Documentation

◆ vlc_audio_meter_plugin

Audio meter plugin opaque structure.

This opaque structure is returned by vlc_audio_meter_AddPlugin().

Function Documentation

◆ 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()

Parameters
meteraudio meter structure
chainname of the module, can contain specific module options using the following chain convention:"name{option1=a,option2=b}"
ownerpointer to a vlc_audio_meter_plugin_owner structure, the structure must stay valid during the lifetime of the plugin
Returns
a valid audio meter plugin, or NULL in case of error

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().

◆ vlc_audio_meter_Destroy()

void vlc_audio_meter_Destroy ( struct vlc_audio_meter meter)

Free allocated resource from the audio meter structure.

Parameters
meterallocated audio meter structure

References vlc_audio_meter::plugins, vlc_audio_meter_RemovePlugin(), and vlc_list_foreach.

Referenced by aout_Destroy().

◆ vlc_audio_meter_Flush()

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.

Parameters
meteraudio 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().

◆ vlc_audio_meter_Init()

void vlc_audio_meter_Init ( struct vlc_audio_meter meter,
vlc_object_t parent 
)

Initialize the audio meter structure.

Parameters
meterallocated audio meter structure
parentobject 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().

◆ vlc_audio_meter_Process()

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.

Parameters
meteraudio meter structure
blockpointer to a block, this block won't be released of modified from this function
dateabsolute 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().

◆ vlc_audio_meter_RemovePlugin()

◆ vlc_audio_meter_Reset()

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()

Parameters
meteraudio meter structure
fmtNULL 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)
Returns
VLC_SUCCESS on success, VLC_EGENERIC if a plugin failed to load

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().