Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::packet::Interleaver Class Reference

Interleaves packets to transmit them in pseudo random order. More...

#include <interleaver.h>

Inheritance diagram for roc::packet::Interleaver:
roc::packet::IWriter roc::core::NonCopyable< Tag >

Public Member Functions

 Interleaver (IWriter &writer, core::IArena &arena, size_t block_size)
 Initialize.
 
bool is_valid () const
 Check if object is successfully constructed.
 
virtual ROC_ATTR_NODISCARD status::StatusCode write (const PacketPtr &packet)
 Write next packet.
 
ROC_ATTR_NODISCARD status::StatusCode flush ()
 Send all buffered packets to output writer.
 
size_t block_size () const
 Maximum delay between writing packet and moment we get it in output in terms of packets number.
 
- Public Member Functions inherited from roc::packet::IWriter

Detailed Description

Interleaves packets to transmit them in pseudo random order.

Definition at line 25 of file interleaver.h.

Constructor & Destructor Documentation

◆ Interleaver()

roc::packet::Interleaver::Interleaver ( IWriter & writer,
core::IArena & arena,
size_t block_size )

Initialize.

Remarks
Interleaver reorders packets passed to write() and writes them to output.

Member Function Documentation

◆ block_size()

size_t roc::packet::Interleaver::block_size ( ) const

Maximum delay between writing packet and moment we get it in output in terms of packets number.

◆ flush()

ROC_ATTR_NODISCARD status::StatusCode roc::packet::Interleaver::flush ( )

Send all buffered packets to output writer.

◆ is_valid()

bool roc::packet::Interleaver::is_valid ( ) const

Check if object is successfully constructed.

◆ write()

virtual ROC_ATTR_NODISCARD status::StatusCode roc::packet::Interleaver::write ( const PacketPtr & packet)
virtual

Write next packet.

Remarks
Packets are written to internal buffer. Buffered packets are then reordered and sent to output writer.

Implements roc::packet::IWriter.


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