pub struct CodecDescriptor {
pub codec_id: CodecId,
pub name: String,
pub long_name: Option<String>,
pub fourccs: Vec<Fourcc>,
pub can_encode: bool,
pub can_decode: bool,
pub is_lossless: bool,
pub profiles: Vec<CodecProfile>,
pub max_bit_depth: u8,
}Expand description
Complete description of a codec as stored in the registry.
Fields§
§codec_id: CodecIdCanonical CodecId variant.
name: StringShort lowercase name used for string-based lookup (e.g. "av1").
long_name: Option<String>Optional human-readable long name (e.g. "AOMedia Video 1").
fourccs: Vec<Fourcc>All FOURCC codes associated with this codec.
can_encode: boolWhether this codec entry supports encoding.
can_decode: boolWhether this codec entry supports decoding.
is_lossless: boolWhether lossless mode is available.
profiles: Vec<CodecProfile>Named profiles supported by this codec.
max_bit_depth: u8Maximum bit depth (e.g. 8, 10, 12).
Implementations§
Source§impl CodecDescriptor
impl CodecDescriptor
Sourcepub fn with_long_name(self, s: impl Into<String>) -> Self
pub fn with_long_name(self, s: impl Into<String>) -> Self
Builder: set the long name.
Sourcepub fn with_fourcc(self, fourcc: Fourcc) -> Self
pub fn with_fourcc(self, fourcc: Fourcc) -> Self
Builder: add a FOURCC.
Sourcepub fn with_direction(self, dir: CodecDirection) -> Self
pub fn with_direction(self, dir: CodecDirection) -> Self
Builder: set encode/decode direction.
Sourcepub fn with_lossless(self, lossless: bool) -> Self
pub fn with_lossless(self, lossless: bool) -> Self
Builder: override lossless flag (normally derived from CodecId::is_lossless).
Sourcepub fn with_profile(self, profile: CodecProfile) -> Self
pub fn with_profile(self, profile: CodecProfile) -> Self
Builder: add a profile entry.
Sourcepub fn with_max_bit_depth(self, depth: u8) -> Self
pub fn with_max_bit_depth(self, depth: u8) -> Self
Builder: set maximum bit depth.
Sourcepub fn has_fourcc(&self, fourcc: &Fourcc) -> bool
pub fn has_fourcc(&self, fourcc: &Fourcc) -> bool
Returns true if this descriptor supports a given FOURCC.
Sourcepub fn profile_by_name(&self, name: &str) -> Option<&CodecProfile>
pub fn profile_by_name(&self, name: &str) -> Option<&CodecProfile>
Look up a profile by name (case-insensitive).
Sourcepub fn profile_by_id(&self, id: u32) -> Option<&CodecProfile>
pub fn profile_by_id(&self, id: u32) -> Option<&CodecProfile>
Look up a profile by numeric id.
Trait Implementations§
Source§impl Clone for CodecDescriptor
impl Clone for CodecDescriptor
Source§fn clone(&self) -> CodecDescriptor
fn clone(&self) -> CodecDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CodecDescriptor
impl RefUnwindSafe for CodecDescriptor
impl Send for CodecDescriptor
impl Sync for CodecDescriptor
impl Unpin for CodecDescriptor
impl UnsafeUnpin for CodecDescriptor
impl UnwindSafe for CodecDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more