VLC  4.0.0-dev
dec.c File Reference
Include dependency graph for dec.c:

Data Structures

struct  timing_point
 
struct  vlc_aout_stream
 

Macros

#define MAX_TIMING_POINT   16
 

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_TimeGet (vlc_aout_stream *stream, vlc_tick_t *delay)
 
static void stream_Discontinuity (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. More...
 
void vlc_aout_stream_Delete (vlc_aout_stream *stream)
 Stops all plugins involved in the audio output. More...
 
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. More...
 
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 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_ReadTimingPoints (vlc_aout_stream *stream)
 
void vlc_aout_stream_UpdateLatency (vlc_aout_stream *stream)
 
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

◆ MAX_TIMING_POINT

#define MAX_TIMING_POINT   16

Function Documentation

◆ aout_stream_aout()

◆ aout_stream_owner()

◆ aout_stream_tracer()

◆ stream_CheckReady()

◆ stream_Discontinuity()

◆ stream_HandleDrift()

◆ stream_ReadTimingPoints()

◆ stream_Reset()

◆ stream_Silence()

◆ stream_StopResampling()

◆ stream_Synchronize()

static void stream_Synchronize ( vlc_aout_stream stream,
vlc_tick_t  system_now,
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 vlc_aout_stream::clock, vlc_aout_stream::discontinuity, vlc_aout_stream::rate, stream_HandleDrift(), stream_Silence(), stream_TimeGet(), vlc_aout_stream::sync, vlc_clock_ConvertToSystem(), and vlc_clock_Update().

Referenced by vlc_aout_stream_Play().

◆ stream_TimeGet()

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

◆ 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(), timing_point::audio_ts, 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::delay, vlc_aout_stream::drain_deadline, vlc_aout_stream::drained, 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::notify_latency_cb, vlc_aout_stream::notify_latency_cb, vlc_aout_stream_cfg::notify_latency_data, vlc_aout_stream::notify_latency_data, vlc_aout_stream_cfg::profile, vlc_aout_stream::rate, vlc_aout_stream::rate_point, 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_Discontinuity(), vlc_aout_stream::sync, vlc_aout_stream::timing_points, 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_RestartNotify().

◆ vlc_aout_stream_UpdateLatency()

void vlc_aout_stream_UpdateLatency ( vlc_aout_stream stream)