VLC 4.0.0-dev
|
Data Structures | |
struct | vlc_player_timer_point |
Player timer point. More... | |
struct | vlc_player_timer_smpte_timecode |
Player smpte timecode. More... | |
struct | vlc_player_timer_cbs |
Player timer callbacks. More... | |
struct | vlc_player_timer_smpte_cbs |
Player smpte timer callbacks. More... | |
Typedefs | |
typedef struct vlc_player_timer_id | vlc_player_timer_id |
Player timer opaque structure. | |
Functions | |
vlc_player_timer_id * | vlc_player_AddTimer (vlc_player_t *player, vlc_tick_t min_period, const struct vlc_player_timer_cbs *cbs, void *cbs_data) |
Add a timer in order to get times updates. | |
vlc_player_timer_id * | vlc_player_AddSmpteTimer (vlc_player_t *player, const struct vlc_player_timer_smpte_cbs *cbs, void *cbs_data) |
Add a smpte timer in order to get accurate video frame updates. | |
void | vlc_player_RemoveTimer (vlc_player_t *player, vlc_player_timer_id *timer) |
Remove a player timer. | |
int | vlc_player_timer_point_Interpolate (const struct vlc_player_timer_point *point, vlc_tick_t system_now, vlc_tick_t *out_ts, double *out_pos) |
Interpolate the last timer value to now. | |
vlc_tick_t | vlc_player_timer_point_GetNextIntervalDate (const struct vlc_player_timer_point *point, vlc_tick_t system_now, vlc_tick_t interpolated_ts, vlc_tick_t next_interval) |
Get the date of the next interval. | |
typedef struct vlc_player_timer_id vlc_player_timer_id |
Player timer opaque structure.
vlc_player_timer_id * vlc_player_AddSmpteTimer | ( | vlc_player_t * | player, |
const struct vlc_player_timer_smpte_cbs * | cbs, | ||
void * | cbs_data | ||
) |
Add a smpte timer in order to get accurate video frame updates.
player | player instance (locked or not) |
cbs | pointer to a vlc_player_timer_smpte_cbs structure, the structure must be valid during the lifetime of the player |
cbs_data | opaque pointer used by the callbacks |
References vlc_player_timer_id::cbs, vlc_player_timer_id::data, vlc_player_timer_id::last_update_date, vlc_player_timer::lock, vlc_player_timer_id::node, vlc_player_timer_cbs::on_update, vlc_player_timer_id::period, vlc_player_timer_id::smpte_cbs, vlc_player_t::timer, vlc_list_append(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_TICK_INVALID.
vlc_player_timer_id * vlc_player_AddTimer | ( | vlc_player_t * | player, |
vlc_tick_t | min_period, | ||
const struct vlc_player_timer_cbs * | cbs, | ||
void * | cbs_data | ||
) |
Add a timer in order to get times updates.
player | player instance (locked or not) |
min_period | corresponds to the minimum period between each updates, use it to avoid flood from too many source updates, set it to VLC_TICK_INVALID to receive all updates. |
cbs | pointer to a vlc_player_timer_cbs structure, the structure must be valid during the lifetime of the player |
cbs_data | opaque pointer used by the callbacks |
References vlc_player_timer_id::cbs, vlc_player_timer_id::data, vlc_player_timer_id::last_update_date, vlc_player_timer::lock, vlc_player_timer_id::node, vlc_player_timer_cbs::on_update, vlc_player_timer_id::period, vlc_player_t::timer, vlc_list_append(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_TICK_0, and VLC_TICK_INVALID.
void vlc_player_RemoveTimer | ( | vlc_player_t * | player, |
vlc_player_timer_id * | timer | ||
) |
Remove a player timer.
player | player instance (locked or not) |
timer | timer created by vlc_player_AddTimer() |
References vlc_player_timer::lock, vlc_player_timer_id::node, vlc_player_t::timer, vlc_list_remove(), vlc_mutex_lock(), and vlc_mutex_unlock().
vlc_tick_t vlc_player_timer_point_GetNextIntervalDate | ( | const struct vlc_player_timer_point * | point, |
vlc_tick_t | system_now, | ||
vlc_tick_t | interpolated_ts, | ||
vlc_tick_t | next_interval | ||
) |
Get the date of the next interval.
Can be used to setup an UI timer in order to update some widgets at specific interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a time widget when the media reaches a new second.
point | time update obtained via the vlc_player_timer_cbs.on_update() |
system_now | current system date |
interpolated_ts | ts returned by vlc_player_timer_point_Interpolate() with the same system now |
next_interval | next interval |
References vlc_player_timer_point::rate, and VLC_TICK_INVALID.
int vlc_player_timer_point_Interpolate | ( | const struct vlc_player_timer_point * | point, |
vlc_tick_t | system_now, | ||
vlc_tick_t * | out_ts, | ||
double * | out_pos | ||
) |
Interpolate the last timer value to now.
point | time update obtained via the vlc_player_timer_cbs.on_update() callback |
system_now | current system date |
out_ts | pointer where to set the interpolated ts, subtract this time with VLC_TICK_0 to get the original value. |
out_pos | pointer where to set the interpolated position |
References vlc_player_timer_point::length, vlc_player_timer_point::position, vlc_player_timer_point::rate, vlc_player_timer_point::system_date, vlc_player_timer_point::ts, unlikely, VLC_EGENERIC, VLC_SUCCESS, VLC_TICK_0, VLC_TICK_INVALID, and VLC_TICK_MAX.
Referenced by vlc_player_GetTimerPoint().