SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
Loading...
Searching...
No Matches
av1.h File Reference

AV1 RTP aggregation-header types, LEB128 helpers, and OBU constants. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <smolrtsp/priv/compiler_attrs.h>
Include dependency graph for av1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SmolRTSP_Av1AggregationHeader
 The AV1 RTP aggregation header byte (AOMedia AV1 RTP §4.4). More...
 

Macros

#define SMOLRTSP_AV1_AGGREGATION_HEADER_SIZE   1
 The size in bytes of the AV1 RTP aggregation header (AOMedia AV1 RTP §4.4).
 
#define SMOLRTSP_AV1_LEB128_MAX_SIZE   10
 Maximum number of bytes that an unsigned 64-bit value can occupy when LEB128-encoded (used for OBU element lengths in AV1 RTP §4.5 and for obu_size inside AV1 OBU headers).
 
#define SMOLRTSP_AV1_OBU_RESERVED_0   0
 AV1 OBU types (AV1 spec §6.2.1).
 
#define SMOLRTSP_AV1_OBU_SEQUENCE_HEADER   1
 
#define SMOLRTSP_AV1_OBU_TEMPORAL_DELIMITER   2
 
#define SMOLRTSP_AV1_OBU_FRAME_HEADER   3
 
#define SMOLRTSP_AV1_OBU_TILE_GROUP   4
 
#define SMOLRTSP_AV1_OBU_METADATA   5
 
#define SMOLRTSP_AV1_OBU_FRAME   6
 
#define SMOLRTSP_AV1_OBU_REDUNDANT_FRAME_HEADER   7
 
#define SMOLRTSP_AV1_OBU_TILE_LIST   8
 
#define SMOLRTSP_AV1_OBU_PADDING   15
 

Functions

void SmolRTSP_Av1AggregationHeader_serialize (SmolRTSP_Av1AggregationHeader self, uint8_t buffer[restrict])
 Serializes self into the single byte at buffer (network order).
 
size_t smolrtsp_av1_leb128_encode (uint64_t value, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE
 Encodes value as a LEB128 unsigned varint into buffer.
 
size_t smolrtsp_av1_leb128_decode (const uint8_t *buffer, size_t buffer_len, uint64_t *value) SMOLRTSP_PRIV_MUST_USE
 Decodes one LEB128 unsigned varint from buffer.
 
size_t smolrtsp_av1_leb128_size (uint64_t value) SMOLRTSP_PRIV_MUST_USE
 Returns the number of bytes that smolrtsp_av1_leb128_encode would write for value.
 

Detailed Description

AV1 RTP aggregation-header types, LEB128 helpers, and OBU constants.

See also
AOMedia AV1 RTP Specification: https://aomediacodec.github.io/av1-rtp-spec/

Macro Definition Documentation

◆ SMOLRTSP_AV1_AGGREGATION_HEADER_SIZE

#define SMOLRTSP_AV1_AGGREGATION_HEADER_SIZE   1

The size in bytes of the AV1 RTP aggregation header (AOMedia AV1 RTP §4.4).

Each RTP packet's payload begins with this single byte before any OBU elements.

Function Documentation

◆ smolrtsp_av1_leb128_decode()

size_t smolrtsp_av1_leb128_decode ( const uint8_t *  buffer,
size_t  buffer_len,
uint64_t *  value 
)

Decodes one LEB128 unsigned varint from buffer.

Parameters
[in]bufferInput buffer.
[in]buffer_lenNumber of bytes available at buffer.
[out]valueDecoded value (only written on success).
Returns
The number of bytes consumed (in [1, SMOLRTSP_AV1_LEB128_MAX_SIZE]), or 0 if the input was truncated or malformed.

◆ smolrtsp_av1_leb128_encode()

size_t smolrtsp_av1_leb128_encode ( uint64_t  value,
uint8_t  buffer[restrict] 
)

Encodes value as a LEB128 unsigned varint into buffer.

Parameters
[in]valueThe value to encode.
[out]bufferOutput buffer; must hold at least SMOLRTSP_AV1_LEB128_MAX_SIZE bytes.
Returns
The number of bytes written (in [1, SMOLRTSP_AV1_LEB128_MAX_SIZE]).