VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Audio output:

Modules

 Audio output modules
 
 Audio formats
 
 Audio meter API
 
 Audio output volume
 

Files

file  vlc_aout.h
 Audio output modules interface.
 

Macros

#define AOUT_MAX_ADVANCE_TIME   (AOUT_MAX_PREPARE_TIME + VLC_TICK_FROM_SEC(1))
 
#define AOUT_MAX_PREPARE_TIME   VLC_TICK_FROM_SEC(2)
 
#define AOUT_MIN_PREPARE_TIME   AOUT_MAX_PTS_ADVANCE
 
#define AOUT_MAX_PTS_ADVANCE   VLC_TICK_FROM_MS(40)
 Maximum advance of actual audio playback time to coded PTS, above which downsampling will be performed.
 
#define AOUT_MAX_PTS_DELAY   VLC_TICK_FROM_MS(60)
 Maximum delay of actual audio playback time from coded PTS, above which upsampling will be performed.
 
#define AOUT_MAX_RESAMPLING   10
 
#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_STEREO   1
 
#define AOUT_VAR_CHAN_RSTEREO   2
 
#define AOUT_VAR_CHAN_LEFT   3
 
#define AOUT_VAR_CHAN_RIGHT   4
 
#define AOUT_VAR_CHAN_DOLBYS   5
 
#define AOUT_VAR_CHAN_MONO   7
 
#define AOUT_MIX_MODE_UNSET   0
 
#define AOUT_MIX_MODE_STEREO   1
 
#define AOUT_MIX_MODE_BINAURAL   2
 
#define AOUT_MIX_MODE_4_0   3
 
#define AOUT_MIX_MODE_5_1   4
 
#define AOUT_MIX_MODE_7_1   5
 
#define AOUT_SPDIF_SIZE   6144
 
#define A52_FRAME_NB   1536
 
#define AOUT_VOLUME_DEFAULT   256
 
#define AOUT_VOLUME_MAX   512
 

Functions

float aout_VolumeGet (audio_output_t *)
 Gets the volume of the audio output stream (independent of mute).
 
int aout_VolumeSet (audio_output_t *, float)
 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 *)
 Gets the audio output stream mute flag.
 
int aout_MuteSet (audio_output_t *, bool)
 Sets the audio output stream mute flag.
 
char * aout_DeviceGet (audio_output_t *)
 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.
 

Detailed Description

Macro Definition Documentation

◆ A52_FRAME_NB

#define A52_FRAME_NB   1536

◆ AOUT_FMT_HDMI

#define AOUT_FMT_HDMI (   p_format)
Value:
( (p_format)->i_format == VLC_CODEC_EAC3 \
||(p_format)->i_format == VLC_CODEC_DTSHD \
||(p_format)->i_format == VLC_CODEC_TRUEHD \
||(p_format)->i_format == VLC_CODEC_MLP \
)
#define VLC_CODEC_EAC3
Definition vlc_fourcc.h:521
#define VLC_CODEC_DTSHD
Definition vlc_fourcc.h:525
#define VLC_CODEC_TRUEHD
Definition vlc_fourcc.h:533
#define VLC_CODEC_MLP
Definition vlc_fourcc.h:532

◆ AOUT_FMT_LINEAR

#define AOUT_FMT_LINEAR (   p_format)     (aout_BitsPerSample((p_format)->i_format) != 0)

◆ AOUT_FMT_SPDIF

#define AOUT_FMT_SPDIF (   p_format)
Value:
( ((p_format)->i_format == VLC_CODEC_SPDIFL) \
|| ((p_format)->i_format == VLC_CODEC_SPDIFB) \
|| ((p_format)->i_format == VLC_CODEC_A52) \
|| ((p_format)->i_format == VLC_CODEC_DTS) )
#define VLC_CODEC_SPDIFL
Definition vlc_aout.h:81
#define VLC_CODEC_SPDIFB
Definition vlc_aout.h:82
#define VLC_CODEC_A52
Definition vlc_fourcc.h:520
#define VLC_CODEC_DTS
Definition vlc_fourcc.h:523

◆ AOUT_FMTS_IDENTICAL

#define AOUT_FMTS_IDENTICAL (   p_first,
  p_second 
)
Value:
( \
((p_first)->i_format == (p_second)->i_format) \
&& AOUT_FMTS_SIMILAR(p_first, p_second) )
#define AOUT_FMTS_SIMILAR(p_first, p_second)
Definition vlc_aout.h:72

◆ AOUT_FMTS_SIMILAR

#define AOUT_FMTS_SIMILAR (   p_first,
  p_second 
)
Value:
( \
((p_first)->i_rate == (p_second)->i_rate) \
&& ((p_first)->channel_type == (p_second)->channel_type) \
&& ((p_first)->i_physical_channels == (p_second)->i_physical_channels)\
&& ((p_first)->i_chan_mode == (p_second)->i_chan_mode) )

◆ AOUT_MAX_ADVANCE_TIME

#define AOUT_MAX_ADVANCE_TIME   (AOUT_MAX_PREPARE_TIME + VLC_TICK_FROM_SEC(1))

◆ AOUT_MAX_PREPARE_TIME

#define AOUT_MAX_PREPARE_TIME   VLC_TICK_FROM_SEC(2)

◆ AOUT_MAX_PTS_ADVANCE

#define AOUT_MAX_PTS_ADVANCE   VLC_TICK_FROM_MS(40)

Maximum advance of actual audio playback time to coded PTS, above which downsampling will be performed.

◆ AOUT_MAX_PTS_DELAY

#define AOUT_MAX_PTS_DELAY   VLC_TICK_FROM_MS(60)

Maximum delay of actual audio playback time from coded PTS, above which upsampling will be performed.

◆ AOUT_MAX_RESAMPLING

#define AOUT_MAX_RESAMPLING   10

◆ AOUT_MIN_PREPARE_TIME

#define AOUT_MIN_PREPARE_TIME   AOUT_MAX_PTS_ADVANCE

◆ AOUT_MIX_MODE_4_0

#define AOUT_MIX_MODE_4_0   3

◆ AOUT_MIX_MODE_5_1

#define AOUT_MIX_MODE_5_1   4

◆ AOUT_MIX_MODE_7_1

#define AOUT_MIX_MODE_7_1   5

◆ AOUT_MIX_MODE_BINAURAL

#define AOUT_MIX_MODE_BINAURAL   2

◆ AOUT_MIX_MODE_STEREO

#define AOUT_MIX_MODE_STEREO   1

◆ AOUT_MIX_MODE_UNSET

#define AOUT_MIX_MODE_UNSET   0

◆ AOUT_SPDIF_SIZE

#define AOUT_SPDIF_SIZE   6144

◆ AOUT_VAR_CHAN_DOLBYS

#define AOUT_VAR_CHAN_DOLBYS   5

◆ AOUT_VAR_CHAN_LEFT

#define AOUT_VAR_CHAN_LEFT   3

◆ AOUT_VAR_CHAN_MONO

#define AOUT_VAR_CHAN_MONO   7

◆ AOUT_VAR_CHAN_RIGHT

#define AOUT_VAR_CHAN_RIGHT   4

◆ AOUT_VAR_CHAN_RSTEREO

#define AOUT_VAR_CHAN_RSTEREO   2

◆ AOUT_VAR_CHAN_STEREO

#define AOUT_VAR_CHAN_STEREO   1

◆ AOUT_VAR_CHAN_UNSET

#define AOUT_VAR_CHAN_UNSET   0 /* must be zero */

◆ AOUT_VOLUME_DEFAULT

#define AOUT_VOLUME_DEFAULT   256

◆ AOUT_VOLUME_MAX

#define AOUT_VOLUME_MAX   512

◆ VLC_CODEC_SPDIFB

#define VLC_CODEC_SPDIFB   VLC_FOURCC('s','p','d','b')

◆ VLC_CODEC_SPDIFL

#define VLC_CODEC_SPDIFL   VLC_FOURCC('s','p','d','i')

Function Documentation

◆ aout_DeviceGet()

char * aout_DeviceGet ( audio_output_t aout)

Gets the currently selected device.

Returns
the selected device ID (caller must free() it) NULL if no device is selected or in case of error.

References var_GetNonEmptyString().

◆ aout_DeviceSet()

int aout_DeviceSet ( audio_output_t aout,
const char *  id 
)

Selects an audio output device.

Parameters
aoutthe audio output to set the device for
iddevice ID to select, or NULL for the default device
Returns
zero on success, non-zero on error.

References aout_owner(), device_select, aout_owner_t::lock, vlc_mutex_lock(), and vlc_mutex_unlock().

◆ aout_DevicesList()

int aout_DevicesList ( audio_output_t aout,
char ***  ids,
char ***  names 
)

Enumerates possible audio output devices.

The function will heap-allocate two tables of heap-allocated strings; the caller is responsible for freeing all strings and both tables.

Parameters
aoutthe audio output to get the device list from
idspointer to a table of device identifiers [OUT]
namespointer to a table of device human-readable descriptions [OUT]
Returns
the number of devices, or negative on error.
Note
In case of error, *ids and *names are undefined.

References aout_owner(), aout_owner_t::count, aout_owner_t::dev, aout_dev::id, aout_owner_t::list, aout_owner_t::lock, aout_dev::name, strdup(), unlikely, vlc_alloc(), vlc_list_foreach, vlc_mutex_lock(), and vlc_mutex_unlock().

◆ aout_MuteGet()

int aout_MuteGet ( audio_output_t aout)

Gets the audio output stream mute flag.

Returns
0 if not muted, 1 if muted, -1 if undefined.

References var_InheritBool().

Referenced by vlc_player_aout_IsMuted().

◆ aout_MuteSet()

int aout_MuteSet ( audio_output_t aout,
bool  mute 
)

Sets the audio output stream mute flag.

Returns
0 on success, -1 on failure.

References aout_owner(), aout_owner_t::lock, mute_set, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vlc_player_aout_Mute().

◆ aout_VolumeGet()

float aout_VolumeGet ( audio_output_t aout)

Gets the volume of the audio output stream (independent of mute).

Returns
Current audio volume (0. = silent, 1. = nominal), or a strictly negative value if undefined.

References var_GetFloat().

Referenced by aout_VolumeUpdate(), vlc_player_aout_GetVolume(), and vlc_strfplayer().

◆ aout_VolumeSet()

int aout_VolumeSet ( audio_output_t aout,
float  vol 
)

Sets the volume of the audio output stream.

Note
The mute status is not changed.
Returns
0 on success, -1 on failure.

References aout_owner(), aout_owner_t::lock, vlc_mutex_lock(), vlc_mutex_unlock(), and volume_set.

Referenced by aout_VolumeUpdate(), and vlc_player_aout_SetVolume().

◆ aout_VolumeUpdate()

int aout_VolumeUpdate ( audio_output_t aout,
int  value,
float *  volp 
)

Adjusts the volume.

Parameters
aoutthe audio output to update the volume for
valuehow much to increase (> 0) or decrease (< 0) the volume
volpif non-NULL, will contain contain the resulting volume

References AOUT_VOLUME_DEFAULT, AOUT_VOLUME_MAX, aout_VolumeGet(), aout_VolumeSet(), clampf(), and var_InheritFloat().

Referenced by vlc_player_aout_IncrementVolume().