pub struct MatroskaFile<R: Read + Seek> { /* private fields */ }
Expand description

Demuxer for Matroska files.

Implementations§

source§

impl<R: Read + Seek> MatroskaFile<R>

source

pub fn open(file: R) -> Result<Self, DemuxError>

Opens a Matroska file.

source

pub fn ebml_header(&self) -> &EbmlHeader

Returns the EBML header.

source

pub fn info(&self) -> &Info

Returns the segment info.

source

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

Returns the tracks of the file.

source

pub fn chapters(&self) -> Option<&[EditionEntry]>

Returns the chapters of the file.

source

pub fn tags(&self) -> Option<&[Tag]>

Element containing metadata describing tracks, editions, chapters, attachments, or the segment as a whole.

source

pub fn next_frame(&mut self, frame: &mut Frame) -> Result<bool, DemuxError>

Reads the next frame data into the given Frame.

Returns false if the end of the file is reached.

source

pub fn seek(&mut self, seek_timestamp: u64) -> Result<(), DemuxError>

Seeks to the given timestamp. The next next_frame() will write the first frame that comes directly AFTER the given timestamp. If the timestamp is outside of the duration of the video, the next next_frame() will return None.

Seek operations will use Cues inside the file for faster seek operation. If no Cues are present, this function will do a linear search through all clusters / blocks until the first frame after the given timestamp is found.

Trait Implementations§

source§

impl<R: Clone + Read + Seek> Clone for MatroskaFile<R>

source§

fn clone(&self) -> MatroskaFile<R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<R: Debug + Read + Seek> Debug for MatroskaFile<R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for MatroskaFile<R>where R: RefUnwindSafe,

§

impl<R> Send for MatroskaFile<R>where R: Send,

§

impl<R> Sync for MatroskaFile<R>where R: Sync,

§

impl<R> Unpin for MatroskaFile<R>where R: Unpin,

§

impl<R> UnwindSafe for MatroskaFile<R>where R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.