pub struct Mp4Reader<R: Read + Seek> { /* private fields */ }Expand description
A bounded reader over track-level MP4 data.
Implementations§
Source§impl<R: Read + Seek> Mp4Reader<R>
impl<R: Read + Seek> Mp4Reader<R>
Sourcepub fn open_with(reader: R, limits: Limits) -> Result<Self, Error>
pub fn open_with(reader: R, limits: Limits) -> Result<Self, Error>
Opens a stream with caller-supplied resource limits.
Sourcepub fn movie_timescale(&self) -> u32
pub fn movie_timescale(&self) -> u32
Returns the movie timescale.
Sourcepub fn movie_duration(&self) -> u64
pub fn movie_duration(&self) -> u64
Returns the movie duration in movie timescale units.
Sourcepub fn is_fragmented(&self) -> bool
pub fn is_fragmented(&self) -> bool
Reports whether the movie declares or contains fragments.
Sourcepub fn samples(&self, id: TrackId) -> Result<SampleIter<'_>, Error>
pub fn samples(&self, id: TrackId) -> Result<SampleIter<'_>, Error>
Iterates sample metadata without performing I/O.
Sourcepub fn sample_info(&self, id: TrackId, index: u32) -> Result<SampleInfo, Error>
pub fn sample_info(&self, id: TrackId, index: u32) -> Result<SampleInfo, Error>
Returns metadata for one sample.
Sourcepub fn read_sample(&mut self, id: TrackId, index: u32) -> Result<Sample, Error>
pub fn read_sample(&mut self, id: TrackId, index: u32) -> Result<Sample, Error>
Reads one sample into a new allocation.
Sourcepub fn read_sample_into(
&mut self,
id: TrackId,
index: u32,
buf: &mut Vec<u8>,
) -> Result<SampleInfo, Error>
pub fn read_sample_into( &mut self, id: TrackId, index: u32, buf: &mut Vec<u8>, ) -> Result<SampleInfo, Error>
Reads one sample into a reusable buffer.
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Returns the wrapped stream.
Auto Trait Implementations§
impl<R> Freeze for Mp4Reader<R>where
R: Freeze,
impl<R> RefUnwindSafe for Mp4Reader<R>where
R: RefUnwindSafe,
impl<R> Send for Mp4Reader<R>where
R: Send,
impl<R> Sync for Mp4Reader<R>where
R: Sync,
impl<R> Unpin for Mp4Reader<R>where
R: Unpin,
impl<R> UnsafeUnpin for Mp4Reader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Mp4Reader<R>where
R: UnwindSafe,
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