Skip to main content

CodecString

Enum CodecString 

Source
pub enum CodecString {
    Avc {
        in_band: bool,
        profile: u8,
        constraints: u8,
        level: u8,
    },
    Hevc {
        in_band: bool,
        profile_space: u8,
        profile: u8,
        compatibility: u32,
        tier: Tier,
        level: u8,
        constraints: [u8; 6],
    },
    Av1 {
        profile: u8,
        level: u8,
        tier: Tier,
        bit_depth: u8,
    },
    DolbyVision {
        base: VideoCodec,
        in_band: bool,
        profile: u8,
        level: u8,
    },
}
Expand description

One video codec string, read.

Variants§

§

Avc

avc1.PPCCLL (avc3 with in_band): profile_idc, the constraint flags byte and level_idc, in hex.

Fields

§in_band: bool
§profile: u8
§constraints: u8
§level: u8
§

Hevc

hvc1.[A-C]P.F.TL.CC… (hev1 with in_band): profile space and general_profile_idc; the 32 compatibility flags as the string writes them (bit-reversed, in hex); tier and general_level_idc (30 times the level: 153 is 5.1); then up to six constraint bytes, those written in hex, the trailing zero ones left out.

Fields

§in_band: bool
§profile_space: u8
§profile: u8
§compatibility: u32
§tier: Tier
§level: u8
§constraints: [u8; 6]
§

Av1

av01.P.LLT.DD: seq_profile, seq_level_idx_0, seq_tier_0 and the bit depth. The optional fields after it are read past and not kept.

Fields

§profile: u8
§level: u8
§tier: Tier
§bit_depth: u8
§

DolbyVision

dvh1.PP.LL (dvhe with in_band) over HEVC, dva1/dvav over H.264, dav1 over AV1: Dolby Vision’s profile and level.

Fields

§in_band: bool
§profile: u8
§level: u8

Implementations§

Source§

impl CodecString

Source

pub fn covers(&self, source: &CodecString) -> bool

Whether a decoder that plays self plays source: the same codec (the sample entry aside: hvc1 and hev1 are one decoder), a profile it decodes, and a tier and level at most its own; for AV1 the same bit depth. A profile decodes itself, and a few decode others by their standard: HEVC Main 10 decodes Main; H.264’s High profiles decode Main, the ones under them and any stream whose constraint flags say it is Main. Compatibility and constraint flags are otherwise not compared.

Source

pub fn codec(&self) -> VideoCodec

The codec it is a string of; Dolby Vision’s is its own base layer’s.

Trait Implementations§

Source§

impl Clone for CodecString

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CodecString

Source§

impl Debug for CodecString

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CodecString

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for CodecString

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

The string’s own form, hex in upper case, as Apple writes it.

Source§

impl Eq for CodecString

Source§

impl FromStr for CodecString

Source§

type Err = CodecStringError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for CodecString

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CodecString

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CodecString

On the wire as its string.

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CodecString

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.