Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::audio::FeedbackMonitor Class Reference

Feedback monitor. More...

#include <feedback_monitor.h>

Inheritance diagram for roc::audio::FeedbackMonitor:
Collaboration diagram for roc::audio::FeedbackMonitor:

Public Member Functions

 FeedbackMonitor (IFrameWriter &writer, Packetizer &packetizer, ResamplerWriter *resampler, const FeedbackConfig &feedback_config, const LatencyConfig &latency_config, const SampleSpec &sample_spec)
 Constructor. More...
 
bool is_valid () const
 Check if the object was initialized successfully. More...
 
bool is_started () const
 Check if feedback monitoring is started. More...
 
void start ()
 Enable feedback monitoring. More...
 
void process_feedback (packet::stream_source_t source_id, const LatencyMetrics &latency_metrics, const packet::LinkMetrics &link_metrics)
 Process feedback from receiver. More...
 
virtual void write (Frame &frame)
 Write audio frame. Passes frame to underlying writer. If feedback monitoring is started, also performs latency tuning. More...
 
size_t num_participants () const
 Get number of remote participants from which there is feedback. More...
 
const LatencyMetricslatency_metrics (size_t party_index) const
 Get latest latency metrics for session. party_index should be in range [0; num_participants()-1]. More...
 
const packet::LinkMetricslink_metrics (size_t party_index) const
 Get latest link metrics for session. party_index should be in range [0; num_participants()-1]. More...
 
- Public Member Functions inherited from roc::core::ListNode< Tag >
ListDatalist_data () const
 Get pointer to internal data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from roc::core::ListNode< Tag >
static ListNodelist_node (ListData *data)
 Get pointer to parent node from pointer to internal data. More...
 

Detailed Description

Feedback monitor.

Features

  • handles latency metrics from receiver (obtained via RTCP)
  • asks LatencyTuner to calculate scaling factor based on the actual and target latencies
  • passes calculated scaling factor to resampler

Flow

  • when pipeline obtains RTCP report, it calls write_metrics() method
  • pipeline periodically calls write() method; it passes latest metrics to LatencyTuner, and obtains scaling factor for resampler
  • feedback monitor has a reference to resampler, and periodically passes updated scaling factor to it
  • pipeline also can query feedback monitor for latency metrics on behalf of request from user

Definition at line 63 of file feedback_monitor.h.

Constructor & Destructor Documentation

◆ FeedbackMonitor()

roc::audio::FeedbackMonitor::FeedbackMonitor ( IFrameWriter writer,
Packetizer packetizer,
ResamplerWriter resampler,
const FeedbackConfig feedback_config,
const LatencyConfig latency_config,
const SampleSpec sample_spec 
)

Constructor.

Member Function Documentation

◆ is_started()

bool roc::audio::FeedbackMonitor::is_started ( ) const

Check if feedback monitoring is started.

◆ is_valid()

bool roc::audio::FeedbackMonitor::is_valid ( ) const

Check if the object was initialized successfully.

◆ latency_metrics()

const LatencyMetrics& roc::audio::FeedbackMonitor::latency_metrics ( size_t  party_index) const

Get latest latency metrics for session. party_index should be in range [0; num_participants()-1].

◆ link_metrics()

const packet::LinkMetrics& roc::audio::FeedbackMonitor::link_metrics ( size_t  party_index) const

Get latest link metrics for session. party_index should be in range [0; num_participants()-1].

◆ num_participants()

size_t roc::audio::FeedbackMonitor::num_participants ( ) const

Get number of remote participants from which there is feedback.

◆ process_feedback()

void roc::audio::FeedbackMonitor::process_feedback ( packet::stream_source_t  source_id,
const LatencyMetrics latency_metrics,
const packet::LinkMetrics link_metrics 
)

Process feedback from receiver.

◆ start()

void roc::audio::FeedbackMonitor::start ( )

Enable feedback monitoring.

◆ write()

virtual void roc::audio::FeedbackMonitor::write ( Frame frame)
virtual

Write audio frame. Passes frame to underlying writer. If feedback monitoring is started, also performs latency tuning.

Implements roc::audio::IFrameWriter.


The documentation for this class was generated from the following file: