Struct mpeg2ts_reader::pes::Timestamp[][src]

pub struct Timestamp { /* fields omitted */ }

A 33-bit Elementary Stream timestamp, used to represent PTS and DTS values which may appear in an Elementary Stream header.

Implementations

impl Timestamp[src]

pub const MAX: Timestamp[src]

The largest representable timestamp value before the timestamp wraps back around to zero.

pub const TIMEBASE: u64[src]

90kHz timebase in which PTS and DTS values are measured.

pub fn from_pts_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>[src]

Parse a Presentation Time Stamp value from the 5 bytes at the start of the given slice

Panics if fewer than 5 bytes given

pub fn from_dts_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>[src]

Parse a Decode Time Stamp value from the 5 bytes at the start of the given slice

Panics if fewer than 5 bytes given

pub fn from_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>[src]

Parse a Time Stamp value from the 5 bytes at the start of the given slice, without checking the 4-bit prefix for any particular value (the from_pts_bytes() and from_dts_bytes() methods, in contrast, do check that the expected prefix bits are present).

Panics if fewer than 5 bytes given

pub fn from_u64(val: u64) -> Timestamp[src]

Panics if the given val is greater than 2^33-1

pub fn value(self) -> u64[src]

produces the timestamp’s value (only the low 33 bits are used)

pub fn likely_wrapped_since(self, other: Self) -> bool[src]

returns true if timestamps are likely to have wrapped around since other, given a curent timestamp of self, and given the two timestamp values were taken no more than about 13.3 hours apart (i.e. no more than half the 26.5-ish hours it takes for the wrap around to occur).

Trait Implementations

impl Clone for Timestamp[src]

impl Copy for Timestamp[src]

impl Debug for Timestamp[src]

impl PartialEq<Timestamp> for Timestamp[src]

impl StructuralPartialEq 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.