pub struct Vp9CodecConfig {
pub profile: u8,
pub level: u8,
pub bit_depth: u8,
pub chroma_subsampling: u8,
pub video_full_range: bool,
pub colour_primaries: u8,
pub transfer_characteristics: u8,
pub matrix_coefficients: u8,
}Expand description
A VP9 stream’s codec configuration: what an MP4 vpcC box or a WebM
CodecPrivate element says about it.
The VP9 bitstream describes itself, so this is a summary for capability
discovery and codec strings rather than something decoding needs. The
vpcC box is version 1 of the VP Codec ISO Media File Format Binding
(VPCodecConfigurationRecord); version 0, an earlier draft some muxers
still write, is read as well. WebM’s CodecPrivate is the optional
list of (ID, length, value) features of the WebM VP9 codec mapping, of
which profile (1), level (2), bit depth (3) and chroma subsampling (4)
are defined; any it leaves out take the profile 0 defaults.
Fields§
§profile: u8§level: u8The VP9 level times ten (31 is level 3.1), or 0 when unspecified.
bit_depth: u8§chroma_subsampling: u80 and 1 are 4:2:0 (vertical and colocated chroma), 2 is 4:2:2 and 3 is 4:4:4.
video_full_range: bool§colour_primaries: u8ISO/IEC 23091-2 colour description; 2 means unspecified.
transfer_characteristics: u8§matrix_coefficients: u8Implementations§
Source§impl Vp9CodecConfig
impl Vp9CodecConfig
Sourcepub fn parse(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8]) -> Result<Self>
Reads a complete vpcC box (size, type and payload) or, when the
bytes are not one, a WebM CodecPrivate. Empty bytes are an empty
CodecPrivate.
Sourcepub fn parse_vpcc(whole: &[u8]) -> Result<Self>
pub fn parse_vpcc(whole: &[u8]) -> Result<Self>
Reads a complete vpcC box.
Sourcepub fn parse_webm_codec_private(bytes: &[u8]) -> Result<Self>
pub fn parse_webm_codec_private(bytes: &[u8]) -> Result<Self>
Reads a WebM VP9 CodecPrivate.
Sourcepub fn codec_profile(&self) -> Result<CodecProfile>
pub fn codec_profile(&self) -> Result<CodecProfile>
The normalized profile.
Sourcepub fn to_vpcc(&self) -> Vec<u8> ⓘ
pub fn to_vpcc(&self) -> Vec<u8> ⓘ
The complete version 1 vpcC box describing this configuration,
with no codec initialization data.
Sourcepub fn codec_string(&self) -> String
pub fn codec_string(&self) -> String
The vp09.PP.LL.DD codec string of the VP9 ISO-BMFF binding, which
WebCodecs and MediaSource accept. An unspecified or invalid level
is written as level 1.0, since the string requires one.