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

RTP link meter. More...

#include <link_meter.h>

Inheritance diagram for roc::rtp::LinkMeter:
Collaboration diagram for roc::rtp::LinkMeter:

Public Member Functions

 LinkMeter (const EncodingMap &encoding_map)
 Initialize. More...
 
virtual bool has_metrics () const
 Check if metrics are already gathered and can be reported. More...
 
virtual const packet::LinkMetricsmetrics () const
 Get metrics. More...
 
bool has_encoding () const
 Check if packet encoding already detected. More...
 
const Encodingencoding () const
 Get detected encoding. More...
 
void process_report (const rtcp::SendReport &report)
 Process RTCP report from sender. More...
 
virtual ROC_ATTR_NODISCARD status::StatusCode write (const packet::PacketPtr &packet)
 Write packet and update metrics. More...
 
virtual ROC_ATTR_NODISCARD status::StatusCode read (packet::PacketPtr &packet)
 Read packet and update metrics. More...
 
void set_writer (packet::IWriter &writer)
 Set nested packet writer. More...
 
void set_reader (packet::IReader &reader)
 Set nested packet reader. More...
 

Detailed Description

RTP link meter.

Computes various link metrics based on sequence of RTP packets. Inserted into pipeline in two points:

  • As a writer, right after receiving packet, before storing packet in incoming queue. Here LinkMeter computes metrics that should be updated as early as possible.
  • As a reader, right before decoding packet. Here LinkMeter computes metrics that can be updated only when packets are going to be played.

In both cases, LinkMeter passes through packets to/from nested writer/reader, and updates metrics.

Definition at line 43 of file link_meter.h.

Constructor & Destructor Documentation

◆ LinkMeter()

roc::rtp::LinkMeter::LinkMeter ( const EncodingMap encoding_map)
explicit

Initialize.

Member Function Documentation

◆ encoding()

const Encoding& roc::rtp::LinkMeter::encoding ( ) const

Get detected encoding.

Remarks
Panics if no encoding detected.

◆ has_encoding()

bool roc::rtp::LinkMeter::has_encoding ( ) const

Check if packet encoding already detected.

◆ has_metrics()

virtual bool roc::rtp::LinkMeter::has_metrics ( ) const
virtual

Check if metrics are already gathered and can be reported.

Implements roc::packet::ILinkMeter.

◆ metrics()

virtual const packet::LinkMetrics& roc::rtp::LinkMeter::metrics ( ) const
virtual

Get metrics.

Implements roc::packet::ILinkMeter.

◆ process_report()

void roc::rtp::LinkMeter::process_report ( const rtcp::SendReport report)

Process RTCP report from sender.

Remarks
Obtains additional information that can't be measured directly.

◆ read()

virtual ROC_ATTR_NODISCARD status::StatusCode roc::rtp::LinkMeter::read ( packet::PacketPtr packet)
virtual

Read packet and update metrics.

Remarks
Invoked late in pipeline right before the packet is decoded.

Implements roc::packet::IReader.

◆ set_reader()

void roc::rtp::LinkMeter::set_reader ( packet::IReader reader)

Set nested packet reader.

Remarks
Should be called before first read() call.

◆ set_writer()

void roc::rtp::LinkMeter::set_writer ( packet::IWriter writer)

Set nested packet writer.

Remarks
Should be called before first write() call.

◆ write()

virtual ROC_ATTR_NODISCARD status::StatusCode roc::rtp::LinkMeter::write ( const packet::PacketPtr packet)
virtual

Write packet and update metrics.

Remarks
Invoked early in pipeline right after the packet is received.

Implements roc::packet::IWriter.


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