Skip to main content

SampleIndex

Trait SampleIndex 

Source
pub trait SampleIndex {
    // Required methods
    fn sample_count(&self, stream: usize) -> u64;
    fn sample_info(&self, stream: usize, index: u64) -> Option<SampleInfo>;
    fn read_sample(&mut self, stream: usize, index: u64) -> Result<Packet>;
    fn sync_at_or_before(&self, stream: usize, pts: i64) -> Option<u64>;

    // Provided methods
    fn edit_list(&self, _stream: usize) -> &[EditEntry] { ... }
    fn movie_timescale(&self) -> Option<u32> { ... }
}
Expand description

Random access over a demuxer’s index; see Demuxer::sample_index.

Required Methods§

Source

fn sample_count(&self, stream: usize) -> u64

Samples in stream stream (0 for an unknown stream).

Source

fn sample_info(&self, stream: usize, index: u64) -> Option<SampleInfo>

The index entry of sample index of stream, in decode order.

Source

fn read_sample(&mut self, stream: usize, index: u64) -> Result<Packet>

Read sample index of stream as a packet, in the same form as Demuxer::read_packet would give it (see Demuxer::set_raw_samples).

Source

fn sync_at_or_before(&self, stream: usize, pts: i64) -> Option<u64>

The last sync sample of stream whose presentation time is at or before pts: where decoding starts to show the frame at pts. None if no sync sample is that early.

Provided Methods§

Source

fn edit_list(&self, _stream: usize) -> &[EditEntry]

The stream’s edit list (empty when it has none, or the container has no such thing).

Source

fn movie_timescale(&self) -> Option<u32>

The movie time scale EditEntry::segment_duration counts in (MP4 mvhd), when the container has one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§