Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
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
15
#include "
roc_core/noncopyable.h
"
16
#include "
roc_packet/iparser.h
"
17
#include "
roc_rtp/encoding_map.h
"
18
19
namespace
roc
{
20
namespace
rtp {
21
22
//! RTP packet parser.
23
class
Parser
:
public
packet::IParser
,
public
core::NonCopyable
<> {
24
public
:
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
37
private
:
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_
roc::core::NonCopyable
Base class for non-copyable objects.
Definition:
noncopyable.h:23
roc::core::Slice< uint8_t >
roc::packet::IParser
Packet parser interface.
Definition:
iparser.h:22
roc::packet::Packet
Packet.
Definition:
packet.h:39
roc::rtp::EncodingMap
RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any threa...
Definition:
encoding_map.h:33
roc::rtp::Parser
RTP packet parser.
Definition:
parser.h:23
roc::rtp::Parser::parse
virtual bool parse(packet::Packet &packet, const core::Slice< uint8_t > &buffer)
Parse packet from buffer.
roc::rtp::Parser::Parser
Parser(const EncodingMap &encoding_map, packet::IParser *inner_parser)
Initialization.
encoding_map.h
RTP encoding map.
iparser.h
Packet parser interface.
roc
Root namespace.
noncopyable.h
Non-copyable object.
roc_rtp
parser.h
Generated by
1.9.1