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

Data Structures

struct  vlc_aout_stream
 

Macros

#define BLOCK_FLAG_CORE_PRIVATE_FILTERED   (1 << BLOCK_FLAG_CORE_PRIVATE_SHIFT)
 

Functions

static aout_owner_taout_stream_owner (vlc_aout_stream *stream)
 
static audio_output_taout_stream_aout (vlc_aout_stream *stream)
 
static struct vlc_traceraout_stream_tracer (vlc_aout_stream *stream)
 
static int stream_GetDelay (vlc_aout_stream *stream, vlc_tick_t *delay)
 
static bool stream_IsDrained (vlc_aout_stream *stream)
 
static int stream_StartDiscontinuity (vlc_aout_stream *stream, block_t *block)
 
static void stream_ResetDiscontinuity (vlc_aout_stream *stream)
 
static int stream_HandleDiscontinuity (vlc_aout_stream *stream, block_t *block)
 
static void stream_ResetTimings (vlc_aout_stream *stream)
 
static void stream_Reset (vlc_aout_stream *stream)
 
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 *stream)
 Stops all plugins involved in the audio output.
 
static int stream_CheckReady (vlc_aout_stream *stream)
 
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.
 
static void stream_StopResampling (vlc_aout_stream *stream)
 
static void stream_Silence (vlc_aout_stream *stream, vlc_tick_t length, vlc_tick_t pts)
 
static void stream_HandleDrift (vlc_aout_stream *stream, vlc_tick_t drift, vlc_tick_t audio_ts)
 
static void stream_Synchronize (vlc_aout_stream *stream, vlc_tick_t system_now, vlc_tick_t play_date, vlc_tick_t dec_pts)
 
void vlc_aout_stream_NotifyTiming (vlc_aout_stream *stream, vlc_tick_t system_ts, vlc_tick_t audio_ts)
 
static vlc_tick_t stream_ClockConvert (vlc_aout_stream *stream, vlc_tick_t system_now, vlc_tick_t pts)
 
int vlc_aout_stream_Play (vlc_aout_stream *stream, block_t *block)
 
void vlc_aout_stream_GetResetStats (vlc_aout_stream *stream, unsigned *restrict lost, unsigned *restrict played)
 
void vlc_aout_stream_ChangePause (vlc_aout_stream *stream, bool paused, vlc_tick_t 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_NotifyGain (vlc_aout_stream *stream, float gain)
 
void vlc_aout_stream_NotifyDrained (vlc_aout_stream *stream)
 
bool vlc_aout_stream_IsDrained (vlc_aout_stream *stream)
 
void vlc_aout_stream_Drain (vlc_aout_stream *stream)
 

Macro Definition Documentation

◆ BLOCK_FLAG_CORE_PRIVATE_FILTERED

#define BLOCK_FLAG_CORE_PRIVATE_FILTERED   (1 << BLOCK_FLAG_CORE_PRIVATE_SHIFT)

Function Documentation

◆ aout_stream_aout()

◆ aout_stream_owner()

◆ aout_stream_tracer()

◆ stream_CheckReady()

◆ stream_ClockConvert()

◆ stream_GetDelay()

◆ stream_HandleDiscontinuity()

◆ stream_HandleDrift()

◆ stream_IsDrained()

◆ stream_Reset()

◆ stream_ResetDiscontinuity()

◆ stream_ResetTimings()

◆ stream_Silence()

◆ stream_StartDiscontinuity()

◆ stream_StopResampling()

◆ stream_Synchronize()

static void stream_Synchronize ( vlc_aout_stream stream,
vlc_tick_t  system_now,
vlc_tick_t  play_date,
vlc_tick_t  dec_pts 
)
static

Depending on the drift between the actual and intended playback times, the audio core may ignore the drift, trigger upsampling or downsampling, insert silence or even discard samples. Future VLC versions may instead adjust the input rate.

The audio output plugin is responsible for estimating its actual playback time, or rather the estimated time when the next sample will be played. (The actual playback time is always the current time, that is to say vlc_tick_now(). It is not an useful statistic.)

Most audio output plugins can estimate the delay until playback of the next sample to be written to the buffer, or equally the time until all samples in the buffer will have been played. Then: pts = vlc_tick_now() + delay

References aout_stream_aout(), vlc_aout_stream::clock, vlc_aout_stream::first_pts, vlc_aout_stream::last_drift, vlc_aout_stream::lock, vlc_aout_stream::played, vlc_aout_stream::rate, vlc_aout_stream::rate_audio_ts, vlc_aout_stream::rate_system_ts, stream_GetDelay(), stream_HandleDrift(), stream_Silence(), vlc_aout_stream::sync, audio_output::time_get, vlc_aout_stream::timing, vlc_clock_Lock(), vlc_clock_Unlock(), vlc_clock_Update(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_TICK_INVALID.

Referenced by vlc_aout_stream_Play().

◆ 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 *restrict  lost,
unsigned *restrict  played 
)

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