pub struct FormatRegistry { /* private fields */ }Expand description
Holds every container format known to a running engine.
Implementations§
Source§impl FormatRegistry
impl FormatRegistry
pub fn new() -> FormatRegistry
pub fn register(&mut self, format: Format)
pub fn by_name(&self, name: &str) -> Option<&Format>
Sourcepub fn by_extension(&self, ext: &str) -> Option<&Format>
pub fn by_extension(&self, ext: &str) -> Option<&Format>
Find a format whose extension list contains ext (case-insensitive,
no leading dot). The cheap “guess by filename” path; probe
inspects content instead.
Sourcepub fn probe(&self, data: &[u8]) -> Option<&Format>
pub fn probe(&self, data: &[u8]) -> Option<&Format>
Identify a format by sniffing a byte prefix: the registered format whose
probe returns the highest positive score wins. Returns
None if nothing recognizes the data.
Sourcepub fn open_demuxer(&self, name: &str, input: Input) -> Result<Box<dyn Demuxer>>
pub fn open_demuxer(&self, name: &str, input: Input) -> Result<Box<dyn Demuxer>>
Open a demuxer for the format named name.
Sourcepub fn open_muxer(&self, name: &str, output: Output) -> Result<Box<dyn Muxer>>
pub fn open_muxer(&self, name: &str, output: Output) -> Result<Box<dyn Muxer>>
Open a muxer for the format named name.
pub fn iter(&self) -> impl Iterator<Item = &Format>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Default for FormatRegistry
impl Default for FormatRegistry
Source§fn default() -> FormatRegistry
fn default() -> FormatRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FormatRegistry
impl RefUnwindSafe for FormatRegistry
impl Send for FormatRegistry
impl Sync for FormatRegistry
impl Unpin for FormatRegistry
impl UnsafeUnpin for FormatRegistry
impl UnwindSafe for FormatRegistry
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