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::IAllocator &allocator, size_t block_size)
 Initialize. More...
 
bool valid () const
 Check if object is successfully constructed. More...
 
virtual void write (const PacketPtr &packet)
 Write next packet. More...
 
void 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

roc::packet::Interleaver::Interleaver ( IWriter writer,
core::IAllocator allocator,
size_t  block_size 
)

Initialize.

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

Member Function Documentation

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.

void roc::packet::Interleaver::flush ( )

Send all buffered packets to output writer.

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

Check if object is successfully constructed.

virtual void 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: