Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
composer.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/composer.h
10
//! @brief RTP packet composer.
11
12
#ifndef ROC_RTP_COMPOSER_H_
13
#define ROC_RTP_COMPOSER_H_
14
15
#include "
roc_core/noncopyable.h
"
16
#include "
roc_packet/icomposer.h
"
17
18
namespace
roc
{
19
namespace
rtp
{
20
21
//! RTP packet composer.
22
class
Composer
:
public
packet::IComposer
,
public
core::NonCopyable
<> {
23
public
:
24
//! Initialization.
25
//! @remarks
26
//! If @p inner_composer is not NULL, it is used to compose the packet payload.
27
Composer
(
packet::IComposer
* inner_composer);
28
29
//! Adjust buffer to align payload.
30
virtual
bool
31
align
(
core::Slice<uint8_t>
& buffer,
size_t
header_size,
size_t
payload_alignment);
32
33
//! Prepare buffer for composing a packet.
34
virtual
bool
35
prepare
(
packet::Packet
&
packet
,
core::Slice<uint8_t>
& buffer,
size_t
payload_size);
36
37
//! Pad packet.
38
virtual
bool
pad
(
packet::Packet
&
packet
,
size_t
padding_size);
39
40
//! Compose packet to buffer.
41
virtual
bool
compose
(
packet::Packet
&
packet
);
42
43
private
:
44
packet::IComposer
* inner_composer_;
45
};
46
47
}
// namespace rtp
48
}
// namespace roc
49
50
#endif
// ROC_RTP_COMPOSER_H_
roc::core::NonCopyable
Base class for non-copyable objects.
Definition
noncopyable.h:23
roc::core::Slice
Slice.
Definition
slice.h:55
roc::packet::IComposer
Packet composer interface.
Definition
icomposer.h:22
roc::packet::Packet
Packet.
Definition
packet.h:39
roc::rtp::Composer::compose
virtual bool compose(packet::Packet &packet)
Compose packet to buffer.
roc::rtp::Composer::prepare
virtual bool prepare(packet::Packet &packet, core::Slice< uint8_t > &buffer, size_t payload_size)
Prepare buffer for composing a packet.
roc::rtp::Composer::pad
virtual bool pad(packet::Packet &packet, size_t padding_size)
Pad packet.
roc::rtp::Composer::align
virtual bool align(core::Slice< uint8_t > &buffer, size_t header_size, size_t payload_alignment)
Adjust buffer to align payload.
roc::rtp::Composer::Composer
Composer(packet::IComposer *inner_composer)
Initialization.
icomposer.h
Packet composer interface.
roc::packet
Network packets and packet processing.
roc::rtp
RTP protocol support.
roc
Root namespace.
noncopyable.h
Non-copyable object.
roc_rtp
composer.h
Generated by
1.17.0