VLC  4.0.0-dev
Data Structures | Macros | Functions
vlc_mtime.h File Reference
Include dependency graph for vlc_mtime.h:

Go to the source code of this file.

Data Structures

struct  date_t
 Timestamps without long-term rounding errors. More...
 

Macros

#define MSTRTIME_MAX_SIZE   22
 

Functions

char * secstotimestr (char *psz_buffer, int32_t secs)
 Convert seconds to a time in the format h:mm:ss. More...
 
void date_Init (date_t *restrict date, uint32_t num, uint32_t den)
 Initializes a date_t. More...
 
void date_Change (date_t *restrict date, uint32_t num, uint32_t den)
 Changes the rate of a date_t. More...
 
static void date_Set (date_t *restrict date, mtime_t value)
 Sets the exact timestamp of a date_t. More...
 
static mtime_t date_Get (const date_t *restrict date)
 Gets the current timestamp from a date_t. More...
 
mtime_t date_Increment (date_t *restrict date, uint32_t count)
 Increments a date. More...
 
mtime_t date_Decrement (date_t *restrict date, uint32_t count)
 Decrements a date. More...
 
uint64_t NTPtime64 (void)
 

Macro Definition Documentation

◆ MSTRTIME_MAX_SIZE

#define MSTRTIME_MAX_SIZE   22

Function Documentation

◆ NTPtime64()

uint64_t NTPtime64 ( void  )
Returns
NTP 64-bits timestamp in host byte order.

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

Referenced by date_Get(), vlc_rand_bytes(), and vlc_sdp_Start().

◆ secstotimestr()

char* secstotimestr ( char *  psz_buffer,
int32_t  i_seconds 
)

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
secsthe date 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, secstotimestr(), and unlikely.

Referenced by input_ControlVarNavigation(), and secstotimestr().