Struct symphonia_core::codecs::CodecRegistry
source · pub struct CodecRegistry { /* private fields */ }
Expand description
A CodecRegistry
allows the registration of codecs, and provides a method to instantiate a
Decoder
given a CodecParameters
object.
Implementations§
source§impl CodecRegistry
impl CodecRegistry
sourcepub fn get_codec(&self, codec: CodecType) -> Option<&CodecDescriptor>
pub fn get_codec(&self, codec: CodecType) -> Option<&CodecDescriptor>
Gets the CodecDescriptor
for a registered codec.
sourcepub fn register_all<D: Decoder>(&mut self)
pub fn register_all<D: Decoder>(&mut self)
Registers all codecs supported by Decoder
. If a supported codec was previously registered
by another Decoder
it will be replaced within the registry.
sourcepub fn register(&mut self, descriptor: &CodecDescriptor)
pub fn register(&mut self, descriptor: &CodecDescriptor)
Register a single codec. If the codec was previously registered it will be replaced within the registry.
sourcepub fn make(
&self,
params: &CodecParameters,
options: &DecoderOptions
) -> Result<Box<dyn Decoder>>
pub fn make( &self, params: &CodecParameters, options: &DecoderOptions ) -> Result<Box<dyn Decoder>>
Searches the registry for a Decoder
that supports the codec. If one is found, it will be
instantiated with the provided CodecParameters
and returned. If a Decoder
could not be
found, or the CodecParameters
are either insufficient or invalid for the Decoder
, an
error will be returned.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CodecRegistry
impl Send for CodecRegistry
impl Sync for CodecRegistry
impl Unpin 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