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

Receiver source pipeline. More...

#include <receiver_source.h>

Inheritance diagram for roc::pipeline::ReceiverSource:
Collaboration diagram for roc::pipeline::ReceiverSource:

Public Member Functions

 ReceiverSource (const ReceiverConfig &config, const rtp::FormatMap &format_map, packet::PacketFactory &packet_factory, core::BufferFactory< uint8_t > &byte_buffer_factory, core::BufferFactory< audio::sample_t > &sample_buffer_factory, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if the pipeline was successfully constructed. More...
 
ReceiverSlotcreate_slot ()
 Create slot. More...
 
void delete_slot (ReceiverSlot *slot)
 Delete slot. More...
 
size_t num_sessions () const
 Get number of connected sessions. More...
 
core::nanoseconds_t refresh (core::nanoseconds_t current_time)
 Pull packets and refresh pipeline according to current time. More...
 
virtual sndio::DeviceType type () const
 Get device type. More...
 
virtual sndio::DeviceState state () const
 Get current receiver state. More...
 
virtual void pause ()
 Pause reading. More...
 
virtual bool resume ()
 Resume paused reading. More...
 
virtual bool restart ()
 Restart reading from the beginning. More...
 
virtual audio::SampleSpec sample_spec () const
 Get sample specification of the source. More...
 
virtual core::nanoseconds_t latency () const
 Get latency of the source. More...
 
virtual bool has_latency () const
 Check if the source supports latency reports. More...
 
virtual bool has_clock () const
 Check if the source has own clock. More...
 
virtual void reclock (core::nanoseconds_t playback_time)
 Adjust sessions clock to match consumer clock. More...
 
virtual bool read (audio::Frame &)
 Read audio frame. More...
 
- Public Member Functions inherited from roc::core::ListNode
ListNodeDatalist_node_data () const
 Get list node data. More...
 

Detailed Description

Receiver source pipeline.

Contains:

  • one or more receiver slots
  • mixer, to mix audio from all slots

Pipeline:

  • input: packets
  • output: frames

Definition at line 46 of file receiver_source.h.

Constructor & Destructor Documentation

◆ ReceiverSource()

roc::pipeline::ReceiverSource::ReceiverSource ( const ReceiverConfig config,
const rtp::FormatMap format_map,
packet::PacketFactory packet_factory,
core::BufferFactory< uint8_t > &  byte_buffer_factory,
core::BufferFactory< audio::sample_t > &  sample_buffer_factory,
core::IArena arena 
)

Initialize.

Member Function Documentation

◆ create_slot()

ReceiverSlot* roc::pipeline::ReceiverSource::create_slot ( )

Create slot.

◆ delete_slot()

void roc::pipeline::ReceiverSource::delete_slot ( ReceiverSlot slot)

Delete slot.

◆ has_clock()

virtual bool roc::pipeline::ReceiverSource::has_clock ( ) const
virtual

Check if the source has own clock.

Implements roc::sndio::IDevice.

◆ has_latency()

virtual bool roc::pipeline::ReceiverSource::has_latency ( ) const
virtual

Check if the source supports latency reports.

Implements roc::sndio::IDevice.

◆ is_valid()

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

Check if the pipeline was successfully constructed.

◆ latency()

virtual core::nanoseconds_t roc::pipeline::ReceiverSource::latency ( ) const
virtual

Get latency of the source.

Implements roc::sndio::IDevice.

◆ num_sessions()

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

Get number of connected sessions.

◆ pause()

virtual void roc::pipeline::ReceiverSource::pause ( )
virtual

Pause reading.

Implements roc::sndio::IDevice.

◆ read()

virtual bool roc::pipeline::ReceiverSource::read ( audio::Frame )
virtual

Read audio frame.

Implements roc::audio::IFrameReader.

◆ reclock()

virtual void roc::pipeline::ReceiverSource::reclock ( core::nanoseconds_t  playback_time)
virtual

Adjust sessions 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

Implements roc::sndio::ISource.

◆ refresh()

core::nanoseconds_t roc::pipeline::ReceiverSource::refresh ( core::nanoseconds_t  current_time)

Pull packets and refresh pipeline according to current time.

Remarks
Should be invoked before reading each frame. Also should be invoked after provided deadline if no frames were read until that deadline expires.
Returns
deadline (absolute time) when refresh should be invoked again if there are no frames

◆ restart()

virtual bool roc::pipeline::ReceiverSource::restart ( )
virtual

Restart reading from the beginning.

Implements roc::sndio::IDevice.

◆ resume()

virtual bool roc::pipeline::ReceiverSource::resume ( )
virtual

Resume paused reading.

Implements roc::sndio::IDevice.

◆ sample_spec()

virtual audio::SampleSpec roc::pipeline::ReceiverSource::sample_spec ( ) const
virtual

Get sample specification of the source.

Implements roc::sndio::IDevice.

◆ state()

virtual sndio::DeviceState roc::pipeline::ReceiverSource::state ( ) const
virtual

Get current receiver state.

Implements roc::sndio::IDevice.

◆ type()

virtual sndio::DeviceType roc::pipeline::ReceiverSource::type ( ) const
virtual

Get device type.

Implements roc::sndio::IDevice.


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