Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
parser.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 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_rtcp/parser.h
10 //! @brief RTCP packet parser.
11 
12 #ifndef ROC_RTCP_PARSER_H_
13 #define ROC_RTCP_PARSER_H_
14 
15 #include "roc_core/noncopyable.h"
16 #include "roc_packet/iparser.h"
17 
18 namespace roc {
19 namespace rtcp {
20 
21 //! RTCP packet parser.
22 //!
23 //! @remarks
24 //! Unlike other parsers, this one just records the buffer into RTCP part of the packet
25 //! and doesn't inspect the packet itself. The actual parsing is doing later in
26 //! rtcp::Session using rtcp::Traverser.
27 class Parser : public packet::IParser, public core::NonCopyable<> {
28 public:
29  //! Initialization.
30  Parser();
31 
32  //! Parse packet from buffer.
33  virtual bool parse(packet::Packet& packet, const core::Slice<uint8_t>& buffer);
34 };
35 
36 } // namespace rtcp
37 } // namespace roc
38 
39 #endif // ROC_RTCP_PARSER_H_
Base class for non-copyable objects.
Definition: noncopyable.h:23
Packet parser interface.
Definition: iparser.h:22
RTCP packet parser.
Definition: parser.h:27
Parser()
Initialization.
virtual bool parse(packet::Packet &packet, const core::Slice< uint8_t > &buffer)
Parse packet from buffer.
Packet parser interface.
Root namespace.
Non-copyable object.