12 #ifndef ROC_RTP_ENCODING_MAP_H_
13 #define ROC_RTP_ENCODING_MAP_H_
57 enum { PreallocatedNodes = 16 };
61 : core::RefCounted<Node, core::PoolAllocation>(pool)
62 , encoding(encoding) {
67 unsigned int key()
const {
75 static bool key_equal(
unsigned int pt1,
unsigned int pt2) {
80 void add_builtin_(
const Encoding& enc);
81 void find_codecs_(Encoding& enc);
85 core::SlabPool<Node, PreallocatedNodes> node_pool_;
86 core::Hashmap<Node, PreallocatedNodes> node_map_;
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Sample specification. Describes sample rate and channels.
Base class for Hashmap element.
Base class for non-copyable objects.
Base class for object with reference counter.
RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any threa...
const Encoding * find_by_pt(unsigned int pt) const
Find encoding by payload type.
const Encoding * find_by_spec(const audio::SampleSpec &spec) const
Find encoding by sample specification.
EncodingMap(core::IArena &arena)
Initialize.
ROC_ATTR_NODISCARD bool add_encoding(Encoding enc)
Add encoding to the map.
hashsum_t hashsum_int(int16_t)
Compute hash of 16-bit integer.
size_t hashsum_t
Hash type.
Base class for object with reference counter.
unsigned int payload_type
Payload type.