Skip to main content

Module decode

Module decode 

Source
Expand description

Decoders for the client camera uplink, and for the checks that read a session’s own output back.

Clients send whatever their browser can produce: H.264 (WebCodecs or the WebRTC media track), VP8/VP9/AV1/HEVC (same sources), or MJPEG from the canvas fallback. Every codec lands in the same I420 view so the rest of the pipeline is codec-agnostic. H.264 decodes through Cisco OpenH264, VP8 and VP9 through libvpx, AV1 through dav1d, HEVC through libde265, and MJPEG through TurboJPEG, which pixelflux already uses for its own JPEG stripes. Decoding is software here; a hardware decoder only changes which Decoder is constructed.

Re-exports§

pub use crate::encoders::codec::Codec;

Structs§

ColorTags
The color a decoded stream declares: the matrix as ISO/IEC 23091-2 codes it (1 BT.709, 5 BT.470BG, 6 SMPTE 170M, 2 unspecified) and whether the range is full.
Dav1dBackend 🔒
dav1d, at the frame delay of one a live uplink wants.
De265Backend 🔒
libde265. Its picture is valid only until the next call into the library, so the planes are copied out as they come.
H264Backend 🔒
Cisco OpenH264, driven through its decoder interface: it conceals the blocks a stream lost and hands back every picture it decodes, one behind a gap included, and the picture stays in its own buffer until the next call.
JpegDecoder
TurboJPEG decoder: 4:2:0 JPEGs decode straight into I420 planes; other subsamplings take the RGB route and are converted.
Picture 🔒
One decoded picture as a backend hands it back: borrowed planes, valid until the backend decodes again.
VideoDecoder
A software decoder for one of the inter-coded codecs.
VpxBackend 🔒
libvpx’s VP8 and VP9 decoders. VP9 declares its matrix and range in every frame; VP8’s keyframe header carries one color-space bit, BT.601 or reserved, and a clamping bit.

Enums§

Backend 🔒
Chroma 🔒
The chroma sampling of a decoded picture.
DecodeError

Constants§

MAX_JPEG_SIDE 🔒
The widest or tallest picture a camera’s JPEG may claim, far past any webcam.

Traits§

Decoder

Functions§

new_decoder
sniff_keyframe
Whether an encoded frame is a key frame, read from the bitstream itself: every codec here declares it in its first bytes or NAL types.
vp8_color_bits 🔒
VP8’s color_space and clamping_type bits, the first two bool-coded fields of a key frame’s first partition.