Include dependency graph for vlc_mtime.h:

Go to the source code of this file.
Data Structures | |
| struct | date_t |
Defines | |
| #define | LAST_MDATE ((mtime_t)((uint64_t)(-1)/2)) |
| #define | MSTRTIME_MAX_SIZE 22 |
| #define | MILLISECONDS_PER_SEC 1000 |
| #define | msecstotimestr(psz_buffer, msecs) secstotimestr( psz_buffer, (msecs / (int) MILLISECONDS_PER_SEC) ) |
Functions | |
| char * | mstrtime (char *psz_buffer, mtime_t date) |
| Return a date in a readable format. | |
| mtime_t | mdate (void) |
| Return high precision date. | |
| void | mwait (mtime_t date) |
| Wait for a date. | |
| void | msleep (mtime_t delay) |
| More precise sleep(). | |
| char * | secstotimestr (char *psz_buffer, int secs) |
| Convert seconds to a time in the format h:mm:ss. | |
| void | date_Init (date_t *, uint32_t, uint32_t) |
| Initialize a date_t. | |
| void | date_Change (date_t *, uint32_t, uint32_t) |
| Change a date_t. | |
| void | date_Set (date_t *, mtime_t) |
| Set the date value of a date_t. | |
| mtime_t | date_Get (const date_t *) |
| Get the date of a date_t. | |
| void | date_Move (date_t *, mtime_t) |
| Move forwards or backwards the date of a date_t. | |
| mtime_t | date_Increment (date_t *, uint32_t) |
| Increment the date and return the result, taking into account rounding errors. | |
| uint64_t | NTPtime64 (void) |
| |
| #define LAST_MDATE ((mtime_t)((uint64_t)(-1)/2)) |
| #define MILLISECONDS_PER_SEC 1000 |
| #define msecstotimestr | ( | psz_buffer, | |||
| msecs | ) | secstotimestr( psz_buffer, (msecs / (int) MILLISECONDS_PER_SEC) ) |
| #define MSTRTIME_MAX_SIZE 22 |
| void date_Change | ( | date_t * | p_date, | |
| uint32_t | i_divider_n, | |||
| uint32_t | i_divider_d | |||
| ) |
Change a date_t.
| date | to change | |
| divider | (sample rate) numerator | |
| divider | (sample rate) denominator |
Increment the date and return the result, taking into account rounding errors.
| date | to increment | |
| incrementation | in number of samples |
| void date_Init | ( | date_t * | p_date, | |
| uint32_t | i_divider_n, | |||
| uint32_t | i_divider_d | |||
| ) |
Initialize a date_t.
| date | to initialize | |
| divider | (sample rate) numerator | |
| divider | (sample rate) denominator |
| mtime_t mdate | ( | void | ) |
Return high precision date.
Use a 1 MHz clock when possible, or 1 kHz
Beware ! It doesn't reflect the actual date (since epoch), but can be the machine's uptime or anything (when monotonic clock is used)
| void msleep | ( | mtime_t | delay | ) |
More precise sleep().
Portable usleep() function.
| delay | the amount of time to sleep |
| char* mstrtime | ( | char * | psz_buffer, | |
| mtime_t | date | |||
| ) |
Return a date in a readable format.
This function converts a mtime date into a string. psz_buffer should be a buffer long enough to store the formatted date.
| date | to be converted | |
| psz_buffer | should be a buffer at least MSTRTIME_MAX_SIZE characters |
| void mwait | ( | mtime_t | date | ) |
Wait for a date.
This function uses select() and an system date function to wake up at a precise date. It should be used for process synchronization. If current date is posterior to wished date, the function returns immediately.
| date | The date to wake up at |
| uint64_t NTPtime64 | ( | void | ) |
| char* secstotimestr | ( | char * | psz_buffer, | |
| int | 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.
| secs | the date to be converted | |
| psz_buffer | should be a buffer at least MSTRTIME_MAX_SIZE characters |
1.5.1