Struct mpeg2ts_reader::packet::ClockRef[][src]

pub struct ClockRef { /* fields omitted */ }

A Clock Reference is used to represent the values of PCR and ESCR fields within the transport stream data.

A Clock Reference includes a 33-bit, 90kHz base component, together with another 9-bit, high-resolution extension component.

Together these can be viewed as a 42-bit, 27MHz quantity (e.g. let full_value = pcr as u64). Since the clock reference is limited to 33-bits, at a rate of 90kHz a continuously increasing clock value will wrap-around approximately every 26.5 hours.

Implementations

impl ClockRef[src]

pub fn from_slice(data: &[u8]) -> ClockRef[src]

Panics if data is shorter than 5 bytes

pub fn from_parts(base: u64, extension: u16) -> ClockRef[src]

Panics if the base is greater than 2^33-1 or the extension is greater than 2^9-1

pub fn base(&self) -> u64[src]

get the 33-bit, 90kHz ‘base’ component of the timestamp

pub fn extension(&self) -> u16[src]

get the 9-bit ‘extension’ component of the timestamp, measured in 300ths of the 90kHz base clockrate (i.e. 27MHz)

Trait Implementations

impl Clone for ClockRef[src]

impl Copy for ClockRef[src]

impl Debug for ClockRef[src]

impl PartialEq<ClockRef> for ClockRef[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.