Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
ireceiver_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/ireceiver_hooks.h
10 //! @brief Receiver hooks interface.
11 
12 #ifndef ROC_RTCP_IRECEIVER_HOOKS_H_
13 #define ROC_RTCP_IRECEIVER_HOOKS_H_
14 
15 #include "roc_packet/units.h"
16 #include "roc_rtcp/metrics.h"
17 
18 namespace roc {
19 namespace rtcp {
20 
21 //! Receiver hooks interface.
23 public:
24  virtual ~IReceiverHooks();
25 
26  //! Invoked when retrieved source description.
27  virtual void on_update_source(packet::stream_source_t source_id,
28  const char* cname) = 0;
29 
30  //! Invoked when retrieved source termination message.
31  virtual void on_remove_source(packet::stream_source_t source_id) = 0;
32 
33  //! Get number of sources for which we send reception metrics.
34  virtual size_t on_get_num_sources() = 0;
35 
36  //! Generate reception metrics for the source with given index.
37  //! @p source_index is a number from 0 ro num_receipted_sources().
38  virtual ReceptionMetrics on_get_reception_metrics(size_t source_index) = 0;
39 
40  //! Handle metrics obtained from sender.
41  virtual void on_add_sending_metrics(const SendingMetrics& metrics) = 0;
42 
43  //! Handle estimated link metrics.
44  virtual void on_add_link_metrics(const LinkMetrics& metrics) = 0;
45 };
46 
47 } // namespace rtcp
48 } // namespace roc
49 
50 #endif // ROC_RTCP_IRECEIVER_HOOKS_H_
Receiver hooks interface.
virtual void on_update_source(packet::stream_source_t source_id, const char *cname)=0
Invoked when retrieved source description.
virtual void on_add_sending_metrics(const SendingMetrics &metrics)=0
Handle metrics obtained from sender.
virtual void on_remove_source(packet::stream_source_t source_id)=0
Invoked when retrieved source termination message.
virtual size_t on_get_num_sources()=0
Get number of sources for which we send reception metrics.
virtual ReceptionMetrics on_get_reception_metrics(size_t source_index)=0
Generate reception metrics for the source with given index. source_index is a number from 0 ro num_re...
virtual void on_add_link_metrics(const LinkMetrics &metrics)=0
Handle estimated link metrics.
uint32_t stream_source_t
Packet stream identifier.
Definition: units.h:27
Root namespace.
RTCP-derived metrics.
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
Various units used in packets.