pub struct CodecRegistry { /* private fields */ }Expand description
Central registry of codec descriptors.
Stores at most one descriptor per CodecId. Secondary indices on name and
FOURCC are rebuilt lazily on mutation.
Implementations§
Source§impl CodecRegistry
impl CodecRegistry
Sourcepub fn register(&mut self, desc: CodecDescriptor)
pub fn register(&mut self, desc: CodecDescriptor)
Register or replace a codec descriptor.
Updates all secondary indices automatically.
Sourcepub fn remove(&mut self, id: CodecId) -> Option<CodecDescriptor>
pub fn remove(&mut self, id: CodecId) -> Option<CodecDescriptor>
Remove a codec by CodecId.
Returns the removed descriptor, or None if it was not registered.
Sourcepub fn lookup_by_id(&self, id: CodecId) -> Option<&CodecDescriptor>
pub fn lookup_by_id(&self, id: CodecId) -> Option<&CodecDescriptor>
Look up a descriptor by CodecId.
Sourcepub fn lookup_by_name(&self, name: &str) -> Option<&CodecDescriptor>
pub fn lookup_by_name(&self, name: &str) -> Option<&CodecDescriptor>
Look up a descriptor by short name (case-insensitive).
Sourcepub fn lookup_by_fourcc(&self, fourcc: &Fourcc) -> Option<&CodecDescriptor>
pub fn lookup_by_fourcc(&self, fourcc: &Fourcc) -> Option<&CodecDescriptor>
Look up a descriptor by FOURCC bytes.
Sourcepub fn encoders(&self) -> Vec<&CodecDescriptor>
pub fn encoders(&self) -> Vec<&CodecDescriptor>
Return all descriptors that can encode.
Sourcepub fn decoders(&self) -> Vec<&CodecDescriptor>
pub fn decoders(&self) -> Vec<&CodecDescriptor>
Return all descriptors that can decode.
Sourcepub fn lossless_codecs(&self) -> Vec<&CodecDescriptor>
pub fn lossless_codecs(&self) -> Vec<&CodecDescriptor>
Return all lossless codec descriptors.
Sourcepub fn default_registry() -> Self
pub fn default_registry() -> Self
Build a default registry pre-populated with all OxiMedia-supported codecs.
Trait Implementations§
Source§impl Debug for CodecRegistry
impl Debug for CodecRegistry
Source§impl Default for CodecRegistry
impl Default for CodecRegistry
Source§fn default() -> CodecRegistry
fn default() -> CodecRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodecRegistry
impl RefUnwindSafe for CodecRegistry
impl Send for CodecRegistry
impl Sync for CodecRegistry
impl Unpin for CodecRegistry
impl UnsafeUnpin for CodecRegistry
impl UnwindSafe for CodecRegistry
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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