VLC  4.0.0-dev
Data Structures | Typedefs | Functions | Variables
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 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_VolumeNotify (audio_output_t *aout, float volume)
 Supply or update the current custom ("hardware") volume. More...
 
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, unsigned mode)
 
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. More...
 
audio_output_taout_Hold (audio_output_t *aout)
 
void aout_Destroy (audio_output_t *aout)
 Deinitializes an audio output module and destroys an audio output object. More...
 
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)
 Starts an audio output stream. More...
 
void aout_OutputDelete (audio_output_t *aout)
 Stops the audio output stream (undoes aout_OutputNew()). More...
 
float aout_VolumeGet (audio_output_t *aout)
 Gets the volume of the audio output stream (independent of mute). More...
 
int aout_VolumeSet (audio_output_t *aout, float vol)
 Sets the volume of the audio output stream. More...
 
int aout_VolumeUpdate (audio_output_t *aout, int value, float *volp)
 Raises the volume. More...
 
int aout_MuteGet (audio_output_t *aout)
 Gets the audio output stream mute flag. More...
 
int aout_MuteSet (audio_output_t *aout, bool mute)
 Sets the audio output stream mute flag. More...
 
char * aout_DeviceGet (audio_output_t *aout)
 Gets the currently selected device. More...
 
int aout_DeviceSet (audio_output_t *aout, const char *id)
 Selects an audio output device. More...
 
int aout_DevicesList (audio_output_t *aout, char ***ids, char ***names)
 Enumerates possible audio output devices. More...
 
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()

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

◆ aout_ChangeViewpoint()

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

◆ aout_Destroy()

void aout_Destroy ( audio_output_t aout)

◆ aout_DeviceNotify()

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

References var_SetString().

◆ aout_GainNotify()

static int aout_GainNotify ( audio_output_t aout,
float  gain 
)
static

◆ aout_HasMixModeChoice()

static bool aout_HasMixModeChoice ( audio_output_t aout,
int  mode 
)
static

◆ aout_HasStereoMode()

static bool aout_HasStereoMode ( audio_output_t aout,
int  mode 
)
static

References count, var_Change(), and VLC_VAR_GETCHOICES.

Referenced by aout_OutputNew().

◆ aout_HotplugNotify()

static void aout_HotplugNotify ( audio_output_t aout,
const char *  id,
const char *  name 
)
static

◆ aout_MuteNotify()

static void aout_MuteNotify ( audio_output_t aout,
bool  mute 
)
static

References var_SetBool().

◆ aout_New()

audio_output_t* aout_New ( vlc_object_t parent)

◆ aout_OutputDelete()

void aout_OutputDelete ( audio_output_t 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, audio_output::stop, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by aout_CheckReady(), aout_DecDelete(), and aout_DecNew().

◆ aout_OutputNew()

int aout_OutputNew ( audio_output_t aout)

Starts an audio output stream.

Parameters
output_codeccodec accepted by the module, it can be different than the codec from the mixer_format in case of DTSHD/DTS or EAC3/AC3 fallback
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, aout_owner_t::filter_format, aout_owner_t::filters_cfg, 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::input_profile, aout_owner_t::lock, aout_owner_t::mixer_format, msg_Err, msg_Warn, audio_output::pause, audio_output::play, aout_owner_t::requested_mix_mode, audio_output::start, audio_output::time_get, 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 aout_CheckReady(), and aout_DecNew().

◆ aout_PolicyNotify()

static void aout_PolicyNotify ( audio_output_t aout,
bool  cork 
)
static

◆ aout_PrepareStereoMode()

static int aout_PrepareStereoMode ( audio_output_t aout,
const audio_sample_format_t *restrict  fmt 
)
static

◆ aout_RemoveMeterPlugin()

void aout_RemoveMeterPlugin ( audio_output_t aout,
vlc_audio_meter_plugin plugin 
)

◆ aout_RestartNotify()

static void aout_RestartNotify ( audio_output_t aout,
unsigned  mode 
)
static

References aout_RequestRestart().

◆ aout_SetupMixModeChoices()

static void aout_SetupMixModeChoices ( audio_output_t aout,
const audio_sample_format_t *restrict  fmt 
)
static

◆ aout_TimingNotify()

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

◆ aout_UpdateMixMode()

static void aout_UpdateMixMode ( audio_output_t aout,
int  mode,
audio_sample_format_t *restrict  fmt 
)
static

◆ aout_UpdateStereoMode()

static void aout_UpdateStereoMode ( audio_output_t aout,
int  mode,
audio_sample_format_t *restrict  fmt,
aout_filters_cfg_t filters_cfg 
)
static

◆ aout_VolumeNotify()

static void aout_VolumeNotify ( audio_output_t aout,
float  volume 
)
static

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

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

◆ FilterCallback()

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

◆ MixModeCallback()

static int MixModeCallback ( vlc_object_t obj,
const char *  varname,
vlc_value_t  oldval,
vlc_value_t  newval,
void *  data 
)
static

◆ StereoModeCallback()

static int StereoModeCallback ( vlc_object_t obj,
const char *  varname,
vlc_value_t  oldval,
vlc_value_t  newval,
void *  data 
)
static

◆ var_Copy()

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

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

static 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_RestartNotify(audio_output_t *aout, unsigned mode)
Definition: output.c:146
static void aout_TimingNotify(audio_output_t *aout, vlc_tick_t system_ts, vlc_tick_t audio_ts)
Definition: output.c:66
static void aout_VolumeNotify(audio_output_t *aout, float volume)
Supply or update the current custom ("hardware") volume.
Definition: output.c:81
static void aout_DeviceNotify(audio_output_t *aout, const char *id)
Definition: output.c:96
static int aout_GainNotify(audio_output_t *aout, float gain)
Definition: output.c:151
static void aout_HotplugNotify(audio_output_t *aout, const char *id, const char *name)
Definition: output.c:101
static void aout_MuteNotify(audio_output_t *aout, bool mute)
Definition: output.c:86
static void aout_PolicyNotify(audio_output_t *aout, bool cork)
Definition: output.c:91

Referenced by aout_New().