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

Sender sink pipeline. More...

#include <sender_sink.h>

Inheritance diagram for roc::pipeline::SenderSink:
Collaboration diagram for roc::pipeline::SenderSink:

Public Member Functions

 SenderSink (const SenderSinkConfig &sink_config, const rtp::EncodingMap &encoding_map, core::IPool &packet_pool, core::IPool &packet_buffer_pool, core::IPool &frame_buffer_pool, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if the pipeline was successfully constructed. More...
 
SenderSlotcreate_slot (const SenderSlotConfig &slot_config)
 Create slot. More...
 
void delete_slot (SenderSlot *slot)
 Delete slot. More...
 
size_t num_sessions () const
 Get number of active sessions. More...
 
core::nanoseconds_t refresh (core::nanoseconds_t current_time)
 Refresh pipeline according to current time. More...
 
virtual sndio::ISinkto_sink ()
 Cast IDevice to ISink. More...
 
virtual sndio::ISourceto_source ()
 Cast IDevice to ISink. 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 sink. More...
 
virtual core::nanoseconds_t latency () const
 Get latency of the sink. More...
 
virtual bool has_latency () const
 Check if the sink supports latency reports. More...
 
virtual bool has_clock () const
 Check if the sink has own clock. More...
 
virtual void write (audio::Frame &frame)
 Write audio frame. 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...
 

Detailed Description

Sender sink pipeline.

Contains:

  • one or more sender slots
  • fanout, to duplicate audio to all slots

Pipeline:

  • input: frames
  • output: packets

Definition at line 43 of file sender_sink.h.

Constructor & Destructor Documentation

◆ SenderSink()

roc::pipeline::SenderSink::SenderSink ( const SenderSinkConfig sink_config,
const rtp::EncodingMap encoding_map,
core::IPool packet_pool,
core::IPool packet_buffer_pool,
core::IPool frame_buffer_pool,
core::IArena arena 
)

Initialize.

Member Function Documentation

◆ create_slot()

SenderSlot* roc::pipeline::SenderSink::create_slot ( const SenderSlotConfig slot_config)

Create slot.

◆ delete_slot()

void roc::pipeline::SenderSink::delete_slot ( SenderSlot slot)

Delete slot.

◆ has_clock()

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

Check if the sink has own clock.

Implements roc::sndio::IDevice.

◆ has_latency()

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

Check if the sink supports latency reports.

Implements roc::sndio::IDevice.

◆ is_valid()

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

Check if the pipeline was successfully constructed.

◆ latency()

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

Get latency of the sink.

Implements roc::sndio::IDevice.

◆ num_sessions()

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

Get number of active sessions.

◆ pause()

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

Pause reading.

Implements roc::sndio::IDevice.

◆ refresh()

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

Refresh pipeline according to current time.

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

◆ restart()

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

Restart reading from the beginning.

Implements roc::sndio::IDevice.

◆ resume()

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

Resume paused reading.

Implements roc::sndio::IDevice.

◆ sample_spec()

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

Get sample specification of the sink.

Implements roc::sndio::IDevice.

◆ state()

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

Get current receiver state.

Implements roc::sndio::IDevice.

◆ to_sink()

virtual sndio::ISink* roc::pipeline::SenderSink::to_sink ( )
virtual

Cast IDevice to ISink.

Implements roc::sndio::IDevice.

◆ to_source()

virtual sndio::ISource* roc::pipeline::SenderSink::to_source ( )
virtual

Cast IDevice to ISink.

Implements roc::sndio::IDevice.

◆ type()

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

Get device type.

Implements roc::sndio::IDevice.

◆ write()

virtual void roc::pipeline::SenderSink::write ( audio::Frame frame)
virtual

Write audio frame.

Implements roc::audio::IFrameWriter.


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