Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
metrics.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 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_rtcp/metrics.h
10 //! @brief RTCP-derived metrics.
11 
12 #ifndef ROC_RTCP_METRICS_H_
13 #define ROC_RTCP_METRICS_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 rtcp {
21 
22 //! Metrics sent from sender to receiver.
24  //! Unix time when these metrics were generated.
25  //! Nanoseconds since Unix epoch in sender clock domain.
27 
28  //! RTP timestamp correspnding to NTP timestamp.
30 
32  : origin_time(0)
33  , origin_rtp(0) {
34  }
35 };
36 
37 //! Metrics sent from receiver to sender per source.
39  //! To which source these metrics apply.
41 
42  //! Fraction of lost packets.
43  float fract_loss;
44 
46  : ssrc(0)
47  , fract_loss(0) {
48  }
49 };
50 
51 //! Metrics for network link.
52 //! Calculated independently on both sender and receiver.
53 struct LinkMetrics {
54  //! Estimated round-trip time.
56 
57  LinkMetrics()
58  : rtt(0) {
59  }
60 };
61 
62 } // namespace rtcp
63 } // namespace roc
64 
65 #endif // ROC_RTCP_METRICS_H_
int64_t nanoseconds_t
Nanoseconds.
Definition: time.h:58
uint32_t stream_source_t
Packet stream identifier.
Definition: units.h:27
uint32_t stream_timestamp_t
Packet stream timestamp.
Definition: units.h:36
Root namespace.
Commonly used types and functions.
Metrics for network link. Calculated independently on both sender and receiver.
Definition: metrics.h:53
core::nanoseconds_t rtt
Estimated round-trip time.
Definition: metrics.h:55
Metrics sent from receiver to sender per source.
Definition: metrics.h:38
float fract_loss
Fraction of lost packets.
Definition: metrics.h:43
packet::stream_source_t ssrc
To which source these metrics apply.
Definition: metrics.h:40
Metrics sent from sender to receiver.
Definition: metrics.h:23
core::nanoseconds_t origin_time
Unix time when these metrics were generated. Nanoseconds since Unix epoch in sender clock domain.
Definition: metrics.h:26
packet::stream_timestamp_t origin_rtp
RTP timestamp correspnding to NTP timestamp.
Definition: metrics.h:29
Time definitions.
Various units used in packets.