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

RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any thread. More...

#include <encoding_map.h>

Inheritance diagram for roc::rtp::EncodingMap:
Collaboration diagram for roc::rtp::EncodingMap:

Public Member Functions

 EncodingMap (core::IArena &arena)
 Initialize. More...
 
const Encodingfind_by_pt (unsigned int pt) const
 Find encoding by payload type. More...
 
const Encodingfind_by_spec (const audio::SampleSpec &spec) const
 Find encoding by sample specification. More...
 
ROC_ATTR_NODISCARD bool add_encoding (Encoding enc)
 Add encoding to the map. More...
 

Detailed Description

RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any thread.

Definition at line 33 of file encoding_map.h.

Constructor & Destructor Documentation

◆ EncodingMap()

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

Initialize.

Member Function Documentation

◆ add_encoding()

ROC_ATTR_NODISCARD bool roc::rtp::EncodingMap::add_encoding ( Encoding  enc)

Add encoding to the map.

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

◆ find_by_pt()

const Encoding* roc::rtp::EncodingMap::find_by_pt ( unsigned int  pt) const

Find encoding by payload type.

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

◆ find_by_spec()

const Encoding* roc::rtp::EncodingMap::find_by_spec ( const audio::SampleSpec spec) const

Find encoding by sample specification.

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

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