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§
- Color
Tags - 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.
- Dav1d
Backend 🔒 - dav1d, at the frame delay of one a live uplink wants.
- De265
Backend 🔒 - libde265. Its picture is valid only until the next call into the library, so the planes are copied out as they come.
- H264
Backend 🔒 - 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.
- Jpeg
Decoder - 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.
- Video
Decoder - 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.
- Decode
Error
Constants§
- MAX_
JPEG_ 🔒SIDE - The widest or tallest picture a camera’s JPEG may claim, far past any webcam.
Traits§
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_spaceandclamping_typebits, the first two bool-coded fields of a key frame’s first partition.