Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
isender_hooks.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/isender_hooks.h
10 //! @brief Sender hooks interface.
11 
12 #ifndef ROC_RTCP_ISENDER_HOOKS_H_
13 #define ROC_RTCP_ISENDER_HOOKS_H_
14 
15 #include "roc_core/stddefs.h"
16 #include "roc_core/time.h"
17 #include "roc_rtcp/metrics.h"
18 
19 namespace roc {
20 namespace rtcp {
21 
22 //! Sender hooks interface.
23 class ISenderHooks {
24 public:
25  virtual ~ISenderHooks();
26 
27  //! Get number of sources produced by sender.
28  virtual size_t on_get_num_sources() = 0;
29 
30  //! Get identifier of the source with given index.
31  //! @p source_index is a number from 0 ro num_receipted_sources().
32  virtual packet::stream_source_t on_get_sending_source(size_t source_index) = 0;
33 
34  //! Generate sending metrics.
35  //! The obtained metrics will be sent to receiver(s).
36  //! @remarks
37  //! @p report_time defines time point relative to which metrics should be
38  //! calculated, measured in nanoseconds since Unix epoch.
40 
41  //! Handle reception feedback metrics obtained from receiver.
42  //! Called for each source.
43  virtual void on_add_reception_metrics(const ReceptionMetrics& metrics) = 0;
44 
45  //! Handle estimated link metrics.
46  virtual void on_add_link_metrics(const LinkMetrics& metrics) = 0;
47 };
48 
49 } // namespace rtcp
50 } // namespace roc
51 
52 #endif // ROC_RTCP_ISENDER_HOOKS_H_
Sender hooks interface.
Definition: isender_hooks.h:23
virtual size_t on_get_num_sources()=0
Get number of sources produced by sender.
virtual void on_add_reception_metrics(const ReceptionMetrics &metrics)=0
Handle reception feedback metrics obtained from receiver. Called for each source.
virtual SendingMetrics on_get_sending_metrics(core::nanoseconds_t report_time)=0
Generate sending metrics. The obtained metrics will be sent to receiver(s).
virtual void on_add_link_metrics(const LinkMetrics &metrics)=0
Handle estimated link metrics.
virtual packet::stream_source_t on_get_sending_source(size_t source_index)=0
Get identifier of the source with given index. source_index is a number from 0 ro num_receipted_sourc...
int64_t nanoseconds_t
Nanoseconds.
Definition: time.h:58
uint32_t stream_source_t
Packet stream identifier.
Definition: units.h:27
Root namespace.
RTCP-derived metrics.
Commonly used types and functions.
Metrics for network link. Calculated independently on both sender and receiver.
Definition: metrics.h:53
Metrics sent from receiver to sender per source.
Definition: metrics.h:38
Metrics sent from sender to receiver.
Definition: metrics.h:23
Time definitions.