VLC  4.0.0-dev
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Include dependency graph for vlc_aout.h:

Go to the source code of this file.

Data Structures

struct  vlc_audio_output_events
struct  audio_output
 Audio output object. More...
struct  aout_filters_cfg_t
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...


 Maximum advance of actual audio playback time to coded PTS, above which downsampling will be performed. More...
 Maximum delay of actual audio playback time from coded PTS, above which upsampling will be performed. More...
#define AOUT_FMTS_IDENTICAL(p_first, p_second)
#define AOUT_FMTS_SIMILAR(p_first, p_second)
#define AOUT_FMT_LINEAR(p_format)   (aout_BitsPerSample((p_format)->i_format) != 0)
#define VLC_CODEC_SPDIFL   VLC_FOURCC('s','p','d','i')
#define VLC_CODEC_SPDIFB   VLC_FOURCC('s','p','d','b')
#define AOUT_FMT_SPDIF(p_format)
#define AOUT_FMT_HDMI(p_format)
#define AOUT_VAR_CHAN_UNSET   0 /* must be zero */
#define AOUT_VAR_CHAN_LEFT   3
#define AOUT_VAR_CHAN_MONO   7
#define AOUT_SPDIF_SIZE   6144
#define A52_FRAME_NB   1536
#define aout_FormatPrint(o, t, f)   aout_FormatPrint(VLC_OBJECT(o), t, f)
#define AOUT_VOLUME_MAX   512
#define aout_FiltersNew(o, inf, outf, remap)   aout_FiltersNew(VLC_OBJECT(o),inf,outf,remap)
#define aout_FiltersDelete(o, f)   aout_FiltersDelete(VLC_OBJECT(o),f)
#define vlc_audio_meter_Init(a, b)   vlc_audio_meter_Init(a, VLC_OBJECT(b))


typedef struct aout_filters aout_filters_t
typedef struct vlc_audio_meter_plugin vlc_audio_meter_plugin
 Audio meter plugin opaque structure. More...


enum  vlc_chan_order_idx_t {


VLC_EXPORT unsigned aout_CheckChannelReorder (const uint32_t *, const uint32_t *, uint32_t mask, uint8_t *table)
 This function computes the reordering needed to go from pi_chan_order_in to pi_chan_order_out. More...
VLC_EXPORT void aout_ChannelReorder (void *, size_t, uint8_t, const uint8_t *, vlc_fourcc_t)
VLC_EXPORT void aout_Interleave (void *dst, const void *const *planes, unsigned samples, unsigned channels, vlc_fourcc_t fourcc)
VLC_EXPORT void aout_Deinterleave (void *dst, const void *src, unsigned samples, unsigned channels, vlc_fourcc_t fourcc)
VLC_EXPORT bool aout_CheckChannelExtraction (int *pi_selection, uint32_t *pi_layout, int *pi_channels, const uint32_t pi_order_dst[9], const uint32_t *pi_order_src, int i_channels)
 This function will compute the extraction parameter into pi_selection to go from i_channels with their type given by pi_order_src[] into the order describe by pi_order_dst. More...
VLC_EXPORT void aout_ChannelExtract (void *p_dst, int i_dst_channels, const void *p_src, int i_src_channels, int i_sample_count, const int *pi_selection, int i_bits_per_sample)
 Do the actual channels extraction using the parameters created by aout_CheckChannelExtraction. More...
static unsigned aout_FormatNbChannels (const audio_sample_format_t *fmt)
VLC_EXPORT unsigned int aout_BitsPerSample (vlc_fourcc_t i_format)
VLC_EXPORT void aout_FormatPrepare (audio_sample_format_t *p_format)
VLC_EXPORT void aout_FormatPrint (vlc_object_t *, const char *, const audio_sample_format_t *)
 Prints an audio sample format in a human-readable form. More...
const VLC_EXPORT char * aout_FormatPrintChannels (const audio_sample_format_t *)
VLC_EXPORT float aout_VolumeGet (audio_output_t *)
 Gets the volume of the audio output stream (independent of mute). More...
VLC_EXPORT int aout_VolumeSet (audio_output_t *, float)
 Sets the volume of the audio output stream. More...
VLC_EXPORT int aout_VolumeUpdate (audio_output_t *, int, float *)
 Raises the volume. More...
VLC_EXPORT int aout_MuteGet (audio_output_t *)
 Gets the audio output stream mute flag. More...
VLC_EXPORT int aout_MuteSet (audio_output_t *, bool)
 Sets the audio output stream mute flag. More...
VLC_EXPORT char * aout_DeviceGet (audio_output_t *)
 Gets the currently selected device. More...
VLC_EXPORT int aout_DeviceSet (audio_output_t *, const char *)
 Selects an audio output device. More...
VLC_EXPORT int aout_DevicesList (audio_output_t *, char ***, char ***)
 Enumerates possible audio output devices. More...
static void aout_VolumeReport (audio_output_t *aout, float volume)
 Report change of configured audio volume to the core and UI. More...
static void aout_MuteReport (audio_output_t *aout, bool mute)
 Report change of muted flag to the core and UI. More...
static void aout_PolicyReport (audio_output_t *aout, bool cork)
 Report audio policy status. More...
static void aout_DeviceReport (audio_output_t *aout, const char *id)
 Report change of output device. More...
static void aout_HotplugReport (audio_output_t *aout, const char *id, const char *name)
 Report a device hot-plug event. More...
static int aout_GainRequest (audio_output_t *aout, float gain)
 Request a change of software audio amplification. More...
static void aout_RestartRequest (audio_output_t *aout, unsigned mode)
static int aout_TimeGetDefault (audio_output_t *aout, vlc_tick_t *restrict delay)
 Default implementation for audio_output_t.time_get. More...
static void aout_PauseDefault (audio_output_t *aout, bool paused, vlc_tick_t date)
 Default implementation for audio_output_t.pause. More...
VLC_EXPORT int aout_EnableFilter (audio_output_t *aout, const char *name, bool add)
 Enable or disable an audio filter ("audio-filter") More...
VLC_EXPORT aout_filters_taout_FiltersNew (vlc_object_t *, const audio_sample_format_t *, const audio_sample_format_t *, const aout_filters_cfg_t *cfg)
VLC_EXPORT void aout_FiltersDelete (vlc_object_t *, aout_filters_t *)
 Destroys a chain of audio filters. More...
VLC_EXPORT bool aout_FiltersAdjustResampling (aout_filters_t *, int)
VLC_EXPORT block_taout_FiltersPlay (aout_filters_t *, block_t *, float rate)
VLC_EXPORT block_taout_FiltersDrain (aout_filters_t *)
VLC_EXPORT void aout_FiltersFlush (aout_filters_t *)
VLC_EXPORT void aout_FiltersChangeViewpoint (aout_filters_t *, const vlc_viewpoint_t *vp)
VLC_EXPORT vout_thread_taout_filter_GetVout (filter_t *, const video_format_t *)
static int aout_TimeGet (audio_output_t *aout, vlc_tick_t *delay)
VLC_EXPORT void vlc_audio_meter_Init (struct vlc_audio_meter *meter, vlc_object_t *parent)
 Initialize the audio meter structure. More...
VLC_EXPORT void vlc_audio_meter_Destroy (struct vlc_audio_meter *meter)
 Free allocated resource from the audio meter structure. More...
VLC_EXPORT int vlc_audio_meter_Reset (struct vlc_audio_meter *meter, const audio_sample_format_t *fmt)
 Set or reset the audio format. More...
VLC_EXPORT 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...
VLC_EXPORT void vlc_audio_meter_RemovePlugin (struct vlc_audio_meter *meter, vlc_audio_meter_plugin *plugin)
 Remove an "audio meter" plugin. More...
VLC_EXPORT void vlc_audio_meter_Process (struct vlc_audio_meter *meter, block_t *block, vlc_tick_t date)
 Process an audio block. More...
VLC_EXPORT void vlc_audio_meter_Flush (struct vlc_audio_meter *meter)
 Flush all "audio meter" plugins. More...


static const uint32_t pi_vlc_chan_order_wg4 []
 It describes the audio channel order VLC expect. More...

Detailed Description

Audio output modules interface

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

meteraudio meter structure
chainname of the module, can contain specific module options using the following chain convention:"name{option1=a,option2=b}"
cbspointer to a vlc_audio_meter_events structure, the structure must stay valid during the lifetime of the plugin
cbs_dataopaque pointer used by the callbacks
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()

VLC_EXPORT void vlc_audio_meter_Destroy ( struct vlc_audio_meter meter)

Free allocated resource from the audio meter structure.

meterallocated audio meter structure

Referenced by aout_Destroy().

◆ vlc_audio_meter_Flush()

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

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

◆ vlc_audio_meter_Init()

VLC_EXPORT void vlc_audio_meter_Init ( struct vlc_audio_meter meter,
vlc_object_t parent 

Initialize the audio meter structure.

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

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

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, block_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 aout_DecPlay().

◆ vlc_audio_meter_RemovePlugin()

VLC_EXPORT void vlc_audio_meter_RemovePlugin ( struct vlc_audio_meter meter,
vlc_audio_meter_plugin plugin 

◆ vlc_audio_meter_Reset()

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

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)
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 aout_CheckReady(), and aout_DecNew().