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::PacketFactory &packet_factory, core::BufferFactory< uint8_t > &buffer_factory, core::nanoseconds_t packet_length, const audio::SampleSpec &sample_spec, unsigned int payload_type)
 Initialization. More...
 
bool is_valid () const
 Check if object is successfully constructed. More...
 
virtual void write (Frame &frame)
 Write audio frame. More...
 
void flush ()
 Flush buffered packet, if any. More...
 
- Public Member Functions inherited from roc::core::ListNode
ListNodeDatalist_node_data () const
 Get list node data. More...
 

Detailed Description

Packetizer.

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

Definition at line 34 of file packetizer.h.

Constructor & Destructor Documentation

◆ Packetizer()

roc::audio::Packetizer::Packetizer ( packet::IWriter writer,
packet::IComposer composer,
IFrameEncoder payload_encoder,
packet::PacketFactory packet_factory,
core::BufferFactory< uint8_t > &  buffer_factory,
core::nanoseconds_t  packet_length,
const audio::SampleSpec sample_spec,
unsigned int  payload_type 
)

Initialization.

Parameters

  • writer is used to write generated packets
  • composer is used to initialize new packets
  • payload_encoder is used to write samples to packets
  • packet_factory is used to allocate packets
  • buffer_factory is used to allocate buffers for packets
  • packet_length defines packet length in nanoseconds
  • sample_spec defines the sample spec
  • payload_type defines packet payload type

Member Function Documentation

◆ flush()

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

Flush buffered packet, if any.

Remarks
Packet is padded to match fixed size.

◆ is_valid()

bool roc::audio::Packetizer::is_valid ( ) const

Check if object is successfully constructed.

◆ write()

virtual void roc::audio::Packetizer::write ( Frame frame)
virtual

Write audio frame.

Implements roc::audio::IFrameWriter.


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