use-media-timestamp 0.0.1

Primitive media timestamp helpers
Documentation
  • Coverage
  • 7.14%
    1 out of 14 items documented1 out of 11 items with examples
  • Size
  • Source code size: 6.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 394.57 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-media
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

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);