VLC 4.0.0-dev
Loading...
Searching...
No Matches
Tracks synchronisation (delay)
Collaboration diagram for Tracks synchronisation (delay):

Functions

vlc_tick_t vlc_player_GetCategoryDelay (vlc_player_t *player, enum es_format_category_e cat)
 Get the delay of an ES category for the current media.
 
int vlc_player_SetCategoryDelay (vlc_player_t *player, enum es_format_category_e cat, vlc_tick_t delay, enum vlc_player_whence whence)
 Set the delay of one category for the current media.
 
vlc_tick_t vlc_player_GetEsIdDelay (vlc_player_t *player, vlc_es_id_t *es_id)
 Get the delay of a track.
 
int vlc_player_SetEsIdDelay (vlc_player_t *player, vlc_es_id_t *es_id, vlc_tick_t delay, enum vlc_player_whence whence)
 Set the delay of one track.
 
static vlc_tick_t vlc_player_GetAudioDelay (vlc_player_t *player)
 Helper to get the audio delay.
 
static void vlc_player_SetAudioDelay (vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
 Helper to set the audio delay.
 
static vlc_tick_t vlc_player_GetVideoDelay (vlc_player_t *player)
 Helper to get the audio delay.
 
static void vlc_player_SetVideoDelay (vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
 Helper to set the audio delay.
 
static vlc_tick_t vlc_player_GetSubtitleDelay (vlc_player_t *player)
 Helper to get the subtitle delay.
 
static void vlc_player_SetSubtitleDelay (vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
 Helper to set the subtitle delay.
 
void vlc_player_SetAssociatedSubsFPS (vlc_player_t *player, float fps)
 Set the associated subtitle FPS.
 
float vlc_player_GetAssociatedSubsFPS (vlc_player_t *player)
 Get the associated subtitle FPS.
 

Detailed Description

Function Documentation

◆ vlc_player_GetAssociatedSubsFPS()

float vlc_player_GetAssociatedSubsFPS ( vlc_player_t player)

Get the associated subtitle FPS.

Parameters
playerlocked player instance
Returns
fps

References vlc_player_input::player, var_GetFloat(), and vlc_player_assert_locked().

◆ vlc_player_GetAudioDelay()

static vlc_tick_t vlc_player_GetAudioDelay ( vlc_player_t player)
inlinestatic

Helper to get the audio delay.

References AUDIO_ES, and vlc_player_GetCategoryDelay().

◆ vlc_player_GetCategoryDelay()

vlc_tick_t vlc_player_GetCategoryDelay ( vlc_player_t player,
enum es_format_category_e  cat 
)

Get the delay of an ES category for the current media.

See also
vlc_player_cbs.on_category_delay_changed
Parameters
playerlocked player instance
catAUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
Returns
a valid delay or 0

References AUDIO_ES, vlc_player_input::cat_delays, vlc_player_input::player, SPU_ES, and vlc_player_get_input_locked().

Referenced by vlc_player_GetAudioDelay(), vlc_player_GetSubtitleDelay(), and vlc_player_GetVideoDelay().

◆ vlc_player_GetEsIdDelay()

vlc_tick_t vlc_player_GetEsIdDelay ( vlc_player_t player,
vlc_es_id_t es_id 
)

Get the delay of a track.

See also
vlc_player_cbs.on_track_delay_changed
Parameters
playerlocked player instance
es_idan ES ID (retrieved from vlc_player_cbs.on_track_list_changed or vlc_player_GetTrackAt())
Returns
a valid delay or INT64_MAX is no delay is set for this track

References vlc_player_track_priv::delay, vlc_player_input::player, vlc_player_get_input_locked(), vlc_player_input_FindTrackById(), and VLC_TICK_MAX.

◆ vlc_player_GetSubtitleDelay()

static vlc_tick_t vlc_player_GetSubtitleDelay ( vlc_player_t player)
inlinestatic

Helper to get the subtitle delay.

References SPU_ES, and vlc_player_GetCategoryDelay().

◆ vlc_player_GetVideoDelay()

static vlc_tick_t vlc_player_GetVideoDelay ( vlc_player_t player)
inlinestatic

Helper to get the audio delay.

References VIDEO_ES, and vlc_player_GetCategoryDelay().

◆ vlc_player_SetAssociatedSubsFPS()

void vlc_player_SetAssociatedSubsFPS ( vlc_player_t player,
float  fps 
)

Set the associated subtitle FPS.

In order to correct the rate of the associated media according to this FPS and the media video FPS.

Note
A successful call will trigger the vlc_player_cbs.on_associated_subs_fps_changed event.
Warning
this function will change the rate of all external subtitle files associated with the current media.
Parameters
playerlocked player instance
fpsFPS of the subtitle file

References INPUT_CONTROL_SET_SUBS_FPS, input_ControlPushHelper(), vlc_player_input::player, vlc_player_input::thread, var_SetFloat(), vlc_player_get_input_locked(), and vlc_player_SendEvent.

◆ vlc_player_SetAudioDelay()

static void vlc_player_SetAudioDelay ( vlc_player_t player,
vlc_tick_t  delay,
enum vlc_player_whence  whence 
)
inlinestatic

Helper to set the audio delay.

References AUDIO_ES, and vlc_player_SetCategoryDelay().

◆ vlc_player_SetCategoryDelay()

int vlc_player_SetCategoryDelay ( vlc_player_t player,
enum es_format_category_e  cat,
vlc_tick_t  delay,
enum vlc_player_whence  whence 
)

Set the delay of one category for the current media.

Note
A successful call will trigger the vlc_player_cbs.on_category_delay_changed event.
Warning
This has no effect on tracks where the delay was set by vlc_player_SetEsIdDelay()
Parameters
playerlocked player instance
catAUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
delaya valid time
whenceabsolute or relative
Returns
VLC_SUCCESS or VLC_EGENERIC if the category is not handled

References _, AUDIO_ES, vlc_player_input::cat_delays, es_format_category_to_string(), input_SetEsCatDelay(), MS_FROM_VLC_TICK, vlc_player_input::player, SPU_ES, vlc_player_input::thread, VIDEO_ES, VLC_EGENERIC, vlc_player_get_input_locked(), vlc_player_osd_Message(), vlc_player_SendEvent, VLC_PLAYER_WHENCE_ABSOLUTE, and VLC_SUCCESS.

Referenced by vlc_player_SetAudioDelay(), vlc_player_SetSubtitleDelay(), and vlc_player_SetVideoDelay().

◆ vlc_player_SetEsIdDelay()

int vlc_player_SetEsIdDelay ( vlc_player_t player,
vlc_es_id_t es_id,
vlc_tick_t  delay,
enum vlc_player_whence  whence 
)

Set the delay of one track.

Note
A successful call will trigger the vlc_player_cbs.on_track_delay_changed event.
Warning
Setting the delay of one specific track will override previous and future changes of delay made by vlc_player_SetCategoryDelay()
Parameters
playerlocked player instance
es_idan ES ID (retrieved from vlc_player_cbs.on_track_list_changed or vlc_player_GetTrackAt())
delaya valid time or INT64_MAX to use default category delay
whenceabsolute or relative
Returns
VLC_SUCCESS or VLC_EGENERIC if the category of the es_id is not handled (VIDEO_ES not supported yet)

References _, AUDIO_ES, vlc_player_track_priv::delay, input_control_param_t::es_delay, vlc_player_track::fmt, es_format_t::i_cat, INPUT_CONTROL_SET_ES_DELAY, input_ControlPush(), MS_FROM_VLC_TICK, vlc_player_track::name, vlc_player_input::player, SPU_ES, vlc_player_track_priv::t, vlc_player_input::thread, VLC_EGENERIC, vlc_player_get_input_locked(), vlc_player_input_FindTrackById(), vlc_player_osd_Message(), vlc_player_SendEvent, VLC_PLAYER_WHENCE_ABSOLUTE, VLC_SUCCESS, and VLC_TICK_MAX.

◆ vlc_player_SetSubtitleDelay()

static void vlc_player_SetSubtitleDelay ( vlc_player_t player,
vlc_tick_t  delay,
enum vlc_player_whence  whence 
)
inlinestatic

Helper to set the subtitle delay.

References SPU_ES, and vlc_player_SetCategoryDelay().

◆ vlc_player_SetVideoDelay()

static void vlc_player_SetVideoDelay ( vlc_player_t player,
vlc_tick_t  delay,
enum vlc_player_whence  whence 
)
inlinestatic

Helper to set the audio delay.

References VIDEO_ES, and vlc_player_SetCategoryDelay().