![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Packet composer interface. More...
#include <roc_packet/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. | |
| virtual bool | prepare (Packet &packet, core::Slice< uint8_t > &buffer, size_t payload_size)=0 |
| Prepare buffer for composing a packet. | |
| virtual bool | pad (Packet &packet, size_t padding_size)=0 |
| Pad packet. | |
| virtual bool | compose (Packet &packet)=0 |
| Compose packet to buffer. | |
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::fec::Composer< PayloadID, Type, Pos >, roc::rtcp::Composer, and roc::rtp::Composer.
|
pure virtual |
Compose packet to buffer.
packet headers and payloads to the buffer attached to it during a previous prepare() call. Implemented in roc::fec::Composer< PayloadID, Type, Pos >, roc::rtcp::Composer, and roc::rtp::Composer.
Pad packet.
padding_size parameter should be less than or equal to the packet payload size. Implemented in roc::fec::Composer< PayloadID, Type, Pos >, roc::rtcp::Composer, and roc::rtp::Composer.
|
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::fec::Composer< PayloadID, Type, Pos >, roc::rtcp::Composer, and roc::rtp::Composer.