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

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.

Methods

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]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<ClockRef> for u64[src]

impl Copy for ClockRef[src]

impl PartialEq<ClockRef> for ClockRef[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Debug for ClockRef[src]

Auto Trait Implementations

impl Send for ClockRef

impl Sync for ClockRef

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.