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

Functions

char * vlc_tick_to_str (char *psz_buffer, vlc_tick_t ticks)
 Convert seconds to a time in the format h:mm:ss.
 
void date_Init (date_t *p_date, uint32_t i_divider_n, uint32_t i_divider_d)
 
void date_Change (date_t *p_date, uint32_t i_divider_n, uint32_t i_divider_d)
 
vlc_tick_t date_Increment (date_t *p_date, uint32_t i_nb_samples)
 
vlc_tick_t date_Decrement (date_t *p_date, uint32_t i_nb_samples)
 
uint64_t vlc_ntp_time (void)
 Gets the current wallclock time as 64-bit NTP timestamp.
 
struct timespecvlc_tick_to_timespec (struct timespec *restrict ts, vlc_tick_t tick)
 Converts a VLC tick to a POSIX time specification.
 

Function Documentation

◆ date_Change()

void date_Change ( date_t p_date,
uint32_t  i_divider_n,
uint32_t  i_divider_d 
)

◆ date_Decrement()

vlc_tick_t date_Decrement ( date_t p_date,
uint32_t  i_nb_samples 
)

◆ date_Increment()

◆ date_Init()

void date_Init ( date_t p_date,
uint32_t  i_divider_n,
uint32_t  i_divider_d 
)

◆ vlc_ntp_time()

uint64_t vlc_ntp_time ( void  )

Gets the current wallclock time as 64-bit NTP timestamp.

Returns
NTP 64-bits timestamp in host byte order

References TIME_UTC, timespec_get(), timespec::tv_nsec, and timespec::tv_sec.

◆ vlc_tick_to_str()

char * vlc_tick_to_str ( char *  psz_buffer,
vlc_tick_t  ticks 
)

Convert seconds to a time in the format h:mm:ss.

This function is provided for any interface function which need to print a time string in the format h:mm:ss date.

Parameters
ticksthe time to be converted
psz_buffershould be a buffer at least MSTRTIME_MAX_SIZE characters
Returns
psz_buffer is returned so this can be used as printf parameter.

References MSTRTIME_MAX_SIZE, SEC_FROM_VLC_TICK, unlikely, and vlc_tick_to_str().

Referenced by input_title_GetName(), vlc_player_osd_Position(), and vlc_tick_to_str().

◆ vlc_tick_to_timespec()

struct timespec * vlc_tick_to_timespec ( struct timespec *restrict  ts,
vlc_tick_t  tick 
)

Converts a VLC tick to a POSIX time specification.

Parameters
ts[out] storage space for the time specification
tickVLC tick
Returns
ts

References CLOCK_FREQ, lldiv(), NS_FROM_VLC_TICK, lldiv_t::quot, and lldiv_t::rem.

Referenced by vlc_atomic_timedwait(), vlc_atomic_timedwait(), vlc_tick_sleep(), and vlc_tick_wait().