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

RTCP communicator. More...

#include <communicator.h>

Inheritance diagram for roc::rtcp::Communicator:
Collaboration diagram for roc::rtcp::Communicator:

Public Member Functions

 Communicator (const Config &config, IParticipant &participant, packet::IWriter &packet_writer, packet::IComposer &packet_composer, packet::PacketFactory &packet_factory, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if initialization succeeded. More...
 
size_t total_destinations () const
 Get number of tracked destination addresses, for testing. More...
 
size_t total_streams () const
 Get number of tracked streams, for testing. More...
 
ROC_ATTR_NODISCARD status::StatusCode process_packet (const packet::PacketPtr &packet, core::nanoseconds_t current_time)
 Parse and process incoming packet. Invokes IParticipant methods during processing. More...
 
core::nanoseconds_t generation_deadline (core::nanoseconds_t current_time)
 When we should generate packets next time. Returns absolute time. current_time is current time in nanoseconds since Unix epoch. More...
 
ROC_ATTR_NODISCARD status::StatusCode generate_reports (core::nanoseconds_t current_time)
 Generate and send report packet(s). Should be called according to generation_deadline(). current_time is current time in nanoseconds since Unix epoch. Invokes IParticipant methods during generation. More...
 
ROC_ATTR_NODISCARD status::StatusCode generate_goodbye (core::nanoseconds_t current_time)
 Generate and send goodbye packet(s). Should be called before termination sender session. current_time is current time in nanoseconds since Unix epoch. Invokes IParticipant methods during generation. More...
 

Detailed Description

RTCP communicator.

Implements bidirectional exchange of RTCP packets with other participants of a single RTP session.

Holds a reference to IParticipant interface, which is implemented by sender or receiver pipeline.

Features:

  • processes received RTCP packets, extract reports from packets, and notifies IParticipant with reports from remote side
  • queries IParticipant with up-to-date reports from local side, and generates RTCP packets to be sent to remote side

For more details about streams and reports,

See also
IParticipant.

This is top-level class of roc_rtcp module, gluing together other components:

Definition at line 56 of file communicator.h.

Constructor & Destructor Documentation

◆ Communicator()

roc::rtcp::Communicator::Communicator ( const Config config,
IParticipant participant,
packet::IWriter packet_writer,
packet::IComposer packet_composer,
packet::PacketFactory packet_factory,
core::IArena arena 
)

Initialize.

Member Function Documentation

◆ generate_goodbye()

ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Communicator::generate_goodbye ( core::nanoseconds_t  current_time)

Generate and send goodbye packet(s). Should be called before termination sender session. current_time is current time in nanoseconds since Unix epoch. Invokes IParticipant methods during generation.

◆ generate_reports()

ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Communicator::generate_reports ( core::nanoseconds_t  current_time)

Generate and send report packet(s). Should be called according to generation_deadline(). current_time is current time in nanoseconds since Unix epoch. Invokes IParticipant methods during generation.

◆ generation_deadline()

core::nanoseconds_t roc::rtcp::Communicator::generation_deadline ( core::nanoseconds_t  current_time)

When we should generate packets next time. Returns absolute time. current_time is current time in nanoseconds since Unix epoch.

◆ is_valid()

bool roc::rtcp::Communicator::is_valid ( ) const

Check if initialization succeeded.

◆ process_packet()

ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Communicator::process_packet ( const packet::PacketPtr packet,
core::nanoseconds_t  current_time 
)

Parse and process incoming packet. Invokes IParticipant methods during processing.

◆ total_destinations()

size_t roc::rtcp::Communicator::total_destinations ( ) const

Get number of tracked destination addresses, for testing.

◆ total_streams()

size_t roc::rtcp::Communicator::total_streams ( ) const

Get number of tracked streams, for testing.


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