Go to the documentation of this file.
33 # define __VLC_MTIME_H 1
43 #define LAST_MDATE ((vlc_tick_t)((uint64_t)(-1)/2))
48 #if (CLOCK_FREQ % 1000) == 0
49 #define VLC_TICK_FROM_MS(ms) ((CLOCK_FREQ / INT64_C(1000)) * (ms))
50 #define MS_FROM_VLC_TICK(vtk) ((vtk) / (CLOCK_FREQ / INT64_C(1000)))
51 #elif (1000 % CLOCK_FREQ) == 0
52 #define VLC_TICK_FROM_MS(ms) ((ms) / (INT64_C(1000) / CLOCK_FREQ))
53 #define MS_FROM_VLC_TICK(vtk) ((vtk) * (INT64_C(1000) / CLOCK_FREQ))
55 #define VLC_TICK_FROM_MS(ms) (CLOCK_FREQ * (ms) / 1000)
56 #define MS_FROM_VLC_TICK(vtk) ((vtk) * 1000 / CLOCK_FREQ)
63 #define VLC_TICK_FROM_SEC(sec) (CLOCK_FREQ * (sec))
64 #define SEC_FROM_VLC_TICK(vtk) ((vtk) / CLOCK_FREQ)
67 #include <type_traits>
71 ->
typename std::enable_if<std::is_integral<T>::value,
vlc_tick_t>::type
92 #define vlc_tick_from_sec(sec) _Generic((sec), \
93 double: vlc_tick_from_secf(sec), \
94 float: vlc_tick_from_secf(sec), \
95 default: vlc_tick_from_seci(sec) )
112 #define MSTRTIME_MAX_SIZE 22
static double secf_from_vlc_tick(vlc_tick_t vtk)
Definition: vlc_mtime.h:98
void date_Set(date_t *, vlc_tick_t)
Set the date value of a date_t.
Definition: mtime.c:115
#define VLC_API
Definition: fourcc_gen.c:30
uint32_t i_divider_num
Definition: vlc_mtime.h:122
char * secstotimestr(char *psz_buffer, int32_t secs)
Convert seconds to a time in the format h:mm:ss.
Definition: mtime.c:49
uint32_t i_remainder
Definition: vlc_mtime.h:124
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_common.h:152
uint32_t i_divider_den
Definition: vlc_mtime.h:123
#define CLOCK_FREQ
Definition: vlc_config.h:45
void date_Change(date_t *, uint32_t, uint32_t)
Change a date_t.
Definition: mtime.c:101
Definition: vlc_mtime.h:118
static vlc_tick_t vlc_tick_from_seci(int64_t sec)
Definition: vlc_mtime.h:81
uint64_t NTPtime64(void)
Definition: mtime.c:201
vlc_tick_t date_Increment(date_t *, uint32_t)
Increment the date and return the result, taking into account rounding errors.
Definition: mtime.c:151
vlc_tick_t date_Get(const date_t *)
Get the date of a date_t.
Definition: mtime.c:127
vlc_tick_t date
Definition: vlc_mtime.h:121
static vlc_tick_t vlc_tick_from_secf(double secf)
Definition: vlc_mtime.h:86
vlc_tick_t date_Decrement(date_t *, uint32_t)
Decrement the date and return the result, taking into account rounding errors.
Definition: mtime.c:179
void date_Init(date_t *, uint32_t, uint32_t)
Initialize a date_t.
Definition: mtime.c:85
#define vlc_tick_from_sec(sec)
Definition: vlc_mtime.h:91
void date_Move(date_t *, vlc_tick_t)
Move forwards or backwards the date of a date_t.
Definition: mtime.c:138