pub struct DecoderFactory;Expand description
Factory for creating decoders with a single, strict backend selection.
Backend matrix (driven by DecoderConfig::backend):
- [
DecoderBackend::Apple] / [DecoderBackend::Android] — hardware backend, only present in the type when the matching feature andtarget_osare active. No runtime fallback. DecoderBackend::Symphonia— software backend, present when thesymphoniafeature is enabled. No runtime fallback.
Implementations§
Source§impl DecoderFactory
impl DecoderFactory
Sourcepub fn create_from_media_info<R>(
source: R,
media_info: &MediaInfo,
config: &DecoderConfig,
) -> DecodeResult<Box<dyn Decoder>>
pub fn create_from_media_info<R>( source: R, media_info: &MediaInfo, config: &DecoderConfig, ) -> DecodeResult<Box<dyn Decoder>>
Create decoder from MediaInfo (kithara-audio entry point).
Extracts codec from MediaInfo and creates the appropriate decoder.
§Errors
Returns error if codec cannot be determined or decoder creation fails. No fallback — a failure is terminal.
Sourcepub fn create_with_probe<R>(
source: R,
hint: Option<&str>,
config: &DecoderConfig,
) -> DecodeResult<Box<dyn Decoder>>
pub fn create_with_probe<R>( source: R, hint: Option<&str>, config: &DecoderConfig, ) -> DecodeResult<Box<dyn Decoder>>
Create decoder from a file-extension hint.
§Errors
Returns DecodeError::ProbeFailed when the hint is missing or too
weak to pick a codec, and DecodeError::* for backend failures.
No fallback — callers must supply a usable hint.
Auto Trait Implementations§
impl Freeze for DecoderFactory
impl RefUnwindSafe for DecoderFactory
impl Send for DecoderFactory
impl Sync for DecoderFactory
impl Unpin for DecoderFactory
impl UnsafeUnpin for DecoderFactory
impl UnwindSafe for DecoderFactory
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