pub struct MediaClock {
inner: ClockInner,
}Expand description
Authoritative timeline source. Capture pipelines stamp their
chunks/frames against a single shared MediaClock so audio, video,
cursor, and wisp overlays all agree on “now.”
Two modes — pick at construction:
MediaClock::wall_clock— anchored toInstant::now(). Used by live capture and playback.MediaClock::manual— driven byMediaClock::advance_by. Used by tests, headless examples, and the synthetic sync harness (M-MEDIA.7) so timestamps are byte-exact reproducible.
Fields§
§inner: ClockInnerImplementations§
Source§impl MediaClock
impl MediaClock
Sourcepub fn wall_clock() -> Self
pub fn wall_clock() -> Self
Construct a wall-clock-backed MediaClock, anchored to now.
Subsequent now() calls return MediaTime values relative to
this anchor.
Sourcepub fn manual(start: MediaTime) -> Self
pub fn manual(start: MediaTime) -> Self
Construct a manual clock starting at start. The clock only
advances when Self::advance_by is called — useful for
deterministic tests.
Sourcepub fn advance_by(&self, duration: MediaDuration)
pub fn advance_by(&self, duration: MediaDuration)
Advance a manual clock by duration. No-op on a wall clock.
Sourcepub fn assign<T>(&self, value: T) -> Timestamped<T>
pub fn assign<T>(&self, value: T) -> Timestamped<T>
Attach the current timestamp to value.
Trait Implementations§
Source§impl Debug for MediaClock
impl Debug for MediaClock
Auto Trait Implementations§
impl !Freeze for MediaClock
impl RefUnwindSafe for MediaClock
impl Send for MediaClock
impl Sync for MediaClock
impl Unpin for MediaClock
impl UnsafeUnpin for MediaClock
impl UnwindSafe for MediaClock
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