uvgRTP 4.0.0
An open-source library for RTP/SRTP media delivery
Loading...
Searching...
No Matches
clock.hh
1#pragma once
2
3#include "uvgrtp/export.hh"
4
5
6#include <stdint.h>
7
8
9
10/* Currently this class uses millisecond precision, but it should be updated to use microseconds.
11 * The RTP spec offers a microsecond precision in things like jiffies so we should offer it to users */
12
13namespace uvgrtp {
14 namespace clock {
15
16 /* network time protocol */
17 namespace ntp {
24 UVGRTP_EXPORT uint64_t now();
25
37 UVGRTP_EXPORT uint64_t diff(uint64_t ntp1, uint64_t ntp2);
38
50 UVGRTP_EXPORT uint64_t diff_now(uint64_t then);
51 }
52
53 UVGRTP_EXPORT uint64_t jiffies_to_ms(uint64_t jiffies);
54 }
55}
56
57namespace uvg_rtp = uvgrtp;
UVGRTP_EXPORT uint64_t diff_now(uint64_t then)
Calculate the time difference of two NTP times.
UVGRTP_EXPORT uint64_t now()
Get current time in NTP units.
UVGRTP_EXPORT uint64_t diff(uint64_t ntp1, uint64_t ntp2)
Calculate the time difference of two NTP times.