SmolRTSP
0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
|
A generic NAL (Network Abstraction Layer) representation. More...
#include <smolrtsp/nal/h264.h>
#include <smolrtsp/nal/h265.h>
#include <stdbool.h>
#include <stdint.h>
#include <datatype99.h>
#include <slice99.h>
#include <smolrtsp/priv/compiler_attrs.h>
Go to the source code of this file.
Data Structures | |
struct | SmolRTSP_NalUnit |
A generic NAL unit (either H.264 or H.265). More... | |
Typedefs | |
typedef size_t(* | SmolRTSP_NalStartCodeTester) (U8Slice99 data) |
A function that tests whether data starts with some start code. More... | |
Functions | |
datatype99 (SmolRTSP_NalHeader,(SmolRTSP_NalHeader_H264, SmolRTSP_H264NalHeader),(SmolRTSP_NalHeader_H265, SmolRTSP_H265NalHeader)) | |
A generic NAL header (either H.264 or H.265). More... | |
uint8_t | SmolRTSP_NalHeader_unit_type (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Returns the NAL unit type of self . | |
size_t | SmolRTSP_NalHeader_size (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Computes the size of self in bytes. | |
size_t | SmolRTSP_NalHeader_fu_size (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Computes the size of a fragmentation unit (FU) header self . More... | |
bool | SmolRTSP_NalHeader_is_vps (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Checks whether self is VPS. | |
bool | SmolRTSP_NalHeader_is_sps (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Checks whether self is SPS. | |
bool | SmolRTSP_NalHeader_is_pps (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Checks whether self is PPS. | |
bool | SmolRTSP_NalHeader_is_coded_slice_idr (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Checks whether self is a coded slice IDR. | |
bool | SmolRTSP_NalHeader_is_coded_slice_non_idr (SmolRTSP_NalHeader self) SMOLRTSP_PRIV_MUST_USE |
Checks whether self is a coded slice non-IDR. | |
void | SmolRTSP_NalHeader_serialize (SmolRTSP_NalHeader self, uint8_t buffer[restrict]) |
Writes the binary representation of self into buffer . More... | |
void | SmolRTSP_NalHeader_write_fu_header (SmolRTSP_NalHeader self, uint8_t buffer[restrict], bool is_first_fragment, bool is_last_fragment) |
Writes a FU header of self to buffer . More... | |
uint8_t | smolrtsp_nal_fu_header (bool is_first_fragment, bool is_last_fragment, uint8_t unit_type) SMOLRTSP_PRIV_MUST_USE |
Creates a generic NAL FU header. | |
SmolRTSP_NalStartCodeTester | smolrtsp_determine_start_code (U8Slice99 data) SMOLRTSP_PRIV_MUST_USE |
Returns a start code tester for data . More... | |
size_t | smolrtsp_test_start_code_3b (U8Slice99 data) |
The 3-byte start code tester (0x000001 ). | |
size_t | smolrtsp_test_start_code_4b (U8Slice99 data) |
The 3-byte start code tester (0x00000001 ). | |
A generic NAL (Network Abstraction Layer) representation.
typedef size_t(* SmolRTSP_NalStartCodeTester) (U8Slice99 data) |
A function that tests whether data
starts with some start code.
data
, returns 0.datatype99 | ( | SmolRTSP_NalHeader | , |
(SmolRTSP_NalHeader_H264, SmolRTSP_H264NalHeader) | , | ||
(SmolRTSP_NalHeader_H265, SmolRTSP_H265NalHeader) | |||
) |
A generic NAL header (either H.264 or H.265).
See Datatype99 for the macro usage.
SmolRTSP_NalStartCodeTester smolrtsp_determine_start_code | ( | U8Slice99 | data | ) |
Returns a start code tester for data
.
If data
does not begin with a start code (either 0x000001
or 0x00000001
), returns NULL
.
This function is useful when you have some *.h264
bitstream file and you want to determine what start code it uses – just pass the beginning of this file to smolrtsp_determine_start_code and invoke the returned tester multiple times afterwards.
size_t SmolRTSP_NalHeader_fu_size | ( | SmolRTSP_NalHeader | self | ) |
Computes the size of a fragmentation unit (FU) header self
.
void SmolRTSP_NalHeader_serialize | ( | SmolRTSP_NalHeader | self, |
uint8_t | buffer[restrict] | ||
) |
Writes the binary representation of self
into buffer
.
[in] | self | The header to write. |
[out] | buffer | The memory area capable of storing SmolRTSP_NalHeader_size(self) bytes. |
void SmolRTSP_NalHeader_write_fu_header | ( | SmolRTSP_NalHeader | self, |
uint8_t | buffer[restrict], | ||
bool | is_first_fragment, | ||
bool | is_last_fragment | ||
) |
Writes a FU header of self
to buffer
.
[in] | self | The header to write. |
[out] | buffer | The memory area capable of storing SmolRTSP_NalHeader_fu_size(self) bytes. |
[in] | is_first_fragment | The indication of a start of the FU. |
[in] | is_last_fragment | The indication of an end of the FU. |