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

Receiver endpoint sub-pipeline. More...

#include <receiver_endpoint.h>

Inheritance diagram for roc::pipeline::ReceiverEndpoint:
Collaboration diagram for roc::pipeline::ReceiverEndpoint:

Public Member Functions

 ReceiverEndpoint (address::Protocol proto, StateTracker &state_tracker, ReceiverSessionGroup &session_group, const rtp::EncodingMap &encoding_map, const address::SocketAddr &inbound_address, packet::IWriter *outbound_writer, core::IArena &arena)
 Initialize. More...
 
bool is_valid () const
 Check if the port pipeline was succefully constructed. More...
 
address::Protocol proto () const
 Get protocol. More...
 
packet::IComposeroutbound_composer ()
 Get composer for outbound packets. More...
 
packet::IWriteroutbound_writer ()
 Get writer for outbound packets. This way feedback packets for sender generated by receiver reach network. More...
 
const address::SocketAddrinbound_address () const
 Get bind address for inbound packets. More...
 
packet::IWriterinbound_writer ()
 Get writer for inbound packets. This way packets from network reach receiver pipeline. More...
 
ROC_ATTR_NODISCARD status::StatusCode pull_packets (core::nanoseconds_t current_time)
 Pull packets written to inbound writer into pipeline. More...
 
- Public Member Functions inherited from roc::core::RefCounted< ReceiverEndpoint, 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 endpoint sub-pipeline.

Contains:

  • a pipeline for processing packets from single network endpoint
  • a reference to session group to which packets are routed

Definition at line 42 of file receiver_endpoint.h.

Constructor & Destructor Documentation

◆ ReceiverEndpoint()

roc::pipeline::ReceiverEndpoint::ReceiverEndpoint ( address::Protocol  proto,
StateTracker state_tracker,
ReceiverSessionGroup session_group,
const rtp::EncodingMap encoding_map,
const address::SocketAddr inbound_address,
packet::IWriter outbound_writer,
core::IArena arena 
)

Initialize.

Member Function Documentation

◆ inbound_address()

const address::SocketAddr& roc::pipeline::ReceiverEndpoint::inbound_address ( ) const

Get bind address for inbound packets.

◆ inbound_writer()

packet::IWriter& roc::pipeline::ReceiverEndpoint::inbound_writer ( )

Get writer for inbound packets. This way packets from network reach receiver 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.

◆ is_valid()

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

Check if the port pipeline was succefully constructed.

◆ outbound_composer()

packet::IComposer* roc::pipeline::ReceiverEndpoint::outbound_composer ( )

Get composer for outbound packets.

Remarks
This composer will create packets according to endpoint protocol.
Note
Not all protocols support outbound packets on receiver. If it's not supported, the method returns NULL.

◆ outbound_writer()

packet::IWriter* roc::pipeline::ReceiverEndpoint::outbound_writer ( )

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

Remarks
Packets passed to this writer will be enqueued for sending. When frame is requested to ReceiverSession, it generates packets and writes them to outbound writers of endpoints.
Note
Not all protocols support outbound packets on receiver. If it's not supported, the method returns NULL.

◆ proto()

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

Get protocol.

◆ pull_packets()

ROC_ATTR_NODISCARD status::StatusCode roc::pipeline::ReceiverEndpoint::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: