upipe/uclock.h header reference
structure provided by the application to retrieve system time More
Header inclusion [link]
Members [link]
Type [link]
- struct uclock_brokendown
Functions [link]
- struct uclock_brokendown uclock_breakdown(uint64_t date)
- double uclock_diff_to_ms(int64_t diff)
- uint64_t uclock_from_real(struct uclock *uclock, uint64_t real)
- uint64_t uclock_now(struct uclock *uclock)
- void uclock_release(struct uclock *uclock)
- uint64_t uclock_to_real(struct uclock *uclock, uint64_t systime)
- struct uclock * uclock_use(struct uclock *uclock)
Macros [link]
Description [link]
structure provided by the application to retrieve system time
Members detail [link]
#define UCLOCK_FREQ [link]
This macro is declared in upipe/uclock.h source file, line 44.
This macro represents the Upipe clock frequency.
#define UCLOCK_HOUR [link]
This macro is declared in upipe/uclock.h source file, line 55.
This macro is the number of clock ticks in a hour
#define UCLOCK_MICROSECOND [link]
This macro is declared in upipe/uclock.h source file, line 47.
This macro is the number of clock ticks in a microsecond
#define UCLOCK_MILLISECOND [link]
This macro is declared in upipe/uclock.h source file, line 49.
This macro is the number of clock ticks in a millisecond
#define UCLOCK_MINUTE [link]
This macro is declared in upipe/uclock.h source file, line 53.
This macro is the number of clock ticks in a minute
#define UCLOCK_SECOND [link]
This macro is declared in upipe/uclock.h source file, line 51.
This macro is the number of clock ticks in a second
#define _UPIPE_UCLOCK_H_ [link]
This macro is declared in upipe/uclock.h source file, line 31.
struct uclock [link]
This struct is declared in upipe/uprobe_uclock.h source file, line 42.
| Field | Description |
|---|---|
| struct urefcount * refcount; | pointer to refcount management structure |
| uint64_t (*uclock_now)(struct uclock *) ; | function returning the current system time |
| uint64_t (*uclock_to_real)(struct uclock *, uint64_t ) ; | function converting a system time to Epoch-based real time |
| uint64_t (*uclock_from_real)(struct uclock *, uint64_t ) ; | function converting Epoch-based real time to system time |
struct uclock_brokendown uclock_breakdown(uint64_t date) [link]
This function is declared in upipe/uclock.h source file, line 164.
This function breaks down an uclock date.
Parameter list:
- date: date in 27MHz ticks
The return value is a broken-down representation
struct uclock_brokendown [link]
This struct is declared in upipe/uclock.h source file, line 145.
This struct stores a broken-down uclock date.
| Field | Description |
|---|---|
| uint32_t hours; | hours |
| uint8_t minutes; | minutes |
| uint8_t seconds; | seconds |
| uint16_t milliseconds; | milliseconds |
| uint16_t ticks; | 27MHz ticks |
double uclock_diff_to_ms(int64_t diff) [link]
This function is declared in upipe/uclock.h source file, line 64.
This function converts an uclock difference to millisecond.
Parameter list:
- diff: difference in 27MHz ticks
The return value is the difference in millisecond
This function is declared in upipe/uclock.h source file, line 115.
This function converts Epoch-based real time (from * 1970-01-01 00:00:00 +0000) to real time. The scale has to be passed in units of UCLOCK_FREQ.
Parameter list:
- uclock: pointer to uclock
- real: number of ticks since the Epoch
The return value is system time in 27 MHz ticks, or UINT64_MAX if unsupported
This function is declared in upipe/uclock.h source file, line 88.
This function returns the current system time.
Parameter list:
- uclock: pointer to uclock
The return value is current system time in 27 MHz ticks, or UINT64_MAX in case of error
This function is declared in upipe/uclock.h source file, line 139.
This function decrements the reference count of a uclock or frees it.
Parameter list:
- uclock: pointer to uclock
This function is declared in upipe/uclock.h source file, line 101.
This function converts a system time to Epoch-based real time (from 1970-01-01 00:00:00 +0000). The scale is in units of UCLOCK_FREQ, divide by it to get standard time_t.
Parameter list:
- uclock: pointer to uclock
- systime: system time in 27 MHz ticks
The return value is number of ticks since the Epoch, or UINT64_MAX if unsupported
This function is declared in upipe/uclock.h source file, line 127.
This function increments the reference count of a uclock.
Parameter list:
- uclock: pointer to uclock
The return value is same pointer to uclock