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> { ... }
}Expand description
&self random access to a demuxed file’s samples: see
SampleIndex::sample_source. The methods mirror SampleIndex’s.
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>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".