Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Packet composer interface. More...
#include <icomposer.h>
Public Member Functions | |
virtual bool | align (core::Slice< uint8_t > &buffer, size_t header_size, size_t payload_alignment)=0 |
Adjust buffer to align payload. More... | |
virtual bool | prepare (Packet &packet, core::Slice< uint8_t > &buffer, size_t payload_size)=0 |
Prepare buffer for composing a packet. More... | |
virtual bool | pad (Packet &packet, size_t padding_size)=0 |
Pad packet. More... | |
virtual bool | compose (Packet &packet)=0 |
Compose packet to buffer. More... | |
Packet composer interface.
Definition at line 22 of file icomposer.h.
|
pure virtual |
Adjust buffer to align payload.
buffer
so that the payload of the most inner composer will have payload_alignment
. The header_size
parameter defines the total size of all headers before the payload. buffer
capacity is not enough. Implemented in roc::rtp::Composer, roc::rtcp::Composer, and roc::fec::Composer< PayloadID, Type, Pos >.
|
pure virtual |
Compose packet to buffer.
packet
headers and payloads to the buffer attached to it during a previous prepare() call. Implemented in roc::rtp::Composer, roc::rtcp::Composer, and roc::fec::Composer< PayloadID, Type, Pos >.
|
pure virtual |
Pad packet.
padding_size
parameter should be less than or equal to the packet payload size. Implemented in roc::rtp::Composer, roc::rtcp::Composer, and roc::fec::Composer< PayloadID, Type, Pos >.
|
pure virtual |
Prepare buffer for composing a packet.
buffer
so that it can fit the packet
headers and payload. If the packet payload contains an inner packet, calls the inner composer as well The payload_size
refers to the payload of the most inner packet. Modifies the packet
so that its payload fields point to the appropriate parts of the buffer
. buffer
capacity is not enough. Implemented in roc::rtp::Composer, roc::rtcp::Composer, and roc::fec::Composer< PayloadID, Type, Pos >.