Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
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
19
namespace
roc
{
20
namespace
packet
{
21
22
//! Link metrics.
23
struct
LinkMetrics {
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.
28
packet::ext_seqnum_t
ext_first_seqnum
;
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.
34
packet::ext_seqnum_t
ext_last_seqnum
;
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.
52
core::nanoseconds_t
jitter
;
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.
58
core::nanoseconds_t
rtt
;
59
60
LinkMetrics()
61
:
ext_first_seqnum
(0)
62
,
ext_last_seqnum
(0)
63
,
total_packets
(0)
64
,
lost_packets
(0)
65
,
jitter
(0)
66
,
rtt
(0) {
67
}
68
};
69
70
//! Link meter interface.
71
class
ILinkMeter
{
72
public
:
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_
roc::packet::ILinkMeter
Link meter interface.
Definition
ilink_meter.h:71
roc::packet::ILinkMeter::metrics
virtual const LinkMetrics & metrics() const =0
Get metrics.
roc::packet::ILinkMeter::has_metrics
virtual bool has_metrics() const =0
Check if metrics are available.
roc::core::nanoseconds_t
int64_t nanoseconds_t
Nanoseconds.
Definition
time.h:58
roc::packet
Network packets and packet processing.
roc::packet::ext_seqnum_t
uint32_t ext_seqnum_t
Extended sequence number.
Definition
units.h:103
roc
Root namespace.
stddefs.h
Commonly used types and functions.
roc::packet::LinkMetrics
Link metrics.
Definition
ilink_meter.h:23
roc::packet::LinkMetrics::jitter
core::nanoseconds_t jitter
Estimated interarrival jitter. An estimate of the statistical variance of the RTP data packet interar...
Definition
ilink_meter.h:52
roc::packet::LinkMetrics::rtt
core::nanoseconds_t rtt
Estimated round-trip time between sender and receiver. Computed based on NTP-like timestamp exchange ...
Definition
ilink_meter.h:58
roc::packet::LinkMetrics::ext_last_seqnum
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
roc::packet::LinkMetrics::lost_packets
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
roc::packet::LinkMetrics::ext_first_seqnum
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
roc::packet::LinkMetrics::total_packets
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.h
Time definitions.
units.h
Various units used in packets.
roc_packet
ilink_meter.h
Generated by
1.17.0