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

Receiver session group. More...

#include <receiver_session_group.h>

Inheritance diagram for roc::pipeline::ReceiverSessionGroup:
Collaboration diagram for roc::pipeline::ReceiverSessionGroup:

Public Member Functions

 ReceiverSessionGroup (const ReceiverSourceConfig &source_config, const ReceiverSlotConfig &slot_config, StateTracker &state_tracker, audio::Mixer &mixer, const rtp::EncodingMap &encoding_map, packet::PacketFactory &packet_factory, audio::FrameFactory &frame_factory, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if pipeline was succefully constructed. More...
 
bool create_control_pipeline (ReceiverEndpoint *control_endpoint)
 Create control sub-pipeline. More...
 
ROC_ATTR_NODISCARD status::StatusCode route_packet (const packet::PacketPtr &packet, core::nanoseconds_t current_time)
 Route packet to session. More...
 
core::nanoseconds_t refresh_sessions (core::nanoseconds_t current_time)
 Refresh pipeline according to current time. More...
 
void reclock_sessions (core::nanoseconds_t playback_time)
 Adjust session clock to match consumer clock. More...
 
size_t num_sessions () const
 Get number of sessions in group. More...
 
void get_slot_metrics (ReceiverSlotMetrics &slot_metrics) const
 Get slot metrics. More...
 
void get_participant_metrics (ReceiverParticipantMetrics *party_metrics, size_t *party_count) const
 Get metrics for remote participants. More...
 

Detailed Description

Receiver session group.

Contains:

  • a set of related receiver sessions

Session group corresponds to all sessions handled by one receiver slot - a set of related complementary endpoints, e.g. one endpoint for audio, one for repair, and one for control packets.

Session group creates and removes sessions and routes packets from endpoints to sessions with the help of ReceiverSessionRouter.

It also exchanges control information with remote senders using rtcp::Communicator and updates routing based on that control information.

Definition at line 48 of file receiver_session_group.h.

Constructor & Destructor Documentation

◆ ReceiverSessionGroup()

roc::pipeline::ReceiverSessionGroup::ReceiverSessionGroup ( const ReceiverSourceConfig source_config,
const ReceiverSlotConfig slot_config,
StateTracker state_tracker,
audio::Mixer mixer,
const rtp::EncodingMap encoding_map,
packet::PacketFactory packet_factory,
audio::FrameFactory frame_factory,
core::IArena arena 
)

Initialize.

Member Function Documentation

◆ create_control_pipeline()

bool roc::pipeline::ReceiverSessionGroup::create_control_pipeline ( ReceiverEndpoint control_endpoint)

Create control sub-pipeline.

Note
Control sub-pipeline is shared among all sessions in same group, so it's created separately using this method. On the other hand, transport sub-pipeline is per-session and is created automatically when a session is created within group.

◆ get_participant_metrics()

void roc::pipeline::ReceiverSessionGroup::get_participant_metrics ( ReceiverParticipantMetrics party_metrics,
size_t *  party_count 
) const

Get metrics for remote participants.

Remarks
On receiver, one participant corresponds to one ReceiverSession inside ReceiverSessionGroup, because we create a separate session for every connected participant (remote sender).
Note
party_metrics points to array of metrics structs, and party_count defines number of array elements. Metrics are written to given array, and party_count is updated of actual number of elements written. If there is not enough space for all metrics, result is truncated.

◆ get_slot_metrics()

void roc::pipeline::ReceiverSessionGroup::get_slot_metrics ( ReceiverSlotMetrics slot_metrics) const

Get slot metrics.

Remarks
These metrics are for the whole slot. For metrics for specific participant, see get_participant_metrics().

◆ is_valid()

bool roc::pipeline::ReceiverSessionGroup::is_valid ( ) const

Check if pipeline was succefully constructed.

◆ num_sessions()

size_t roc::pipeline::ReceiverSessionGroup::num_sessions ( ) const

Get number of sessions in group.

◆ reclock_sessions()

void roc::pipeline::ReceiverSessionGroup::reclock_sessions ( core::nanoseconds_t  playback_time)

Adjust session clock to match consumer clock.

Remarks
playback_time specified absolute time when first sample of last frame retrieved from pipeline will be actually played on sink

◆ refresh_sessions()

core::nanoseconds_t roc::pipeline::ReceiverSessionGroup::refresh_sessions ( core::nanoseconds_t  current_time)

Refresh pipeline according to current time.

Returns
deadline (absolute time) when refresh should be invoked again if there are no frames

◆ route_packet()

ROC_ATTR_NODISCARD status::StatusCode roc::pipeline::ReceiverSessionGroup::route_packet ( const packet::PacketPtr packet,
core::nanoseconds_t  current_time 
)

Route packet to session.


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