pub struct Timestamp { /* private fields */ }Expand description
A 33-bit Elementary Stream timestamp, used to represent PTS and DTS values which may appear in an Elementary Stream header.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const MAX: Timestamp
pub const MAX: Timestamp
The largest representable timestamp value before the timestamp wraps back around to zero.
Sourcepub fn from_pts_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>
pub fn from_pts_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>
Parse a Presentation Time Stamp value from the 5 bytes at the start of the given slice
Panics if fewer than 5 bytes given
Sourcepub fn from_dts_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>
pub fn from_dts_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>
Parse a Decode Time Stamp value from the 5 bytes at the start of the given slice
Panics if fewer than 5 bytes given
Sourcepub fn from_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>
pub fn from_bytes(buf: &[u8]) -> Result<Timestamp, TimestampError>
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
Sourcepub fn likely_wrapped_since(self, since: Self) -> bool
pub fn likely_wrapped_since(self, since: Self) -> bool
returns true if timestamps are likely to have wrapped around since other, given a current
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).