pub struct DriftSample {
pub wall_time_secs: f64,
pub observed_frames: u64,
pub expected_frames: u64,
}Expand description
A drift measurement sample: the observed timecode vs expected timecode at a given wall time.
Fields§
§wall_time_secs: f64Wall-clock time in seconds since the measurement started.
observed_frames: u64Observed frame count from the timecode source.
expected_frames: u64Expected frame count from the reference clock.
Implementations§
Source§impl DriftSample
impl DriftSample
Sourcepub fn new(
wall_time_secs: f64,
observed_frames: u64,
expected_frames: u64,
) -> Self
pub fn new( wall_time_secs: f64, observed_frames: u64, expected_frames: u64, ) -> Self
Creates a new drift sample.
Sourcepub fn drift_frames(&self) -> i64
pub fn drift_frames(&self) -> i64
Returns the drift in frames (observed - expected). Positive means ahead.
Sourcepub fn drift_ratio(&self) -> f64
pub fn drift_ratio(&self) -> f64
Returns the drift as a fraction of the expected frames.
Trait Implementations§
Source§impl Clone for DriftSample
impl Clone for DriftSample
Source§fn clone(&self) -> DriftSample
fn clone(&self) -> DriftSample
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DriftSample
impl Debug for DriftSample
Source§impl PartialEq for DriftSample
impl PartialEq for DriftSample
impl Copy for DriftSample
impl StructuralPartialEq for DriftSample
Auto Trait Implementations§
impl Freeze for DriftSample
impl RefUnwindSafe for DriftSample
impl Send for DriftSample
impl Sync for DriftSample
impl Unpin for DriftSample
impl UnsafeUnpin for DriftSample
impl UnwindSafe for DriftSample
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