Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
parser.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 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/parser.h
10//! @brief RTP packet parser.
11
12#ifndef ROC_RTP_PARSER_H_
13#define ROC_RTP_PARSER_H_
14
16#include "roc_packet/iparser.h"
18
19namespace roc {
20namespace rtp {
21
22//! RTP packet parser.
23class Parser : public packet::IParser, public core::NonCopyable<> {
24public:
25 //! Initialization.
26 //!
27 //! @b Parameters
28 //! - @p encoding_map is used to get packet parameters by its
29 //! payload type
30 //! - if @p inner_parser is not NULL, it is used to parse the
31 //! packet payload
32 Parser(const EncodingMap& encoding_map, packet::IParser* inner_parser);
33
34 //! Parse packet from buffer.
35 virtual bool parse(packet::Packet& packet, const core::Slice<uint8_t>& buffer);
36
37private:
38 const EncodingMap& encoding_map_;
39 packet::IParser* inner_parser_;
40};
41
42} // namespace rtp
43} // namespace roc
44
45#endif // ROC_RTP_PARSER_H_
Base class for non-copyable objects.
Definition noncopyable.h:23
Shared ownership intrusive pointer.
Definition shared_ptr.h:32
Packet parser interface.
Definition iparser.h:22
RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any threa...
RTP packet parser.
Definition parser.h:23
virtual bool parse(packet::Packet &packet, const core::Slice< uint8_t > &buffer)
Parse packet from buffer.
Parser(const EncodingMap &encoding_map, packet::IParser *inner_parser)
Initialization.
RTP encoding map.
Packet parser interface.
Root namespace.
Non-copyable object.