pub struct Timestamp {
pub time_us: i64,
pub pts: Option<i64>,
pub time_base: Option<(i32, i32)>,
}Expand description
Fields§
§time_us: i64Authoritative time in microseconds.
pts: Option<i64>Raw presentation timestamp, when the event came from a frame pts.
time_base: Option<(i32, i32)>Raw (num, den) time base, when the event came from a frame pts.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn from_secs(s: f64) -> Option<Self>
pub fn from_secs(s: f64) -> Option<Self>
Builds a timestamp from a seconds value (e.g. a lavfi.black_start
string parsed to f64).
Returns None for non-finite input (NaN/±inf); finite values are
rounded to the nearest microsecond rather than truncated.
Sourcepub fn from_pts(pts: i64, time_base: (i32, i32)) -> Self
pub fn from_pts(pts: i64, time_base: (i32, i32)) -> Self
Builds a timestamp from a raw frame pts and time_base, converting to
microseconds with av_rescale_q for full precision. The caller must
ensure pts is valid (not AV_NOPTS_VALUE) and time_base.1 != 0.
Sourcepub fn as_secs_f64(&self) -> f64
pub fn as_secs_f64(&self) -> f64
The timestamp as fractional seconds.
Trait Implementations§
impl Copy for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
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