SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
Loading...
Searching...
No Matches
h266.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <stdbool.h>
13#include <stdint.h>
14
15#include <slice99.h>
16
17#include <smolrtsp/priv/compiler_attrs.h>
18
22#define SMOLRTSP_H266_NAL_HEADER_SIZE sizeof(uint16_t)
23
29#define SMOLRTSP_H266_FU_HEADER_SIZE \
30 (/* payload-hdr */ sizeof(uint16_t) + /* fu-header */ sizeof(uint8_t))
31
69
84
89 uint8_t bytes[restrict static 2]) SMOLRTSP_PRIV_MUST_USE;
90
95 SMOLRTSP_PRIV_MUST_USE;
96
101 SMOLRTSP_PRIV_MUST_USE;
102
107 SMOLRTSP_PRIV_MUST_USE;
108
113 SMOLRTSP_PRIV_MUST_USE;
114
120 SMOLRTSP_PRIV_MUST_USE;
121
127 SMOLRTSP_PRIV_MUST_USE;
128
141 SmolRTSP_H266NalHeader self, uint8_t buffer[restrict],
142 bool is_first_fragment, bool is_last_fragment);
143
144/* --- VVC NAL unit types (H.266 spec §7.4.2.2 Table 5) ---------------- */
145
147#define SMOLRTSP_H266_NAL_UNIT_TRAIL_NUT 0
148
150#define SMOLRTSP_H266_NAL_UNIT_STSA_NUT 1
151
153#define SMOLRTSP_H266_NAL_UNIT_RADL_NUT 2
154
156#define SMOLRTSP_H266_NAL_UNIT_RASL_NUT 3
157
159#define SMOLRTSP_H266_NAL_UNIT_IDR_W_RADL 7
160
162#define SMOLRTSP_H266_NAL_UNIT_IDR_N_LP 8
163
165#define SMOLRTSP_H266_NAL_UNIT_CRA_NUT 9
166
168#define SMOLRTSP_H266_NAL_UNIT_GDR_NUT 10
169
171#define SMOLRTSP_H266_NAL_UNIT_OPI_NUT 12
172
174#define SMOLRTSP_H266_NAL_UNIT_DCI_NUT 13
175
177#define SMOLRTSP_H266_NAL_UNIT_VPS_NUT 14
178
180#define SMOLRTSP_H266_NAL_UNIT_SPS_NUT 15
181
183#define SMOLRTSP_H266_NAL_UNIT_PPS_NUT 16
184
186#define SMOLRTSP_H266_NAL_UNIT_PREFIX_APS_NUT 17
187
189#define SMOLRTSP_H266_NAL_UNIT_SUFFIX_APS_NUT 18
190
192#define SMOLRTSP_H266_NAL_UNIT_PH_NUT 19
193
195#define SMOLRTSP_H266_NAL_UNIT_AUD_NUT 20
196
198#define SMOLRTSP_H266_NAL_UNIT_EOS_NUT 21
199
201#define SMOLRTSP_H266_NAL_UNIT_EOB_NUT 22
202
204#define SMOLRTSP_H266_NAL_UNIT_PREFIX_SEI_NUT 23
205
207#define SMOLRTSP_H266_NAL_UNIT_SUFFIX_SEI_NUT 24
208
210#define SMOLRTSP_H266_NAL_UNIT_FD_NUT 25
211
217#define SMOLRTSP_H266_NAL_UNIT_AP 28
218
223#define SMOLRTSP_H266_NAL_UNIT_FU 29
SmolRTSP_H266NalHeader SmolRTSP_H266NalHeader_parse(uint8_t bytes[restrict static 2]) SMOLRTSP_PRIV_MUST_USE
Parses an H.266 NAL header from bytes.
bool SmolRTSP_H266NalHeader_is_pps(SmolRTSP_H266NalHeader self) SMOLRTSP_PRIV_MUST_USE
Checks whether self is PPS.
bool SmolRTSP_H266NalHeader_is_vps(SmolRTSP_H266NalHeader self) SMOLRTSP_PRIV_MUST_USE
Checks whether self is VPS.
bool SmolRTSP_H266NalHeader_is_sps(SmolRTSP_H266NalHeader self) SMOLRTSP_PRIV_MUST_USE
Checks whether self is SPS.
bool SmolRTSP_H266NalHeader_is_coded_slice_non_idr(SmolRTSP_H266NalHeader self) SMOLRTSP_PRIV_MUST_USE
Checks whether self is a coded slice non-IDR (TRAIL_NUT, STSA_NUT, RADL_NUT, RASL_NUT,...
bool SmolRTSP_H266NalHeader_is_coded_slice_idr(SmolRTSP_H266NalHeader self) SMOLRTSP_PRIV_MUST_USE
Checks whether self is a coded slice IDR (either IDR_W_RADL or IDR_N_LP).
void SmolRTSP_H266NalHeader_write_fu_header(SmolRTSP_H266NalHeader self, uint8_t buffer[restrict], bool is_first_fragment, bool is_last_fragment)
Writes an FU payload header and FU header for self into buffer.
uint16_t SmolRTSP_H266NalHeader_serialize(SmolRTSP_H266NalHeader self) SMOLRTSP_PRIV_MUST_USE
Converts self to a two-octet representation.
An H.266 NAL header (RFC 9328 §1.1.4 / VVC spec §7.3.1.2).
Definition h266.h:43
uint8_t nuh_layer_id
nuh_layer_id u(6).
Definition h266.h:57
uint8_t nuh_temporal_id_plus1
nuh_temporal_id_plus1 u(3).
Definition h266.h:67
bool nuh_reserved_zero_bit
nuh_reserved_zero_bit f(1).
Definition h266.h:52
bool forbidden_zero_bit
forbidden_zero_bit f(1).
Definition h266.h:47
uint8_t unit_type
nal_unit_type u(5).
Definition h266.h:62
An H.266 NAL unit.
Definition h266.h:73
U8Slice99 payload
The payload data of this NAL unit (not including the header).
Definition h266.h:82
SmolRTSP_H266NalHeader header
The NAL header of this NAL unit.
Definition h266.h:77