![]() |
libgpac
Documentation of the core library of GPAC
|
Time manipulation tools. More...
Macros | |
#define | GF_NTP_SEC_1900_TO_1970 |
NTP seconds from 1900 to 1970. More... | |
Functions | |
void | gf_utc_time_since_1970 (u32 *sec, u32 *msec) |
gets UTC time More... | |
void | gf_net_get_ntp (u32 *sec, u32 *frac) |
gets NTP time More... | |
u64 | gf_net_get_ntp_ms () |
gets NTP time in milliseconds More... | |
void | gf_net_set_ntp_shift (s32 sec) |
offsets NTP time by a given amount of seconds More... | |
u64 | gf_net_get_ntp_ts () |
gets NTP time More... | |
s32 | gf_net_get_ntp_diff_ms (u64 ntp) |
GF_EXPORT u64 | gf_net_ntp_add_usec (u64 ntp, s32 usec) |
s32 | gf_net_ntp_diff_ms (u64 ntp_a, u64 ntp_b) |
const char * | gf_errno_str (int errnoval) |
error code description More... | |
GF_Err | gf_net_reload_netcap () |
reloads netcap filters More... | |
u32 | gf_sys_clock () |
System clock query. More... | |
u64 | gf_sys_clock_high_res () |
High precision system clock query. More... | |
void | gf_sleep (u32 ms) |
Sleeps thread/process. More... | |
u64 | gf_net_get_utc () |
gets UTC time in milliseconds More... | |
u64 | gf_net_ntp_to_utc (u64 ntp) |
converts an ntp timestamp into UTC time in milliseconds More... | |
u64 | gf_net_parse_date (const char *date) |
parses date More... | |
u64 | gf_net_get_utc_ts (u32 year, u32 month, u32 day, u32 hour, u32 min, u32 sec) |
returns 64-bit UTC timestamp from year, month, day, hour, min and sec More... | |
s32 | gf_net_get_timezone () |
gets timezone adjustment in seconds More... | |
Bool | gf_net_time_is_dst () |
gets timezone daylight saving time status More... | |
struct tm * | gf_gmtime (const time_t *time) |
gets time from UTC timestamp More... | |
Time manipulation tools.
#define GF_NTP_SEC_1900_TO_1970 |
NTP seconds from 1900 to 1970.
Macro giving the number of seconds from 1900 to 1970
gets UTC time
Gets UTC time since midnight Jan 1970
sec | number of seconds |
msec | number of milliseconds |
gets NTP time
Gets NTP (Network Time Protocol) in seconds and fractional side
sec | NTP time in seconds |
frac | fractional NTP time expressed in 1 / (1<<32 - 1) seconds units |
u64 gf_net_get_ntp_ms | ( | ) |
gets NTP time in milliseconds
void gf_net_set_ntp_shift | ( | s32 | sec | ) |
offsets NTP time by a given amount of seconds
Offsets NTP time of the system by a given amount of seconds in the future or the past (default value is 0).
sec | seconds to add or remove to the system NTP |
u64 gf_net_get_ntp_ts | ( | ) |
gets NTP time
Gets NTP (Network Time Protocol) timestamp (high 32 bit is seconds, low 32 bit is fraction)
Gets diff in milliseconds between NTP time and current time
ntp | NTP timestamp |
Adds or remove a given amount of microseconds to an NTP timestamp
ntp | NTP timestamp |
usec | microseconds to add/remove |
Gets diff in milliseconds between two NTP times time and current time
ntp_a | first NTP timestamp |
ntp_b | second NTP timestamp |
const char* gf_errno_str | ( | int | errnoval | ) |
error code description
Returns text description of given errno code
errnoval | the error value to test |
GF_Err gf_net_reload_netcap | ( | ) |
reloads netcap filters
Reloads netcap filters, closing all attached files and deassociating sockets - this should only be done called when reloading a session
u32 gf_sys_clock | ( | ) |
System clock query.
Gets the system clock time.
u64 gf_sys_clock_high_res | ( | ) |
High precision system clock query.
Gets the hight precision system clock time.
void gf_sleep | ( | u32 | ms | ) |
Sleeps thread/process.
Locks calling thread/process execution for a given time.
ms | Amount of time to sleep in milliseconds. |
u64 gf_net_get_utc | ( | ) |
gets UTC time in milliseconds
Gets UTC clock in milliseconds
converts an ntp timestamp into UTC time in milliseconds
Converts NTP 64-bit timestamp to UTC clock in milliseconds
ntp | NTP timestamp |
u64 gf_net_parse_date | ( | const char * | date | ) |
parses date
Parses date and gets UTC value for this date. Date format is an XSD dateTime format or any of the supported formats from HTTP 1.1: Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() formatgets UTC time in milliseconds
date | string containing the date to parse |
returns 64-bit UTC timestamp from year, month, day, hour, min and sec
year | the year |
month | the month, from 0 to 11 |
day | the day |
hour | the hour |
min | the min |
sec | the sec |
s32 gf_net_get_timezone | ( | ) |
gets timezone adjustment in seconds
Gets timezone adjustment in seconds, with localtime - timezone = UTC time
Bool gf_net_time_is_dst | ( | ) |
gets timezone daylight saving time status
Gets timezone daylight saving time
struct tm* gf_gmtime | ( | const time_t * | time | ) |
gets time from UTC timestamp
Gets time from UTC timestamp
time | timestamp value - see gmtime |