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

RTP payload format map. Thread-safe. Returned formats are immutable and can be safely used from any thread. More...

#include <format_map.h>

Inheritance diagram for roc::rtp::FormatMap:
Collaboration diagram for roc::rtp::FormatMap:

Public Member Functions

 FormatMap (core::IArena &arena)
 Initialize. More...
 
const Formatfind_by_pt (unsigned int pt) const
 Find format by payload type. More...
 
const Formatfind_by_spec (const audio::SampleSpec &spec) const
 Find format by sample specification. More...
 
ROC_ATTR_NODISCARD bool add_format (const Format &fmt)
 Add format to the map. More...
 

Detailed Description

RTP payload format map. Thread-safe. Returned formats are immutable and can be safely used from any thread.

Definition at line 33 of file format_map.h.

Constructor & Destructor Documentation

◆ FormatMap()

roc::rtp::FormatMap::FormatMap ( core::IArena arena)

Initialize.

Member Function Documentation

◆ add_format()

ROC_ATTR_NODISCARD bool roc::rtp::FormatMap::add_format ( const Format fmt)

Add format to the map.

Returns
true if successfully added or false if another format with the same payload type already exists.

◆ find_by_pt()

const Format* roc::rtp::FormatMap::find_by_pt ( unsigned int  pt) const

Find format by payload type.

Returns
pointer to the format structure or null if there is no format registered for this payload type.

◆ find_by_spec()

const Format* roc::rtp::FormatMap::find_by_spec ( const audio::SampleSpec spec) const

Find format by sample specification.

Returns
pointer to the format structure or null if there is no format with matching specification.

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