pub struct Timeline { /* private fields */ }Expand description
A constant-frame-rate video timeline aligned to an audio sample clock.
Implementations§
Source§impl Timeline
impl Timeline
pub fn new(frame_rate: FrameRate, audio_sample_rate: u32) -> Result<Self>
pub const fn frame_rate(self) -> FrameRate
pub const fn audio_sample_rate(self) -> u32
Sourcepub fn audio_interval_for_frame(self, frame: FrameIndex) -> Result<SampleRange>
pub fn audio_interval_for_frame(self, frame: FrameIndex) -> Result<SampleRange>
Returns the exact half-open audio interval covered by a video frame.
Boundaries use floor rounding. Applying the same rule to both sides guarantees that adjacent frame requests neither duplicate nor lose a sample, including fractional rates such as 30000/1001.
Sourcepub fn frame_for_audio_sample(self, sample: u64) -> Result<FrameIndex>
pub fn frame_for_audio_sample(self, sample: u64) -> Result<FrameIndex>
Returns the presentation frame containing an audio sample boundary.
This is the inverse of Self::audio_interval_for_frame using floor
rounding, so playback driven by an audio clock never selects a future
frame.
Trait Implementations§
impl Copy for Timeline
impl Eq for Timeline
impl StructuralPartialEq for Timeline
Auto Trait Implementations§
impl Freeze for Timeline
impl RefUnwindSafe for Timeline
impl Send for Timeline
impl Sync for Timeline
impl Unpin for Timeline
impl UnsafeUnpin for Timeline
impl UnwindSafe for Timeline
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