pub trait CodecParser {
const CODEC: CodecId;
// Required methods
fn parse_config(data: &[u8]) -> Option<VideoParams>;
fn is_random_access_point(data: &[u8]) -> bool;
fn carries_config(data: &[u8]) -> bool;
fn hls_codec_string(params: &VideoParams) -> String;
}codec only.Expand description
One parser per codec. Pure, allocation-light, &[u8]-in.
The engine never calls these directly — protocol handlers do, at the ingest
boundary, to classify frames (FrameType) and populate
metadata. The kernel’s GOP cache, segmenter, eviction, and recorder all key
on is_keyframe, so a correct
is_random_access_point is all that’s needed to make a codec “work”.
Required Associated Constants§
Required Methods§
Sourcefn parse_config(data: &[u8]) -> Option<VideoParams>
fn parse_config(data: &[u8]) -> Option<VideoParams>
Parse the parameter set(s) / sequence header into VideoParams.
Returns None if no usable header is present or it cannot be decoded.
Sourcefn is_random_access_point(data: &[u8]) -> bool
fn is_random_access_point(data: &[u8]) -> bool
Whether this access unit is a random-access point (IDR/CRA/KEY_FRAME) — the signal the engine anchors GOP caching and segmentation on.
Sourcefn carries_config(data: &[u8]) -> bool
fn carries_config(data: &[u8]) -> bool
Whether this access unit carries decoder configuration (parameter sets / sequence header) that should be cached for late joiners.
Sourcefn hls_codec_string(params: &VideoParams) -> String
fn hls_codec_string(params: &VideoParams) -> String
The HLS CODECS attribute for these parameters
(e.g. "hvc1.1.6.L93.B0", "av01.0.04M.08").
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl CodecParser for Av1
Available on crate feature codec-av1 only.
impl CodecParser for Av1
codec-av1 only.Source§impl CodecParser for H264
Available on crate feature codec-h264 only.
impl CodecParser for H264
codec-h264 only.Source§impl CodecParser for H265
Available on crate feature codec-h265 only.
impl CodecParser for H265
codec-h265 only.Source§impl CodecParser for Vp9
Available on crate feature codec-vp9 only.
impl CodecParser for Vp9
codec-vp9 only.