VLC 4.0.0-dev
Loading...
Searching...
No Matches
output.c File Reference
Include dependency graph for output.c:

Data Structures

struct  aout_dev

Typedefs

typedef struct aout_dev aout_dev_t

Functions

static float clampf (const float value, const float min, const float max)
static int var_Copy (vlc_object_t *src, const char *name, vlc_value_t prev, vlc_value_t value, void *data)
static int var_CopyDevice (vlc_object_t *src, const char *name, vlc_value_t prev, vlc_value_t value, void *data)
static void aout_TimingNotify (audio_output_t *aout, vlc_tick_t system_ts, vlc_tick_t audio_ts)
static void aout_DrainedNotify (audio_output_t *aout)
static void aout_VolumeNotify (audio_output_t *aout, float volume)
 Supply or update the current custom ("hardware") volume.
static void aout_MuteNotify (audio_output_t *aout, bool mute)
static void aout_PolicyNotify (audio_output_t *aout, bool cork)
static void aout_DeviceNotify (audio_output_t *aout, const char *id)
static void aout_HotplugNotify (audio_output_t *aout, const char *id, const char *name)
static void aout_RestartNotify (audio_output_t *aout, bool restart_dec)
void aout_InputRequestRestart (audio_output_t *aout)
static int aout_GainNotify (audio_output_t *aout, float gain)
static int FilterCallback (vlc_object_t *obj, const char *var, vlc_value_t prev, vlc_value_t cur, void *data)
static int StereoModeCallback (vlc_object_t *obj, const char *varname, vlc_value_t oldval, vlc_value_t newval, void *data)
static int MixModeCallback (vlc_object_t *obj, const char *varname, vlc_value_t oldval, vlc_value_t newval, void *data)
static void aout_ChangeViewpoint (audio_output_t *, const vlc_viewpoint_t *)
static int ViewpointCallback (vlc_object_t *obj, const char *var, vlc_value_t prev, vlc_value_t cur, void *data)
audio_output_taout_New (vlc_object_t *parent)
 Creates an audio output object and initializes an output module.
audio_output_taout_Hold (audio_output_t *aout)
static void aout_Destroy (audio_output_t *aout)
 Deinitializes an audio output module and destroys an audio output object.
void aout_Release (audio_output_t *aout)
static int aout_PrepareStereoMode (audio_output_t *aout, const audio_sample_format_t *restrict fmt)
static void aout_UpdateStereoMode (audio_output_t *aout, int mode, audio_sample_format_t *restrict fmt, aout_filters_cfg_t *filters_cfg)
static bool aout_HasStereoMode (audio_output_t *aout, int mode)
static void aout_AddMixModeChoice (audio_output_t *aout, int mode, const char *suffix, const audio_sample_format_t *restrict fmt)
static void aout_SetupMixModeChoices (audio_output_t *aout, const audio_sample_format_t *restrict fmt)
static bool aout_HasMixModeChoice (audio_output_t *aout, int mode)
static void aout_UpdateMixMode (audio_output_t *aout, int mode, audio_sample_format_t *restrict fmt)
int aout_OutputNew (audio_output_t *aout, vlc_aout_stream *stream, audio_sample_format_t *fmt, int input_profile, audio_sample_format_t *filter_fmt, aout_filters_cfg_t *filters_cfg)
 Starts an audio output stream.
void aout_OutputDelete (audio_output_t *aout)
 Stops the audio output stream (undoes aout_OutputNew()).
float aout_VolumeGet (audio_output_t *aout)
 Gets the volume of the audio output stream (independent of mute).
int aout_VolumeSet (audio_output_t *aout, float vol)
 Sets the volume of the audio output stream.
int aout_VolumeUpdate (audio_output_t *aout, int value, float *volp)
 Adjusts the volume.
int aout_MuteGet (audio_output_t *aout)
 Gets the audio output stream mute flag.
int aout_MuteSet (audio_output_t *aout, bool mute)
 Sets the audio output stream mute flag.
char * aout_DeviceGet (audio_output_t *aout)
 Gets the currently selected device.
int aout_DeviceSet (audio_output_t *aout, const char *id)
 Selects an audio output device.
int aout_DevicesList (audio_output_t *aout, char ***ids, char ***names)
 Enumerates possible audio output devices.
vlc_audio_meter_pluginaout_AddMeterPlugin (audio_output_t *aout, const char *chain, const struct vlc_audio_meter_plugin_owner *meter_plugin_owner)
void aout_RemoveMeterPlugin (audio_output_t *aout, vlc_audio_meter_plugin *plugin)

Variables

static const struct vlc_audio_output_events aout_events

Typedef Documentation

◆ aout_dev_t

typedef struct aout_dev aout_dev_t

Function Documentation

◆ aout_AddMeterPlugin()

vlc_audio_meter_plugin * aout_AddMeterPlugin ( audio_output_t * aout,
const char * chain,
const struct vlc_audio_meter_plugin_owner * meter_plugin_owner )

◆ aout_AddMixModeChoice()

void aout_AddMixModeChoice ( audio_output_t * aout,
int mode,
const char * suffix,
const audio_sample_format_t *restrict fmt )
static

◆ aout_ChangeViewpoint()

void aout_ChangeViewpoint ( audio_output_t * aout,
const vlc_viewpoint_t * p_viewpoint )
static

◆ aout_Destroy()

◆ aout_DeviceNotify()

void aout_DeviceNotify ( audio_output_t * aout,
const char * id )
static

References var_SetString().

◆ aout_DrainedNotify()

void aout_DrainedNotify ( audio_output_t * aout)
static

◆ aout_GainNotify()

int aout_GainNotify ( audio_output_t * aout,
float gain )
static

◆ aout_HasMixModeChoice()

bool aout_HasMixModeChoice ( audio_output_t * aout,
int mode )
static

◆ aout_HasStereoMode()

bool aout_HasStereoMode ( audio_output_t * aout,
int mode )
static

References count, var_Change(), and VLC_VAR_GETCHOICES.

Referenced by aout_OutputNew().

◆ aout_HotplugNotify()

◆ aout_InputRequestRestart()

◆ aout_MuteNotify()

void aout_MuteNotify ( audio_output_t * aout,
bool mute )
static

References var_SetBool().

◆ aout_New()

◆ aout_OutputDelete()

void aout_OutputDelete ( audio_output_t * p_aout)

Stops the audio output stream (undoes aout_OutputNew()).

Note
This can only be called after a successful aout_OutputNew().
Warning
The caller must NOT hold the audio output lock.

References aout_owner(), aout_owner_t::lock, aout_owner_t::main_stream, audio_output::stop, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by stream_CheckReady(), vlc_aout_stream_Delete(), and vlc_aout_stream_New().

◆ aout_OutputNew()

int aout_OutputNew ( audio_output_t * aout,
vlc_aout_stream * stream,
audio_sample_format_t * fmt,
int input_profile,
audio_sample_format_t * filter_fmt,
aout_filters_cfg_t * filters_cfg )

Starts an audio output stream.

Parameters
aoutthe audio output instance to initialize from
streamthe audio output stream to initialize from
fmtthe format to request to the output
input_profilethe audio profile to request from the audio output
filter_fmtthe format requested from the filters
filters_cfgthe configuration to load the audio filters from
Warning
The caller must NOT hold the audio output lock.

References AOUT_CHANS_7_1, AOUT_CHANS_STEREO, AOUT_FMT_LINEAR, aout_FormatNbChannels(), aout_FormatPrepare(), aout_FormatPrint, aout_HasMixModeChoice(), aout_HasStereoMode(), AOUT_MIX_MODE_BINAURAL, aout_owner(), aout_PrepareStereoMode(), aout_SetupMixModeChoices(), aout_SetWavePhysicalChannels(), aout_UpdateMixMode(), aout_UpdateStereoMode(), AOUT_VAR_CHAN_UNSET, ARRAY_SIZE, AUDIO_CHANNEL_TYPE_AMBISONICS, AUDIO_CHANNEL_TYPE_BITMAP, audio_format_t::channel_type, audio_output::current_sink_info, audio_output::flush, audio_output::headphones, audio_format_t::i_bitspersample, audio_format_t::i_bytes_per_frame, audio_format_t::i_channels, audio_format_t::i_format, audio_format_t::i_frame_length, audio_format_t::i_physical_channels, aout_owner_t::lock, aout_owner_t::main_stream, msg_Err, msg_Warn, audio_output::play, aout_owner_t::requested_mix_mode, audio_output::start, var_Change(), VLC_CODEC_A52, VLC_CODEC_DTS, VLC_CODEC_DTSHD, VLC_CODEC_EAC3, VLC_CODEC_FL32, VLC_CODEC_S16N, VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_SUCCESS, and VLC_VAR_CLEARCHOICES.

Referenced by stream_CheckReady(), and vlc_aout_stream_New().

◆ aout_PolicyNotify()

void aout_PolicyNotify ( audio_output_t * aout,
bool cork )
static

◆ aout_PrepareStereoMode()

◆ aout_RemoveMeterPlugin()

◆ aout_RestartNotify()

void aout_RestartNotify ( audio_output_t * aout,
bool restart_dec )
static

◆ aout_SetupMixModeChoices()

◆ aout_TimingNotify()

void aout_TimingNotify ( audio_output_t * aout,
vlc_tick_t system_ts,
vlc_tick_t audio_ts )
static

◆ aout_UpdateMixMode()

◆ aout_UpdateStereoMode()

◆ aout_VolumeNotify()

void aout_VolumeNotify ( audio_output_t * aout,
float volume )
static

Supply or update the current custom ("hardware") volume.

Parameters
aoutthe audio output notifying the new volume
volumecurrent custom volume
Warning
The caller (i.e. the audio output plug-in) is responsible for interlocking and synchronizing call to this function and to the audio_output_t.volume_set callback. This ensures that VLC gets correct volume information (possibly with a latency).

References var_SetFloat().

◆ clampf()

float clampf ( const float value,
const float min,
const float max )
inlinestatic

Referenced by aout_VolumeUpdate().

◆ FilterCallback()

int FilterCallback ( vlc_object_t * obj,
const char * var,
vlc_value_t prev,
vlc_value_t cur,
void * data )
static

◆ MixModeCallback()

◆ StereoModeCallback()

◆ var_Copy()

int var_Copy ( vlc_object_t * src,
const char * name,
vlc_value_t prev,
vlc_value_t value,
void * data )
static

References name, vlc_list::prev, and var_Set().

Referenced by aout_Destroy(), and aout_New().

◆ var_CopyDevice()

int var_CopyDevice ( vlc_object_t * src,
const char * name,
vlc_value_t prev,
vlc_value_t value,
void * data )
static

References name, vlc_list::prev, and var_Set().

Referenced by aout_Destroy(), and aout_New().

◆ ViewpointCallback()

int ViewpointCallback ( vlc_object_t * obj,
const char * var,
vlc_value_t prev,
vlc_value_t cur,
void * data )
static

Variable Documentation

◆ aout_events

const struct vlc_audio_output_events aout_events
static
Initial value:
= {
}
static void aout_TimingNotify(audio_output_t *aout, vlc_tick_t system_ts, vlc_tick_t audio_ts)
Definition output.c:77
static void aout_VolumeNotify(audio_output_t *aout, float volume)
Supply or update the current custom ("hardware") volume.
Definition output.c:103
static void aout_RestartNotify(audio_output_t *aout, bool restart_dec)
Definition output.c:168
static void aout_DeviceNotify(audio_output_t *aout, const char *id)
Definition output.c:118
static int aout_GainNotify(audio_output_t *aout, float gain)
Definition output.c:185
static void aout_HotplugNotify(audio_output_t *aout, const char *id, const char *name)
Definition output.c:123
static void aout_MuteNotify(audio_output_t *aout, bool mute)
Definition output.c:108
static void aout_DrainedNotify(audio_output_t *aout)
Definition output.c:85
static void aout_PolicyNotify(audio_output_t *aout, bool cork)
Definition output.c:113

Referenced by aout_New().