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

Sender session sub-pipeline. More...

#include <sender_session.h>

Inheritance diagram for roc::pipeline::SenderSession:
Collaboration diagram for roc::pipeline::SenderSession:

Public Member Functions

 SenderSession (const SenderSinkConfig &sink_config, const rtp::EncodingMap &encoding_map, packet::PacketFactory &packet_factory, audio::FrameFactory &frame_factory, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if the session was succefully constructed. More...
 
bool create_transport_pipeline (SenderEndpoint *source_endpoint, SenderEndpoint *repair_endpoint)
 Create transport sub-pipeline. More...
 
bool create_control_pipeline (SenderEndpoint *control_endpoint)
 Create control sub-pipeline. More...
 
audio::IFrameWriterframe_writer () const
 Get frame writer. More...
 
ROC_ATTR_NODISCARD status::StatusCode route_packet (const packet::PacketPtr &packet, core::nanoseconds_t current_time)
 Route a packet to the session. More...
 
core::nanoseconds_t refresh (core::nanoseconds_t current_time)
 Refresh pipeline according to current time. More...
 
void get_slot_metrics (SenderSlotMetrics &slot_metrics) const
 Get slot metrics. More...
 
void get_participant_metrics (SenderParticipantMetrics *party_metrics, size_t *party_count) const
 Get metrics for remote participants. More...
 

Detailed Description

Sender session sub-pipeline.

Contains:

  • a pipeline for processing audio frames from single sender and converting them into packets

Definition at line 52 of file sender_session.h.

Constructor & Destructor Documentation

◆ SenderSession()

roc::pipeline::SenderSession::SenderSession ( const SenderSinkConfig sink_config,
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::SenderSession::create_control_pipeline ( SenderEndpoint control_endpoint)

Create control sub-pipeline.

◆ create_transport_pipeline()

bool roc::pipeline::SenderSession::create_transport_pipeline ( SenderEndpoint source_endpoint,
SenderEndpoint repair_endpoint 
)

Create transport sub-pipeline.

◆ frame_writer()

audio::IFrameWriter* roc::pipeline::SenderSession::frame_writer ( ) const

Get frame writer.

Remarks
This way samples reach the pipeline. Most of the processing, like encoding packets, generating redundancy packets, etc, happens during the write operation.

◆ get_participant_metrics()

void roc::pipeline::SenderSession::get_participant_metrics ( SenderParticipantMetrics party_metrics,
size_t *  party_count 
) const

Get metrics for remote participants.

Remarks
On sender, all participants corresponds to a single SenderSession. In case of unicast, there is only one participant (remote receiver), but in case of multicast, multiple participants may be present.
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::SenderSession::get_slot_metrics ( SenderSlotMetrics 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::SenderSession::is_valid ( ) const

Check if the session was succefully constructed.

◆ refresh()

core::nanoseconds_t roc::pipeline::SenderSession::refresh ( 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::SenderSession::route_packet ( const packet::PacketPtr packet,
core::nanoseconds_t  current_time 
)

Route a packet to the session.

Remarks
This way feedback packets from receiver reach sender pipeline. Packets are stored inside internal pipeline queues, and then fetched when frame are passed from frame_writer().

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