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

Sender endpoint sub-pipeline. More...

#include <sender_endpoint.h>

Inheritance diagram for roc::pipeline::SenderEndpoint:
Collaboration diagram for roc::pipeline::SenderEndpoint:

Public Member Functions

 SenderEndpoint (address::Protocol proto, StateTracker &state_tracker, SenderSession &sender_session, const address::SocketAddr &outbound_address, packet::IWriter &outbound_writer, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if pipeline was succefully constructed. More...
 
address::Protocol proto () const
 Get protocol. More...
 
const address::SocketAddroutbound_address () const
 Get destination address for outbound packets. More...
 
packet::IComposeroutbound_composer ()
 Get composer for outbound packets. More...
 
packet::IWriteroutbound_writer ()
 Get writer for outbound packets. This way packets generated by sender reach network. More...
 
packet::IWriterinbound_writer ()
 Get writer for inbound packets. This way feedback packets from receiver reach sender pipeline. More...
 
ROC_ATTR_NODISCARD status::StatusCode pull_packets (core::nanoseconds_t current_time)
 Pull packets written to inbound writer into pipeline. More...
 

Detailed Description

Sender endpoint sub-pipeline.

Contains:

  • a pipeline for processing packets for single network endpoint

Definition at line 40 of file sender_endpoint.h.

Constructor & Destructor Documentation

◆ SenderEndpoint()

roc::pipeline::SenderEndpoint::SenderEndpoint ( address::Protocol  proto,
StateTracker state_tracker,
SenderSession sender_session,
const address::SocketAddr outbound_address,
packet::IWriter outbound_writer,
core::IArena arena 
)

Initialize.

  • outbound_address specifies destination address that is assigned to the outgoing packets in the end of endpoint pipeline
  • outbound_writer specifies destination writer to which packets are sent in the end of endpoint pipeline

Member Function Documentation

◆ inbound_writer()

packet::IWriter* roc::pipeline::SenderEndpoint::inbound_writer ( )

Get writer for inbound packets. This way feedback packets from receiver reach sender pipeline.

Remarks
Packets passed to this writer will be pulled into pipeline. This writer is thread-safe and lock-free, packets can be written to it from netio thread. pull_packets() will pull enqueued inbound packets into SenderSession, which will use them next time when frame is written.
Note
Not all protocols support inbound packets on sender. If it's not supported, the method returns NULL.

◆ is_valid()

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

Check if pipeline was succefully constructed.

◆ outbound_address()

const address::SocketAddr& roc::pipeline::SenderEndpoint::outbound_address ( ) const

Get destination address for outbound packets.

◆ outbound_composer()

packet::IComposer& roc::pipeline::SenderEndpoint::outbound_composer ( )

Get composer for outbound packets.

Remarks
This composer will create packets according to endpoint protocol.

◆ outbound_writer()

packet::IWriter& roc::pipeline::SenderEndpoint::outbound_writer ( )

Get writer for outbound packets. This way packets generated by sender reach network.

Remarks
Packets passed to this writer will be enqueued for sending. When frame is written to SenderSession, it generates packets and writes them to outbound writers of endpoints.

◆ proto()

address::Protocol roc::pipeline::SenderEndpoint::proto ( ) const

Get protocol.

◆ pull_packets()

ROC_ATTR_NODISCARD status::StatusCode roc::pipeline::SenderEndpoint::pull_packets ( core::nanoseconds_t  current_time)

Pull packets written to inbound writer into pipeline.

Remarks
Packets are written to inbound_writer() from network thread. They don't appear in pipeline immediately. Instead, pipeline thread should periodically call pull_packets() to make them available.

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