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

Depacketizer. More...

#include <depacketizer.h>

Inheritance diagram for roc::audio::Depacketizer:
Collaboration diagram for roc::audio::Depacketizer:

Public Member Functions

 Depacketizer (packet::IReader &reader, IFrameDecoder &payload_decoder, const audio::SampleSpec &sample_spec, bool beep)
 Initialization. More...
 
bool is_valid () const
 Was depacketizer constructed without errors? More...
 
bool is_started () const
 Did depacketizer catch first packet? More...
 
virtual bool read (Frame &frame)
 Read audio frame. More...
 
packet::stream_timestamp_t next_timestamp () const
 Get next timestamp to be rendered. More...
 
- Public Member Functions inherited from roc::core::ListNode
ListNodeDatalist_node_data () const
 Get list node data. More...
 

Detailed Description

Depacketizer.

Remarks
Reads packets from a packet reader, decodes samples from packets using a decoder, and produces an audio stream.

Definition at line 30 of file depacketizer.h.

Constructor & Destructor Documentation

◆ Depacketizer()

roc::audio::Depacketizer::Depacketizer ( packet::IReader reader,
IFrameDecoder payload_decoder,
const audio::SampleSpec sample_spec,
bool  beep 
)

Initialization.

Parameters

  • reader is used to read packets
  • payload_decoder is used to extract samples from packets
  • sample_spec defines a set of channels in the output frames
  • beep enables weird beeps instead of silence on packet loss

Member Function Documentation

◆ is_started()

bool roc::audio::Depacketizer::is_started ( ) const

Did depacketizer catch first packet?

◆ is_valid()

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

Was depacketizer constructed without errors?

◆ next_timestamp()

packet::stream_timestamp_t roc::audio::Depacketizer::next_timestamp ( ) const

Get next timestamp to be rendered.

Precondition
is_started() should return true

◆ read()

virtual bool roc::audio::Depacketizer::read ( Frame frame)
virtual

Read audio frame.

Implements roc::audio::IFrameReader.


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