Expand description
Annex B NAL unit framing and conversion.
Structs§
- NalIterator
- Iterates complete Annex B NAL units, leaving an unterminated final unit for
flush.
Enums§
- Error
- Annex B parsing errors.
Constants§
- START_
CODE - The four-byte Annex B start code preceding a NAL unit.
Functions§
- after_
start_ code - Return the leading start code size, or
Noneif more bytes are needed. - build_
prefix - Concatenate
start_code | nalfor every NAL innalsand freeze the result. Used to build a keyframe parameter-set prefix for an Annex-B elementary stream. - find_
start_ code - Return the byte offset and size of the first start code in the buffer.
- from_
length_ prefixed - Convert a length-prefixed NALU payload (avc1 / hvc1 wire shape) to Annex-B,
injecting
prefixbytes (typically VPS/SPS/PPS NAL units already in Annex-B form) after a leading access unit delimiter, or before the other NAL units. - length_
prefixed_ to_ annexb - Rewrite a length-prefixed NALU buffer (avc1/hvc1 sample, each NAL preceded
by a
length_size-byte big-endian length) into Annex-B by replacing every length prefix with a 4-byte start code. This is the inverse of the length-prefixing done bycrate::codec::h264::Avc1/crate::codec::h265::Hvc1.
Type Aliases§
- Result
- A result using this module’s error type.