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

Go to the source code of this file.

Data Structures

struct  aout_owner_t
 
struct  aout_instance_t
 
struct  vlc_aout_stream_cfg
 

Macros

#define AOUT_MAX_INPUT_RATE   (4)
 
#define AOUT_RESTART_FILTERS   0x1
 
#define AOUT_RESTART_OUTPUT   (AOUT_RESTART_FILTERS|0x2)
 
#define AOUT_RESTART_OUTPUT_DEC   (AOUT_RESTART_OUTPUT|0x4)
 
#define aout_volume_New(o, g)   aout_volume_New(VLC_OBJECT(o), g)
 
#define aout_New(a)   aout_New(VLC_OBJECT(a))
 
#define aout_FormatsPrint(o, t, a, b)    aout_FormatsPrint(VLC_OBJECT(o), t, a, b)
 
#define AOUT_DEC_SUCCESS   0
 
#define AOUT_DEC_CHANGED   1
 
#define AOUT_DEC_FAILED   VLC_EGENERIC
 

Typedefs

typedef struct aout_volume aout_volume_t
 
typedef struct vlc_aout_stream vlc_aout_stream
 

Enumerations

enum  { AOUT_RESAMPLING_NONE =0 , AOUT_RESAMPLING_UP , AOUT_RESAMPLING_DOWN }
 

Functions

static aout_instance_taout_instance (audio_output_t *aout)
 
static aout_owner_taout_owner (audio_output_t *aout)
 
aout_volume_taout_volume_New (vlc_object_t *, const audio_replay_gain_t *)
 Creates a software amplifier.
 
int aout_volume_SetFormat (aout_volume_t *, vlc_fourcc_t)
 Selects the current sample format for software amplification.
 
void aout_volume_SetVolume (aout_volume_t *, float)
 
int aout_volume_Amplify (aout_volume_t *, block_t *)
 Applies replay gain and software volume to an audio buffer.
 
void aout_volume_Delete (aout_volume_t *)
 Destroys a software amplifier.
 
audio_output_taout_New (vlc_object_t *)
 Creates an audio output object and initializes an output module.
 
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 *p_aout)
 Stops the audio output stream (undoes aout_OutputNew()).
 
vlc_audio_meter_pluginaout_AddMeterPlugin (audio_output_t *aout, const char *chain, const struct vlc_audio_meter_plugin_owner *owner)
 
void aout_RemoveMeterPlugin (audio_output_t *aout, vlc_audio_meter_plugin *plugin)
 
void aout_FormatsPrint (vlc_object_t *, const char *, const audio_sample_format_t *, const audio_sample_format_t *)
 Prints two formats in a human-readable form.
 
vlc_aout_streamvlc_aout_stream_New (audio_output_t *p_aout, const struct vlc_aout_stream_cfg *cfg)
 Creates an audio output.
 
void vlc_aout_stream_Delete (vlc_aout_stream *)
 Stops all plugins involved in the audio output.
 
int vlc_aout_stream_Play (vlc_aout_stream *stream, block_t *block)
 
void vlc_aout_stream_GetResetStats (vlc_aout_stream *stream, unsigned *, unsigned *)
 
void vlc_aout_stream_ChangePause (vlc_aout_stream *stream, bool b_paused, vlc_tick_t i_date)
 
void vlc_aout_stream_ChangeRate (vlc_aout_stream *stream, float rate)
 
void vlc_aout_stream_ChangeDelay (vlc_aout_stream *stream, vlc_tick_t delay)
 
void vlc_aout_stream_Flush (vlc_aout_stream *stream)
 
void vlc_aout_stream_Drain (vlc_aout_stream *stream)
 
bool vlc_aout_stream_IsDrained (vlc_aout_stream *stream)
 
void vlc_aout_stream_NotifyTiming (vlc_aout_stream *stream, vlc_tick_t system_ts, vlc_tick_t audio_ts)
 
void vlc_aout_stream_NotifyDrained (vlc_aout_stream *stream)
 
void vlc_aout_stream_NotifyGain (vlc_aout_stream *stream, float gain)
 
void vlc_aout_stream_RequestRestart (vlc_aout_stream *stream, unsigned)
 Marks the audio output for restart, to update any parameter of the output plug-in (e.g.
 
void vlc_aout_stream_RequestRetiming (vlc_aout_stream *stream, vlc_tick_t system_ts, vlc_tick_t audio_ts)
 
void aout_InputRequestRestart (audio_output_t *aout)
 
static void aout_SetWavePhysicalChannels (audio_sample_format_t *fmt)
 
aout_filters_taout_FiltersNewWithClock (vlc_object_t *, vlc_clock_t *, const audio_sample_format_t *, const audio_sample_format_t *, const aout_filters_cfg_t *cfg)
 
void aout_FiltersResetClock (aout_filters_t *filters)
 
void aout_FiltersSetClockDelay (aout_filters_t *filters, vlc_tick_t delay)
 
bool aout_FiltersCanResample (aout_filters_t *filters)
 
filter_taout_filter_Create (vlc_object_t *obj, const filter_owner_t *restrict owner, const char *type, const char *name, const audio_sample_format_t *infmt, const audio_sample_format_t *outfmt, config_chain_t *cfg, bool const_fmt)
 

Macro Definition Documentation

◆ AOUT_DEC_CHANGED

#define AOUT_DEC_CHANGED   1

◆ AOUT_DEC_FAILED

#define AOUT_DEC_FAILED   VLC_EGENERIC

◆ AOUT_DEC_SUCCESS

#define AOUT_DEC_SUCCESS   0

◆ aout_FormatsPrint

#define aout_FormatsPrint (   o,
  t,
  a,
 
)     aout_FormatsPrint(VLC_OBJECT(o), t, a, b)

◆ AOUT_MAX_INPUT_RATE

#define AOUT_MAX_INPUT_RATE   (4)

◆ aout_New

#define aout_New (   a)    aout_New(VLC_OBJECT(a))

◆ AOUT_RESTART_FILTERS

#define AOUT_RESTART_FILTERS   0x1

◆ AOUT_RESTART_OUTPUT

#define AOUT_RESTART_OUTPUT   (AOUT_RESTART_FILTERS|0x2)

◆ AOUT_RESTART_OUTPUT_DEC

#define AOUT_RESTART_OUTPUT_DEC   (AOUT_RESTART_OUTPUT|0x4)

◆ aout_volume_New

#define aout_volume_New (   o,
 
)    aout_volume_New(VLC_OBJECT(o), g)

Typedef Documentation

◆ aout_volume_t

typedef struct aout_volume aout_volume_t

◆ vlc_aout_stream

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AOUT_RESAMPLING_NONE 
AOUT_RESAMPLING_UP 
AOUT_RESAMPLING_DOWN 

Function Documentation

◆ aout_AddMeterPlugin()

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

◆ aout_filter_Create()

◆ aout_FiltersCanResample()

bool aout_FiltersCanResample ( aout_filters_t filters)

◆ aout_FiltersNewWithClock()

aout_filters_t * aout_FiltersNewWithClock ( vlc_object_t ,
vlc_clock_t ,
const audio_sample_format_t ,
const audio_sample_format_t ,
const aout_filters_cfg_t cfg 
)

◆ aout_FiltersResetClock()

void aout_FiltersResetClock ( aout_filters_t filters)

◆ aout_FiltersSetClockDelay()

◆ aout_FormatsPrint()

void aout_FormatsPrint ( vlc_object_t obj,
const char *  psz_text,
const audio_sample_format_t p_format1,
const audio_sample_format_t p_format2 
)

Prints two formats in a human-readable form.

References aout_FormatPrintChannels(), audio_format_t::i_format, audio_format_t::i_rate, and msg_Dbg.

◆ aout_InputRequestRestart()

◆ aout_instance()

static aout_instance_t * aout_instance ( audio_output_t aout)
inlinestatic

References container_of.

Referenced by aout_owner(), and vlc_aout_stream_New().

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

◆ aout_RemoveMeterPlugin()

◆ aout_SetWavePhysicalChannels()

◆ aout_volume_Amplify()

int aout_volume_Amplify ( aout_volume_t vol,
block_t block 
)

Applies replay gain and software volume to an audio buffer.

References audio_volume::amplify, aout_volume::gain_factor, aout_volume::object, and aout_volume::output_factor.

Referenced by vlc_aout_stream_Play().

◆ aout_volume_Delete()

void aout_volume_Delete ( aout_volume_t vol)

◆ aout_volume_New()

◆ aout_volume_SetFormat()

int aout_volume_SetFormat ( aout_volume_t vol,
vlc_fourcc_t  format 
)

Selects the current sample format for software amplification.

References audio_volume::format, module_need, module_unneed, msg_Dbg, and aout_volume::object.

Referenced by stream_CheckReady(), and vlc_aout_stream_New().

◆ aout_volume_SetVolume()

void aout_volume_SetVolume ( aout_volume_t vol,
float  factor 
)

◆ vlc_aout_stream_ChangeDelay()

void vlc_aout_stream_ChangeDelay ( vlc_aout_stream stream,
vlc_tick_t  delay 
)

◆ vlc_aout_stream_ChangePause()

◆ vlc_aout_stream_ChangeRate()

void vlc_aout_stream_ChangeRate ( vlc_aout_stream stream,
float  rate 
)

◆ vlc_aout_stream_Delete()

◆ vlc_aout_stream_Drain()

◆ vlc_aout_stream_Flush()

◆ vlc_aout_stream_GetResetStats()

void vlc_aout_stream_GetResetStats ( vlc_aout_stream stream,
unsigned *  ,
unsigned *   
)

Referenced by ModuleThread_QueueAudio().

◆ vlc_aout_stream_IsDrained()

bool vlc_aout_stream_IsDrained ( vlc_aout_stream stream)

◆ vlc_aout_stream_New()

vlc_aout_stream * vlc_aout_stream_New ( audio_output_t p_aout,
const struct vlc_aout_stream_cfg cfg 
)

Creates an audio output.

References AOUT_CHAN_MAX, AOUT_FILTERS_CFG_INIT, aout_FiltersNewWithClock(), aout_FormatNbChannels(), aout_instance(), aout_OutputDelete(), aout_OutputNew(), aout_owner(), AOUT_RESAMPLING_NONE, aout_volume_Delete(), aout_volume_New, aout_volume_SetFormat(), aout_owner_t::bitexact, vlc_aout_stream::buffers_lost, vlc_aout_stream::buffers_played, vlc_aout_stream_cfg::clock, vlc_aout_stream::clock, vlc_aout_stream::clock_id, vlc_aout_stream::delay, vlc_aout_stream::discontinuity, vlc_aout_stream::drain_deadline, vlc_aout_stream::drained, vlc_aout_stream::draining, vlc_aout_stream::filter_format, vlc_aout_stream::filters, vlc_aout_stream::filters_cfg, vlc_aout_stream_cfg::fmt, audio_format_t::i_bitspersample, audio_format_t::i_channels, audio_format_t::i_format, audio_format_t::i_rate, INPUT_CHAN_MAX, vlc_aout_stream::input_format, vlc_aout_stream::input_profile, vlc_aout_stream::instance, vlc_aout_stream::lock, aout_owner_t::meter, vlc_aout_stream::mixer_format, msg_Err, vlc_aout_stream_cfg::profile, vlc_aout_stream::rate, vlc_aout_stream::rate_audio_ts, vlc_aout_stream_cfg::replay_gain, vlc_aout_stream::request_delay, vlc_aout_stream::resamp_type, vlc_aout_stream::restart, vlc_aout_stream_cfg::str_id, vlc_aout_stream::str_id, stream_ResetTimings(), vlc_aout_stream::sync, vlc_aout_stream::timing, aout_owner_t::update, vlc_audio_meter_Reset(), vlc_mutex_init(), VLC_OBJECT, VLC_TICK_INVALID, vlc_aout_stream::volume, and aout_owner_t::vp.

Referenced by ModuleThread_UpdateAudioFormat().

◆ vlc_aout_stream_NotifyDrained()

void vlc_aout_stream_NotifyDrained ( vlc_aout_stream stream)

References vlc_aout_stream::drained.

Referenced by aout_DrainedNotify().

◆ vlc_aout_stream_NotifyGain()

void vlc_aout_stream_NotifyGain ( vlc_aout_stream stream,
float  gain 
)

◆ vlc_aout_stream_NotifyTiming()

◆ vlc_aout_stream_Play()

◆ vlc_aout_stream_RequestRestart()

void vlc_aout_stream_RequestRestart ( vlc_aout_stream stream,
unsigned  mode 
)

Marks the audio output for restart, to update any parameter of the output plug-in (e.g.

output device or channel mapping).

References aout_stream_aout(), msg_Dbg, and vlc_aout_stream::restart.

Referenced by aout_InputRequestRestart(), aout_RestartNotify(), MixModeCallback(), and StereoModeCallback().

◆ vlc_aout_stream_RequestRetiming()

void vlc_aout_stream_RequestRetiming ( vlc_aout_stream stream,
vlc_tick_t  system_ts,
vlc_tick_t  audio_ts 
)