Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
h264.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <stdbool.h>
12#include <stdint.h>
13
14#include <slice99.h>
15
16#include <compy/priv/compiler_attrs.h>
17
21#define COMPY_H264_NAL_HEADER_SIZE sizeof(uint8_t)
22
28#define COMPY_H264_FU_HEADER_SIZE \
29 (/* fu-identifier */ sizeof(uint8_t) + /* fu-header */ sizeof(uint8_t))
30
34typedef struct {
39
43 uint8_t ref_idc;
44
48 uint8_t unit_type;
50
54typedef struct {
59
63 U8Slice99 payload;
65
70Compy_H264NalHeader_parse(uint8_t byte_header) COMPY_PRIV_MUST_USE;
71
75uint8_t
77
81bool Compy_H264NalHeader_is_vps(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE;
82
86bool Compy_H264NalHeader_is_sps(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE;
87
91bool Compy_H264NalHeader_is_pps(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE;
92
97 COMPY_PRIV_MUST_USE;
98
103 COMPY_PRIV_MUST_USE;
104
117 Compy_H264NalHeader self, uint8_t buffer[restrict], bool is_first_fragment,
118 bool is_last_fragment);
119
123#define COMPY_H264_NAL_UNIT_UNSPECIFIED 0
124
128#define COMPY_H264_NAL_UNIT_CODED_SLICE_NON_IDR 1
129
133#define COMPY_H264_NAL_UNIT_CODED_SLICE_DATA_PARTITION_A 2
134
138#define COMPY_H264_NAL_UNIT_CODED_SLICE_DATA_PARTITION_B 3
139
143#define COMPY_H264_NAL_UNIT_CODED_SLICE_DATA_PARTITION_C 4
144
148#define COMPY_H264_NAL_UNIT_CODED_SLICE_IDR 5
149
153#define COMPY_H264_NAL_UNIT_SEI 6
154
158#define COMPY_H264_NAL_UNIT_SPS 7
159
163#define COMPY_H264_NAL_UNIT_PPS 8
164
168#define COMPY_H264_NAL_UNIT_AUD 9
169
173#define COMPY_H264_NAL_UNIT_END_OF_SEQUENCE 10
174
178#define COMPY_H264_NAL_UNIT_END_OF_STREAM 11
179
183#define COMPY_H264_NAL_UNIT_FILLER 12
184
188#define COMPY_H264_NAL_UNIT_SPS_EXT 13
189
193#define COMPY_H264_NAL_UNIT_PREFIX 14
194
198#define COMPY_H264_NAL_UNIT_SUBSET_SPS 15
199
203#define COMPY_H264_NAL_UNIT_DPS 16
204
208#define COMPY_H264_NAL_UNIT_CODED_SLICE_AUX 19
209
213#define COMPY_H264_NAL_UNIT_CODED_SLICE_EXT 20
214
219#define COMPY_H264_NAL_UNIT_CODED_SLICE_EXT_DEPTH_VIEW 21
bool Compy_H264NalHeader_is_vps(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE
Checks whether self is VPS.
Definition h264.c:18
bool Compy_H264NalHeader_is_sps(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE
Checks whether self is SPS.
Definition h264.c:23
void Compy_H264NalHeader_write_fu_header(Compy_H264NalHeader self, uint8_t buffer[restrict], bool is_first_fragment, bool is_last_fragment)
Writes a FU header of self to buffer.
Definition h264.c:39
bool Compy_H264NalHeader_is_pps(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE
Checks whether self is PPS.
Definition h264.c:27
uint8_t Compy_H264NalHeader_serialize(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE
Converts self to a single octet representation.
Definition h264.c:13
Compy_H264NalHeader Compy_H264NalHeader_parse(uint8_t byte_header) COMPY_PRIV_MUST_USE
Parses an H.264 NAL header from byte_header.
Definition h264.c:5
bool Compy_H264NalHeader_is_coded_slice_idr(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE
Checks whether self is a coded slice IDR.
Definition h264.c:31
bool Compy_H264NalHeader_is_coded_slice_non_idr(Compy_H264NalHeader self) COMPY_PRIV_MUST_USE
Checks whether self is a coded slice non-IDR.
Definition h264.c:35
An H.264 NAL header.
Definition h264.h:34
uint8_t unit_type
unit_type u(5).
Definition h264.h:48
bool forbidden_zero_bit
forbidden_zero_bit f(1).
Definition h264.h:38
uint8_t ref_idc
nal_ref_idc (u2).
Definition h264.h:43
An H.264 NAL unit.
Definition h264.h:54
Compy_H264NalHeader header
The NAL header of this NAL unit.
Definition h264.h:58
U8Slice99 payload
The payload data of this NAL unit (not including the header).
Definition h264.h:63