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

Receiver session sub-pipeline. More...

#include <receiver_session.h>

Inheritance diagram for roc::pipeline::ReceiverSession:
Collaboration diagram for roc::pipeline::ReceiverSession:

Public Member Functions

 ReceiverSession (const ReceiverSessionConfig &session_config, const ReceiverCommonConfig &common_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...
 
audio::IFrameReaderframe_reader ()
 Get frame reader. More...
 
ROC_ATTR_NODISCARD status::StatusCode route_packet (const packet::PacketPtr &packet)
 Route a packet to the session. More...
 
bool refresh (core::nanoseconds_t current_time, core::nanoseconds_t *next_refresh)
 Refresh pipeline according to current time. More...
 
bool reclock (core::nanoseconds_t playback_time)
 Adjust session clock to match consumer clock. More...
 
size_t num_reports () const
 Get number of RTCP reports to be generated. More...
 
void generate_reports (const char *report_cname, packet::stream_source_t report_ssrc, core::nanoseconds_t report_time, rtcp::RecvReport *reports, size_t n_reports) const
 Generate RTCP reports to be delivered to sender. More...
 
void process_report (const rtcp::SendReport &report)
 Process RTCP report obtained from sender. More...
 
ReceiverParticipantMetrics get_metrics () const
 Get session metrics. More...
 
- Public Member Functions inherited from roc::core::RefCounted< ReceiverSession, core::ArenaAllocation >
 RefCounted ()
 Initialize. More...
 
 RefCounted (const core::ArenaAllocation &policy)
 Initialize. More...
 
int getref () const
 Get reference counter. More...
 
void incref () const
 Increment reference counter. More...
 
void decref () const
 Decrement reference counter. 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...
 
- Protected Member Functions inherited from roc::core::ArenaAllocation
IArenaarena () const
 Get arena. More...
 
 ArenaAllocation (IArena &arena)
 Initialize. More...
 
template<class T >
void destroy (T &object)
 Destroy object and return memory to arena. More...
 

Detailed Description

Receiver session sub-pipeline.

Contains:

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

Definition at line 58 of file receiver_session.h.

Constructor & Destructor Documentation

◆ ReceiverSession()

roc::pipeline::ReceiverSession::ReceiverSession ( const ReceiverSessionConfig session_config,
const ReceiverCommonConfig common_config,
const rtp::EncodingMap encoding_map,
packet::PacketFactory packet_factory,
audio::FrameFactory frame_factory,
core::IArena arena 
)

Initialize.

Member Function Documentation

◆ frame_reader()

audio::IFrameReader& roc::pipeline::ReceiverSession::frame_reader ( )

Get frame reader.

Remarks
This way samples are fetched from the pipeline. Most of the processing, like decoding packets, restoring losses, and adjust clock, happens during the read operation.

◆ generate_reports()

void roc::pipeline::ReceiverSession::generate_reports ( const char *  report_cname,
packet::stream_source_t  report_ssrc,
core::nanoseconds_t  report_time,
rtcp::RecvReport reports,
size_t  n_reports 
) const

Generate RTCP reports to be delivered to sender.

◆ get_metrics()

ReceiverParticipantMetrics roc::pipeline::ReceiverSession::get_metrics ( ) const

Get session metrics.

◆ is_valid()

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

Check if the session was succefully constructed.

◆ num_reports()

size_t roc::pipeline::ReceiverSession::num_reports ( ) const

Get number of RTCP reports to be generated.

◆ process_report()

void roc::pipeline::ReceiverSession::process_report ( const rtcp::SendReport report)

Process RTCP report obtained from sender.

◆ reclock()

bool roc::pipeline::ReceiverSession::reclock ( 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
Returns
false if the session is ended

◆ refresh()

bool roc::pipeline::ReceiverSession::refresh ( core::nanoseconds_t  current_time,
core::nanoseconds_t next_refresh 
)

Refresh pipeline according to current time.

Remarks
writes to next_refresh deadline (absolute time) when refresh should be invoked again if there are no frames
Returns
false if the session is ended

◆ route_packet()

ROC_ATTR_NODISCARD status::StatusCode roc::pipeline::ReceiverSession::route_packet ( const packet::PacketPtr packet)

Route a packet to the session.

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

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