Skip to main content

Crate use_media_timestamp

Crate use_media_timestamp 

Source
Expand description

Primitive media timestamp helpers.

These helpers keep timestamps explicit and frame conversion deterministic.

§Examples

use use_media_timestamp::{MediaTimestamp, clamp_timestamp, timestamp_from_frame};

let timestamp = timestamp_from_frame(60, 30.0).unwrap();

assert_eq!(timestamp, MediaTimestamp::new(2.0).unwrap());
assert_eq!(timestamp.frame_index(30.0).unwrap(), 60);
assert_eq!(clamp_timestamp(12.0, 10.0).unwrap(), 10.0);

Structs§

MediaTimestamp

Enums§

MediaTimestampError

Functions§

clamp_timestamp
format_timestamp
frame_index_at_time
timestamp_from_frame