Struct matroska_demuxer::MatroskaFile
source · pub struct MatroskaFile<R: Read + Seek> { /* private fields */ }
Expand description
Demuxer for Matroska files.
Implementations§
source§impl<R: Read + Seek> MatroskaFile<R>
impl<R: Read + Seek> MatroskaFile<R>
sourcepub fn open(file: R) -> Result<Self, DemuxError>
pub fn open(file: R) -> Result<Self, DemuxError>
Opens a Matroska file.
sourcepub fn ebml_header(&self) -> &EbmlHeader
pub fn ebml_header(&self) -> &EbmlHeader
Returns the EBML header.
sourcepub fn tracks(&self) -> &[TrackEntry]
pub fn tracks(&self) -> &[TrackEntry]
Returns the tracks of the file.
sourcepub fn chapters(&self) -> Option<&[EditionEntry]>
pub fn chapters(&self) -> Option<&[EditionEntry]>
Returns the chapters of the file.
Element containing metadata describing tracks, editions, chapters, attachments, or the segment as a whole.
sourcepub fn next_frame(&mut self, frame: &mut Frame) -> Result<bool, DemuxError>
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.
sourcepub fn seek(&mut self, seek_timestamp: u64) -> Result<(), DemuxError>
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.