Struct symphonia_core::formats::util::SeekIndex
source · pub struct SeekIndex { /* private fields */ }
Expand description
A SeekIndex
stores SeekPoint
s (generally a sample or frame number to byte offset) within
a media stream and provides methods to efficiently search for the nearest SeekPoint
(s)
given a timestamp.
A SeekIndex
does not require complete coverage of the entire media stream. However, the
better the coverage, the smaller the manual search range the SeekIndex
will return.
Implementations§
source§impl SeekIndex
impl SeekIndex
sourcepub fn insert(&mut self, ts: u64, byte_offset: u64, n_frames: u32)
pub fn insert(&mut self, ts: u64, byte_offset: u64, n_frames: u32)
Insert a SeekPoint
into the index.
sourcepub fn search(&self, frame_ts: u64) -> SeekSearchResult
pub fn search(&self, frame_ts: u64) -> SeekSearchResult
Search the index to find a bounded range of bytes wherein the specified frame timestamp will be contained. If the index is empty, this function simply returns a result indicating the entire stream should be searched manually.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SeekIndex
impl Send for SeekIndex
impl Sync for SeekIndex
impl Unpin for SeekIndex
impl UnwindSafe for SeekIndex
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