Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
format_map.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_rtp/format_map.h
10//! @brief RTP payload format map.
11
12#ifndef ROC_RTP_FORMAT_MAP_H_
13#define ROC_RTP_FORMAT_MAP_H_
14
16#include "roc_rtp/format.h"
17
18namespace roc {
19namespace rtp {
20
21//! RTP payload format map.
22class FormatMap : public core::NonCopyable<> {
23public:
24 FormatMap();
25
26 //! Get format by payload type.
27 //! @returns
28 //! pointer to the format structure or null if there is no format
29 //! registered for this payload type.
30 const Format* format(unsigned int pt) const;
31
32private:
33 enum { MaxFormats = 2 };
34
35 Format formats_[MaxFormats];
36 size_t n_formats_;
37
38 void add_(const Format& fmt);
39};
40
41} // namespace rtp
42} // namespace roc
43
44#endif // ROC_RTP_FORMAT_MAP_H_
Base class for non-copyable objects.
Definition noncopyable.h:23
RTP payload format map.
Definition format_map.h:22
const Format * format(unsigned int pt) const
Get format by payload type.
RTP payload format.
Root namespace.
Non-copyable object.
RTP payload format.
Definition format.h:26