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

Packetizer. More...

#include <packetizer.h>

Inheritance diagram for roc::audio::Packetizer:
Collaboration diagram for roc::audio::Packetizer:

Public Member Functions

 Packetizer (packet::IWriter &writer, packet::IComposer &composer, IFrameEncoder &payload_encoder, packet::PacketPool &packet_pool, core::BufferPool< uint8_t > &buffer_pool, packet::channel_mask_t channels, core::nanoseconds_t packet_length, size_t sample_rate, unsigned int payload_type)
 Initialization. More...
virtual void write (Frame &frame)
 Write audio frame. More...
void flush ()
 Flush buffered packet, if any. More...

Detailed Description


Gets an audio stream, encodes samples to packets using an encoder, and writes packets to a packet writer.

Definition at line 33 of file packetizer.h.

Constructor & Destructor Documentation

roc::audio::Packetizer::Packetizer ( packet::IWriter writer,
packet::IComposer composer,
IFrameEncoder payload_encoder,
packet::PacketPool packet_pool,
core::BufferPool< uint8_t > &  buffer_pool,
packet::channel_mask_t  channels,
core::nanoseconds_t  packet_length,
size_t  sample_rate,
unsigned int  payload_type 



  • writer is used to write generated packets
  • composer is used to initialize new packets
  • payload_encoder is used to write samples to packets
  • packet_pool is used to allocate packets
  • buffer_pool is used to allocate buffers for packets
  • channels defines a set of channels in the input frames
  • packet_length defines packet length in nanoseconds
  • sample_rate defines number of samples per channel per second
  • payload_type defines packet payload type

Member Function Documentation

void roc::audio::Packetizer::flush ( )

Flush buffered packet, if any.

Packet is padded to match fixed size.
virtual void roc::audio::Packetizer::write ( Frame frame)

Write audio frame.

Implements roc::audio::IWriter.

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