VLC  4.0.0-dev
Functions
Tracks synchronisation (delay)
Collaboration diagram for Tracks synchronisation (delay):

Functions

VLC_EXPORT 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. More...
 
VLC_EXPORT 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. More...
 
VLC_EXPORT vlc_tick_t vlc_player_GetEsIdDelay (vlc_player_t *player, vlc_es_id_t *es_id)
 Get the delay of a track. More...
 
VLC_EXPORT 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. More...
 
static vlc_tick_t vlc_player_GetAudioDelay (vlc_player_t *player)
 Helper to get the audio delay. More...
 
static void vlc_player_SetAudioDelay (vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
 Helper to set the audio delay. More...
 
static vlc_tick_t vlc_player_GetSubtitleDelay (vlc_player_t *player)
 Helper to get the subtitle delay. More...
 
static void vlc_player_SetSubtitleDelay (vlc_player_t *player, vlc_tick_t delay, enum vlc_player_whence whence)
 Helper to set the subtitle delay. More...
 
VLC_EXPORT void vlc_player_SetAssociatedSubsFPS (vlc_player_t *player, float fps)
 Set the associated subtitle FPS. More...
 
VLC_EXPORT float vlc_player_GetAssociatedSubsFPS (vlc_player_t *player)
 Get the associated subtitle FPS. More...
 

Detailed Description

Function Documentation

◆ vlc_player_GetAssociatedSubsFPS()

VLC_EXPORT 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_EXPORT 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(), and vlc_player_GetSubtitleDelay().

◆ vlc_player_GetEsIdDelay()

VLC_EXPORT 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
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(), and vlc_player_input_FindTrackById().

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

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

VLC_EXPORT 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, input_control_param_t::cat_delay, vlc_player_input::cat_delays, es_format_category_to_string(), INPUT_CONTROL_SET_CATEGORY_DELAY, input_ControlPush(), MS_FROM_VLC_TICK, vlc_player_input::player, SPU_ES, vlc_player_input::thread, 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(), and vlc_player_SetSubtitleDelay().

◆ vlc_player_SetEsIdDelay()

VLC_EXPORT 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
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, and VLC_SUCCESS.

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