Skip to main content

Module codec_config

Module codec_config 

Source
Expand description

Portable derivation of WebCodecs codec strings and CodecProfile values from raw MP4 hvcC/av1C/vpcC codec configuration boxes and for VP8, which has none, and the VP9 codec configuration record (Vp9CodecConfig).

This module contains no browser (web_sys) types so it can be unit tested natively. It is consumed by the browser WebCodecs decoder factory to build the codec string WebCodecs’ isConfigSupported/VideoDecoder APIs require, and to select a normalized CodecProfile.

Structs§

DerivedCodecString
A codec string plus the normalized profile it was derived from.
Vp9CodecConfig
A VP9 stream’s codec configuration: what an MP4 vpcC box or a WebM CodecPrivate element says about it.

Functions§

derive_codec_string
Derives a WebCodecs codec string and CodecProfile from a track’s complete raw codec configuration box (including its size/fourcc header): hvcC, av1C or Opus’s dOps. Vorbis has no MP4 box, so its configuration is the Xiph-laced CodecPrivate crate::VorbisConfig reads.