SmolRTSP  0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
h265.h File Reference

H.265 NAL representation. More...

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

Go to the source code of this file.

Data Structures

struct  SmolRTSP_H265NalHeader
 An H.265 NAL header. More...
 
struct  SmolRTSP_H265NalUnit
 An H.265 NAL unit. More...
 

Macros

#define SMOLRTSP_H265_NAL_HEADER_SIZE   sizeof(uint16_t)
 The size of an H.265 NAL header.
 
#define SMOLRTSP_H265_FU_HEADER_SIZE    (/* payload-hdr */ sizeof(uint16_t) + /* fu-header */ sizeof(uint8_t))
 The size of an H.265 fragmentation unit (FU) header. More...
 
#define SMOLRTSP_H265_NAL_UNIT_TRAIL_N   0
 Coded slice segment of a non-TSA, non-STSA trailing picture.
 
#define SMOLRTSP_H265_NAL_UNIT_TRAIL_R   1
 Coded slice segment of a non-TSA, non-STSA trailing picture.
 
#define SMOLRTSP_H265_NAL_UNIT_TSA_N   2
 Coded slice segment of a TSA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_TSA_R   3
 Coded slice segment of a TSA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_STSA_N   4
 Coded slice segment of an STSA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_STSA_R   5
 Coded slice segment of an STSA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_RADL_N   6
 Coded slice segment of a RADL picture.
 
#define SMOLRTSP_H265_NAL_UNIT_RADL_R   7
 Coded slice segment of a RADL picture.
 
#define SMOLRTSP_H265_NAL_UNIT_RASL_N   8
 Coded slice segment of a RASL picture.
 
#define SMOLRTSP_H265_NAL_UNIT_RASL_R   9
 Coded slice segment of a RASL picture.
 
#define SMOLRTSP_H265_NAL_UNIT_BLA_W_LP   16
 Coded slice segment of a BLA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_BLA_W_RADL   17
 Coded slice segment of a BLA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_BLA_N_LP   18
 Coded slice segment of a BLA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_IDR_W_RADL   19
 Coded slice segment of an IDR picture.
 
#define SMOLRTSP_H265_NAL_UNIT_IDR_N_LP   20
 Coded slice segment of an IDR picture.
 
#define SMOLRTSP_H265_NAL_UNIT_CRA_NUT   21
 Coded slice segment of a CRA picture.
 
#define SMOLRTSP_H265_NAL_UNIT_VPS_NUT   32
 Video parameter set.
 
#define SMOLRTSP_H265_NAL_UNIT_SPS_NUT   33
 Sequence parameter set.
 
#define SMOLRTSP_H265_NAL_UNIT_PPS_NUT   34
 Picture parameter set.
 
#define SMOLRTSP_H265_NAL_UNIT_AUD_NUT   35
 Access unit delimiter.
 
#define SMOLRTSP_H265_NAL_UNIT_EOS_NUT   36
 End of sequence.
 
#define SMOLRTSP_H265_NAL_UNIT_EOB_NUT   37
 End of bitstream.
 
#define SMOLRTSP_H265_NAL_UNIT_FD_NUT   38
 Filler data.
 
#define SMOLRTSP_H265_NAL_UNIT_PREFIX_SEI_NUT   39
 Supplemental enhancement information.
 
#define SMOLRTSP_H265_NAL_UNIT_SUFFIX_SEI_NUT   40
 Supplemental enhancement information.
 

Functions

SmolRTSP_H265NalHeader SmolRTSP_H265NalHeader_parse (uint8_t bytes[restrict static 2]) SMOLRTSP_PRIV_MUST_USE
 Parses an H.265 NAL header from byte_header.
 
uint16_t SmolRTSP_H265NalHeader_serialize (SmolRTSP_H265NalHeader self) SMOLRTSP_PRIV_MUST_USE
 Converts self to a two-octet representation.
 
bool SmolRTSP_H265NalHeader_is_vps (SmolRTSP_H265NalHeader self) SMOLRTSP_PRIV_MUST_USE
 Checks whether self is VPS.
 
bool SmolRTSP_H265NalHeader_is_sps (SmolRTSP_H265NalHeader self) SMOLRTSP_PRIV_MUST_USE
 Checks whether self is SPS.
 
bool SmolRTSP_H265NalHeader_is_pps (SmolRTSP_H265NalHeader self) SMOLRTSP_PRIV_MUST_USE
 Checks whether self is PPS.
 
bool SmolRTSP_H265NalHeader_is_coded_slice_idr (SmolRTSP_H265NalHeader self) SMOLRTSP_PRIV_MUST_USE
 Checks whether self is a coded slice IDR.
 
bool SmolRTSP_H265NalHeader_is_coded_slice_non_idr (SmolRTSP_H265NalHeader self) SMOLRTSP_PRIV_MUST_USE
 Checks whether self is a coded slice non-IDR.
 
void SmolRTSP_H265NalHeader_write_fu_header (SmolRTSP_H265NalHeader self, uint8_t buffer[restrict], bool is_first_fragment, bool is_last_fragment)
 Writes a FU header of self to buffer. More...
 

Detailed Description

H.265 NAL representation.

See also
H.265 spec: https://www.itu.int/rec/T-REC-H.265.

Macro Definition Documentation

◆ SMOLRTSP_H265_FU_HEADER_SIZE

#define SMOLRTSP_H265_FU_HEADER_SIZE    (/* payload-hdr */ sizeof(uint16_t) + /* fu-header */ sizeof(uint8_t))

The size of an H.265 fragmentation unit (FU) header.

See also
https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.3

Function Documentation

◆ SmolRTSP_H265NalHeader_write_fu_header()

void SmolRTSP_H265NalHeader_write_fu_header ( SmolRTSP_H265NalHeader  self,
uint8_t  buffer[restrict],
bool  is_first_fragment,
bool  is_last_fragment 
)

Writes a FU header of self to buffer.

Parameters
[in]selfThe header to write.
[out]bufferThe memory area capable of storing SMOLRTSP_H265_FU_HEADER_SIZE bytes.
[in]is_first_fragmentThe indication of a start of the FU.
[in]is_last_fragmentThe indication of an end of the FU.
See also
https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.3