Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::packet::Interleaver Class Reference

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

#include <interleaver.h>

Inheritance diagram for roc::packet::Interleaver:
Collaboration diagram for roc::packet::Interleaver:

Public Member Functions

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

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: