Skip to main content

SampleSource

Trait SampleSource 

Source
pub trait SampleSource: Send + Sync {
    // Required methods
    fn sample_count(&self, stream: usize) -> u64;
    fn sample_info(&self, stream: usize, index: u64) -> Option<SampleInfo>;
    fn read_sample(&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> { ... }
    fn raw_sample_count(&self, stream: usize) -> u64 { ... }
    fn raw_sample_info(&self, stream: usize, index: u64) -> Option<SampleInfo> { ... }
    fn read_raw_sample(&self, stream: usize, index: u64) -> Result<Packet> { ... }
    fn sample_groups(&self, _stream: usize) -> &[SampleGrouping] { ... }
}
Expand description

&self random access to a demuxed file’s samples: see SampleIndex::sample_source. The methods mirror SampleIndex’s.

Required Methods§

Source

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

Source

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

Source

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

Source

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

Provided Methods§

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn sample_groups(&self, _stream: usize) -> &[SampleGrouping]

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§