VLC  3.0.15
Data Structures | Functions | Variables
output.c File Reference
Include dependency graph for output.c:

Data Structures

struct  aout_dev
 

Functions

static void aout_OutputAssertLocked (audio_output_t *aout)
 
static void aout_Destructor (vlc_object_t *obj)
 Destroys the audio output lock used (asynchronously) by interface functions. More...
 
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_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 ViewpointCallback (vlc_object_t *obj, const char *var, vlc_value_t prev, vlc_value_t cur, void *data)
 
audio_output_t * aout_New (vlc_object_t *parent)
 Creates an audio output object and initializes an output module. More...
 
void aout_Destroy (audio_output_t *aout)
 Deinitializes an audio output module and destroys an audio output object. More...
 
static void aout_PrepareStereoMode (audio_output_t *aout, audio_sample_format_t *restrict fmt, aout_filters_cfg_t *filters_cfg, audio_channel_type_t input_chan_type, unsigned i_nb_input_channels, int i_forced_stereo_mode)
 
int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt, aout_filters_cfg_t *filters_cfg)
 Starts an audio output stream. More...
 
void aout_OutputDelete (audio_output_t *aout)
 Stops the audio output stream (undoes aout_OutputNew()). More...
 
int aout_OutputTimeGet (audio_output_t *aout, mtime_t *delay)
 
void aout_OutputPlay (audio_output_t *aout, block_t *block)
 Plays a decoded audio buffer. More...
 
static void PauseDefault (audio_output_t *aout, bool pause, mtime_t date)
 
void aout_OutputPause (audio_output_t *aout, bool pause, mtime_t date)
 Notifies the audio output (if any) of pause/resume events. More...
 
void aout_OutputFlush (audio_output_t *aout, bool wait)
 Flushes or drains the audio output buffers. More...
 
static int aout_OutputVolumeSet (audio_output_t *aout, float vol)
 
static int aout_OutputMuteSet (audio_output_t *aout, bool mute)
 
static int aout_OutputDeviceSet (audio_output_t *aout, const char *id)
 
void aout_OutputLock (audio_output_t *aout)
 
static int aout_OutputTryLock (audio_output_t *aout)
 
void aout_OutputUnlock (audio_output_t *aout)
 
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...
 

Variables

static const char unset_str [1] = ""
 

Function Documentation

◆ aout_Destroy()

void aout_Destroy ( audio_output_t *  aout)

◆ aout_Destructor()

static void aout_Destructor ( vlc_object_t *  p_this)
static

Destroys the audio output lock used (asynchronously) by interface functions.

References aout_owner(), aout_owner_t::dev, aout_owner_t::device, aout_owner_t::list, aout_owner_t::lock, aout_owner_t::req, unset_str, vlc_mutex_destroy(), and aout_owner_t::vp.

Referenced by aout_New().

◆ aout_DeviceNotify()

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

References var_SetString.

Referenced by aout_New().

◆ aout_GainNotify()

static int aout_GainNotify ( audio_output_t *  aout,
float  gain 
)
static

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

Referenced by aout_New().

◆ aout_New()

audio_output_t* aout_New ( vlc_object_t *  parent)

Creates an audio output object and initializes an output module.

References _, aout_Destructor(), aout_DeviceNotify(), aout_GainNotify(), aout_HotplugNotify(), aout_MuteNotify(), aout_owner(), aout_PolicyNotify(), aout_RestartNotify(), aout_VolumeNotify(), config_FindConfig(), aout_owner_t::dev, aout_owner_t::device, audio_output::device_report, audio_output::device_select, audio_output::event, FilterCallback(), audio_output::gain_request, audio_output::hotplug_report, aout_owner_t::initial_stereo_mode, likely, module_config_t::list, module_config_t::list_count, module_config_t::list_text, aout_owner_t::lock, aout_owner_t::module, module_exists(), module_need, msg_Err, aout_owner_t::mute, audio_output::mute_report, audio_output::mute_set, audio_output::policy_report, module_config_t::psz, vlc_value_t::psz_string, aout_owner_t::req, audio_output::restart_request, audio_output::start, StereoModeCallback(), audio_output::stop, unlikely, unset_str, aout_owner_t::update, aout_owner_t::value, var_AddCallback, var_Change, var_Copy(), var_CopyDevice(), var_Create, var_GetInteger, var_GetNonEmptyString, var_SetString, ViewpointCallback(), vlc_custom_create, vlc_gettext(), vlc_mutex_init(), vlc_object_release, vlc_object_set_destructor, VLC_VAR_ADDCHOICE, VLC_VAR_ADDRESS, VLC_VAR_BOOL, VLC_VAR_DOINHERIT, VLC_VAR_FLOAT, VLC_VAR_INTEGER, VLC_VAR_SETTEXT, VLC_VAR_STRING, vlc_viewpoint_init(), aout_owner_t::volume, audio_output::volume_report, audio_output::volume_set, and aout_owner_t::vp.

◆ aout_OutputAssertLocked()

static void aout_OutputAssertLocked ( audio_output_t *  aout)
static

◆ 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 hold the audio output lock.

References aout_OutputAssertLocked(), and audio_output::stop.

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

◆ aout_OutputDeviceSet()

static int aout_OutputDeviceSet ( audio_output_t *  aout,
const char *  id 
)
static

◆ aout_OutputFlush()

void aout_OutputFlush ( audio_output_t *  aout,
bool  wait 
)

Flushes or drains the audio output buffers.

This enables the output to expedite seek and stop.

Parameters
waitif true, wait for buffer playback (i.e. drain), if false, discard the buffers immediately (i.e. flush)
Note
This can only be called after a successful aout_OutputNew().
Warning
The caller must hold the audio output lock.

References aout_OutputAssertLocked(), and audio_output::flush.

Referenced by aout_DecFlush(), aout_DecSynchronize(), and PauseDefault().

◆ aout_OutputLock()

void aout_OutputLock ( audio_output_t *  aout)

◆ aout_OutputMuteSet()

static int aout_OutputMuteSet ( audio_output_t *  aout,
bool  mute 
)
static

◆ aout_OutputNew()

int aout_OutputNew ( audio_output_t *  aout,
audio_sample_format_t *restrict  fmt,
aout_filters_cfg_t *  filters_cfg 
)

◆ aout_OutputPause()

void aout_OutputPause ( audio_output_t *  aout,
bool  pause,
mtime_t  date 
)

Notifies the audio output (if any) of pause/resume events.

This enables the output to expedite pause, instead of waiting for its buffers to drain.

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

References aout_OutputAssertLocked(), audio_output::pause, and PauseDefault().

Referenced by aout_DecChangePause().

◆ aout_OutputPlay()

void aout_OutputPlay ( audio_output_t *  aout,
block_t *  block 
)

Plays a decoded audio buffer.

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

References aout_OutputAssertLocked(), aout_owner(), block_t::i_buffer, audio_format_t::i_bytes_per_frame, audio_format_t::i_frame_length, block_t::i_nb_samples, aout_owner_t::mixer_format, and audio_output::play.

Referenced by aout_DecFlush(), aout_DecPlay(), and aout_DecSilence().

◆ aout_OutputTimeGet()

int aout_OutputTimeGet ( audio_output_t *  aout,
mtime_t *  delay 
)

◆ aout_OutputTryLock()

static int aout_OutputTryLock ( audio_output_t *  aout)
static

◆ aout_OutputUnlock()

void aout_OutputUnlock ( audio_output_t *  aout)

◆ aout_OutputVolumeSet()

static int aout_OutputVolumeSet ( audio_output_t *  aout,
float  vol 
)
static

◆ aout_PolicyNotify()

static void aout_PolicyNotify ( audio_output_t *  aout,
bool  cork 
)
static

◆ aout_PrepareStereoMode()

static void aout_PrepareStereoMode ( audio_output_t *  aout,
audio_sample_format_t *restrict  fmt,
aout_filters_cfg_t *  filters_cfg,
audio_channel_type_t  input_chan_type,
unsigned  i_nb_input_channels,
int  i_forced_stereo_mode 
)
static

◆ aout_RestartNotify()

static void aout_RestartNotify ( audio_output_t *  aout,
unsigned  mode 
)
static

References aout_RequestRestart().

Referenced by aout_New().

◆ aout_VolumeNotify()

static void aout_VolumeNotify ( audio_output_t *  aout,
float  volume 
)
static

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

Note
This only makes sense after calling aout_VolumeHardInit().
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.

Referenced by aout_New().

◆ FilterCallback()

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

◆ PauseDefault()

static void PauseDefault ( audio_output_t *  aout,
bool  pause,
mtime_t  date 
)
static

References aout_OutputFlush().

Referenced by aout_OutputPause().

◆ 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, 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, 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

< No error

References aout_ChangeViewpoint(), vlc_value_t::p_address, and VLC_SUCCESS.

Referenced by aout_Destroy(), and aout_New().

Variable Documentation

◆ unset_str

const char unset_str[1] = ""
static