pub struct MediaTime(_, _);
Expand description
Media time represented by a numerator / denominator.
The numerator is typically the packet time of an Rtp header. The denominator is the clock frequence of the media source (typically 90kHz for video and 48kHz for audio).
Implementations§
source§impl MediaTime
impl MediaTime
pub const ZERO: MediaTime = _
pub const fn new(numer: i64, denom: i64) -> MediaTime
pub fn new_unix_time(time: Instant) -> Self
pub fn new_ntp_time(time: Instant) -> Self
pub const fn numer(&self) -> i64
pub const fn denom(&self) -> i64
pub const fn from_micros(v: i64) -> MediaTime
pub const fn from_millis(v: i64) -> MediaTime
pub fn from_seconds(v: impl Into<f64>) -> MediaTime
pub fn as_seconds(&self) -> f64
pub const fn as_micros(&self) -> i64
pub fn from_ntp_64(v: u64) -> MediaTime
pub fn as_ntp_64(&self) -> u64
pub fn as_ntp_32(&self) -> u32
pub const fn is_zero(&self) -> bool
pub const fn abs(self) -> MediaTime
pub const fn rebase(self, denom: i64) -> MediaTime
Trait Implementations§
source§impl Ord for MediaTime
impl Ord for MediaTime
source§impl PartialOrd<MediaTime> for MediaTime
impl PartialOrd<MediaTime> for MediaTime
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more