Skip to main content

Module annexb

Module annexb 

Source
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 None if more bytes are needed.
build_prefix
Concatenate start_code | nal for every NAL in nals and 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 prefix bytes (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 by crate::codec::h264::Avc1 / crate::codec::h265::Hvc1.

Type Aliases§

Result
A result using this module’s error type.