Skip to main content

Mp4Reader

Struct Mp4Reader 

Source
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>

Source

pub fn open(reader: R) -> Result<Self, Error>

Opens a stream with default resource limits.

Source

pub fn open_with(reader: R, limits: Limits) -> Result<Self, Error>

Opens a stream with caller-supplied resource limits.

Source

pub fn brands(&self) -> &Brands

Returns file-type brands.

Source

pub fn movie_timescale(&self) -> u32

Returns the movie timescale.

Source

pub fn movie_duration(&self) -> u64

Returns the movie duration in movie timescale units.

Source

pub fn duration(&self) -> Duration

Returns the movie duration as a standard duration.

Source

pub fn is_fragmented(&self) -> bool

Reports whether the movie declares or contains fragments.

Source

pub fn tracks(&self) -> &[Track]

Returns tracks in movie order.

Source

pub fn track(&self, id: TrackId) -> Option<&Track>

Finds a track by identifier.

Source

pub fn samples(&self, id: TrackId) -> Result<SampleIter<'_>, Error>

Iterates sample metadata without performing I/O.

Source

pub fn sample_info(&self, id: TrackId, index: u32) -> Result<SampleInfo, Error>

Returns metadata for one sample.

Source

pub fn read_sample(&mut self, id: TrackId, index: u32) -> Result<Sample, Error>

Reads one sample into a new allocation.

Source

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.

Source

pub fn fragments(&self) -> &[Fragment]

Returns parsed fragments.

Source

pub fn events(&self) -> &[Event]

Returns top-level event messages.

Source

pub fn metadata(&self) -> &Metadata

Returns user metadata.

Source

pub fn warnings(&self) -> &[Warning]

Returns tolerated parsing warnings.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more