[][src]Struct ac_ffmpeg::time::Timestamp

pub struct Timestamp { /* fields omitted */ }

A timestamp supporting various time bases. All comparisons are done within microsecond time base.

Implementations

impl Timestamp[src]

pub fn null() -> Self[src]

Create a "null" timestamp (i.e. a timestamp set to the AV_NOPTS_VALUE).

pub const fn new(timestamp: i64, time_base: TimeBase) -> Self[src]

Create a new timestamp with a given time base.

pub const fn from_secs(timestamp: i64) -> Self[src]

Create a new timestamp with 1/1 time base.

pub const fn from_millis(timestamp: i64) -> Self[src]

Create a new timestamp with 1/1_000 time base.

pub const fn from_micros(timestamp: i64) -> Self[src]

Create a new timestamp with 1/1_000_000 time base.

pub const fn from_nanos(timestamp: i64) -> Self[src]

Create a new timestamp with 1/1_000_000_000 time base.

pub fn time_base(&self) -> TimeBase[src]

Get the time base.

pub fn timestamp(&self) -> i64[src]

Get the raw timestamp value.

pub fn is_null(&self) -> bool[src]

Check if this is the "null" timestamp (i.e. it is equal to the AV_NOPTS_VALUE).

pub fn with_time_base(&self, time_base: TimeBase) -> Self[src]

Rescale the timestamp value to a given time base.

pub fn as_secs(&self) -> Option<i64>[src]

Get the timestamp value in seconds.

pub fn as_millis(&self) -> Option<i64>[src]

Get the timestamp value in milliseconds.

pub fn as_micros(&self) -> Option<i64>[src]

Get the timestamp value in microseconds.

pub fn as_nanos(&self) -> Option<i64>[src]

Get the timestamp value in nanoseconds.

pub fn as_f32(&self) -> Option<f32>[src]

Get the timestamp value as a floating point number with 32-bit precision.

pub fn as_f64(&self) -> Option<f64>[src]

Get the timestamp value as a floating point number with 64-bit precision.

Trait Implementations

impl Add<Duration> for Timestamp[src]

type Output = Timestamp

The resulting type after applying the + operator.

impl AddAssign<Duration> for Timestamp[src]

impl Clone for Timestamp[src]

impl Copy for Timestamp[src]

impl Debug for Timestamp[src]

impl Eq for Timestamp[src]

impl PartialEq<Timestamp> for Timestamp[src]

impl PartialOrd<Timestamp> for Timestamp[src]

impl Sub<Duration> for Timestamp[src]

type Output = Timestamp

The resulting type after applying the - operator.

impl Sub<Timestamp> for Timestamp[src]

type Output = Duration

The resulting type after applying the - operator.

impl SubAssign<Duration> for Timestamp[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.