pub struct DriftDetector { /* private fields */ }Expand description
Timecode drift detector and corrector.
Implementations§
Source§impl DriftDetector
impl DriftDetector
Sourcepub fn new(config: DriftConfig) -> Self
pub fn new(config: DriftConfig) -> Self
Creates a new drift detector with the given configuration.
Sourcepub fn add_sample(&mut self, sample: DriftSample)
pub fn add_sample(&mut self, sample: DriftSample)
Adds a drift sample.
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Returns the number of collected samples.
Sourcepub fn clear_samples(&mut self)
pub fn clear_samples(&mut self)
Clears all collected samples.
Sourcepub fn latest_drift(&self) -> Option<i64>
pub fn latest_drift(&self) -> Option<i64>
Returns the latest drift in frames, or None if no samples.
Sourcepub fn analyze(&self) -> Option<DriftAnalysis>
pub fn analyze(&self) -> Option<DriftAnalysis>
Analyzes collected drift data and returns a summary.
Sourcepub fn correct_timecode(
&self,
observed: &Timecode,
correction_frames: i64,
) -> Result<Timecode, TimecodeError>
pub fn correct_timecode( &self, observed: &Timecode, correction_frames: i64, ) -> Result<Timecode, TimecodeError>
Computes a corrected timecode by applying a frame offset to an observed timecode.
Sourcepub fn frame_rate(&self) -> FrameRate
pub fn frame_rate(&self) -> FrameRate
Returns the frame rate from the configuration.
Trait Implementations§
Source§impl Clone for DriftDetector
impl Clone for DriftDetector
Source§fn clone(&self) -> DriftDetector
fn clone(&self) -> DriftDetector
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 moreAuto Trait Implementations§
impl Freeze for DriftDetector
impl RefUnwindSafe for DriftDetector
impl Send for DriftDetector
impl Sync for DriftDetector
impl Unpin for DriftDetector
impl UnsafeUnpin for DriftDetector
impl UnwindSafe for DriftDetector
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