![]() |
libgpac
Documentation of the core library of GPAC
|
Time manipulation tools. More...
Collaboration diagram for Local and Network time:Macros | |
| #define | GF_NTP_SEC_1900_TO_1970 |
| NTP seconds from 1900 to 1970. | |
Functions | |
| void | gf_utc_time_since_1970 (u32 *sec, u32 *msec) |
| gets UTC time | |
| void | gf_net_get_ntp (u32 *sec, u32 *frac) |
| gets NTP time | |
| 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 | |
| u64 | gf_net_get_ntp_ts () |
| gets NTP time | |
| 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 | |
| GF_Err | gf_net_reload_netcap () |
| reloads netcap filters | |
| u32 | gf_sys_clock () |
| System clock query. | |
| u64 | gf_sys_clock_high_res () |
| High precision system clock query. | |
| void | gf_sleep (u32 ms) |
| Sleeps thread/process. | |
| u64 | gf_net_get_utc () |
| gets UTC time in milliseconds | |
| u64 | gf_net_ntp_to_utc (u64 ntp) |
| converts an ntp timestamp into UTC time in milliseconds | |
| u64 | gf_net_parse_date (const char *date) |
| parses date | |
| 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 | |
| s32 | gf_net_get_timezone () |
| gets timezone adjustment in seconds | |
| Bool | gf_net_time_is_dst () |
| gets timezone daylight saving time status | |
| struct tm * | gf_gmtime (const time_t *time) |
| gets time from UTC timestamp | |
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 |
Here is the caller graph for this function: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 |
Here is the caller graph for this function:| u64 gf_net_get_ntp_ms | ( | ) |
gets NTP time in milliseconds
Here is the call graph for this function:
Here is the caller graph for this function:| 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 |
Here is the caller graph for this function:| 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)
Here is the call graph for this function:
Here is the caller graph for this function:Gets diff in milliseconds between NTP time and current time
| ntp | NTP timestamp |
Here is the call graph for this function:
Here is the caller graph for this function:Adds or remove a given amount of microseconds to an NTP timestamp
| ntp | NTP timestamp |
| usec | microseconds to add/remove |
Here is the caller graph for this function:Gets diff in milliseconds between two NTP times time and current time
| ntp_a | first NTP timestamp |
| ntp_b | second NTP timestamp |
Here is the caller graph for this function:| const char * gf_errno_str | ( | int | errnoval | ) |
error code description
Returns text description of given errno code
| errnoval | the error value to test |
Here is the caller graph for this function:| 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
Here is the call graph for this function:| u32 gf_sys_clock | ( | ) |
System clock query.
Gets the system clock time.
Here is the caller graph for this function:| u64 gf_sys_clock_high_res | ( | ) |
High precision system clock query.
Gets the hight precision system clock time.
Here is the caller graph for this function:| 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. |
Here is the call graph for this function:
Here is the caller graph for this function:| u64 gf_net_get_utc | ( | ) |
gets UTC time in milliseconds
Gets UTC clock in milliseconds
Here is the call graph for this function:
Here is the caller graph for this function:converts an ntp timestamp into UTC time in milliseconds
Converts NTP 64-bit timestamp to UTC clock in milliseconds
| ntp | NTP timestamp |
Here is the caller graph for this function:| 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 |
Here is the call graph for this function:
Here is the caller graph for this function: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 |
Here is the call graph for this function:
Here is the caller graph for this function:| s32 gf_net_get_timezone | ( | ) |
gets timezone adjustment in seconds
Gets timezone adjustment in seconds, with localtime - timezone = UTC time
Here is the call graph for this function:
Here is the caller graph for this function:| Bool gf_net_time_is_dst | ( | ) |
gets timezone daylight saving time status
Gets timezone daylight saving time
Here is the caller graph for this function:| struct tm * gf_gmtime | ( | const time_t * | time | ) |
gets time from UTC timestamp
Gets time from UTC timestamp
| time | timestamp value - see gmtime |
Here is the caller graph for this function: