Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
ilink_meter.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_packet/ilink_meter.h
10//! @brief Link meter interface.
11
12#ifndef ROC_PACKET_ILINK_METER_H_
13#define ROC_PACKET_ILINK_METER_H_
14
15#include "roc_core/stddefs.h"
16#include "roc_core/time.h"
17#include "roc_packet/units.h"
18
19namespace roc {
20namespace packet {
21
22//! Link metrics.
24 //! Extended lowest RTP seqnum received.
25 //! The low 16 bits contain the lowest sequence number received in an RTP data
26 //! packet, and the rest bits extend that sequence number with the corresponding
27 //! count of seqnum cycles.
29
30 //! Extended highest RTP seqnum received.
31 //! The low 16 bits contain the highest sequence number received in an RTP data
32 //! packet, and the rest bits extend that sequence number with the corresponding
33 //! count of seqnum cycles.
35
36 //! Total amount of packets sent or expected to be received.
37 //! On sender, this counter is just incremented every packet.
38 //! On receiver, it is derived from seqnums.
39 uint64_t total_packets;
40
41 //! Cumulative count of lost packets.
42 //! The total number of RTP data packets that have been lost since the beginning
43 //! of reception. Defined to be the number of packets expected minus the number of
44 //! packets actually received, where the number of packets received includes any
45 //! which are late or duplicates. Packets that arrive late are not counted as lost,
46 //! and the loss may be negative if there are duplicates.
47 int64_t lost_packets;
48
49 //! Estimated interarrival jitter.
50 //! An estimate of the statistical variance of the RTP data packet
51 //! interarrival time.
53
54 //! Estimated round-trip time between sender and receiver.
55 //! Computed based on NTP-like timestamp exchange implemennted by RTCP protocol.
56 //! Read-only field. You can read it on sender, but you should not set
57 //! it on receiver.
59
63 , total_packets(0)
64 , lost_packets(0)
65 , jitter(0)
66 , rtt(0) {
67 }
68};
69
70//! Link meter interface.
72public:
73 virtual ~ILinkMeter();
74
75 //! Check if metrics are available.
76 virtual bool has_metrics() const = 0;
77
78 //! Get metrics.
79 virtual const LinkMetrics& metrics() const = 0;
80};
81
82} // namespace packet
83} // namespace roc
84
85#endif // ROC_PACKET_ILINK_METER_H_
Link meter interface.
Definition ilink_meter.h:71
virtual const LinkMetrics & metrics() const =0
Get metrics.
virtual bool has_metrics() const =0
Check if metrics are available.
int64_t nanoseconds_t
Nanoseconds.
Definition time.h:58
uint32_t ext_seqnum_t
Extended sequence number.
Definition units.h:103
Root namespace.
Commonly used types and functions.
core::nanoseconds_t jitter
Estimated interarrival jitter. An estimate of the statistical variance of the RTP data packet interar...
Definition ilink_meter.h:52
core::nanoseconds_t rtt
Estimated round-trip time between sender and receiver. Computed based on NTP-like timestamp exchange ...
Definition ilink_meter.h:58
packet::ext_seqnum_t ext_last_seqnum
Extended highest RTP seqnum received. The low 16 bits contain the highest sequence number received in...
Definition ilink_meter.h:34
int64_t lost_packets
Cumulative count of lost packets. The total number of RTP data packets that have been lost since the ...
Definition ilink_meter.h:47
packet::ext_seqnum_t ext_first_seqnum
Extended lowest RTP seqnum received. The low 16 bits contain the lowest sequence number received in a...
Definition ilink_meter.h:28
uint64_t total_packets
Total amount of packets sent or expected to be received. On sender, this counter is just incremented ...
Definition ilink_meter.h:39
Time definitions.
Various units used in packets.