[][src]Struct spectrusty::clock::VFrameTs

pub struct VFrameTs<V> {
    pub ts: VideoTs,
    // some fields omitted
}

A VideoTs timestamp wrapper with a constraint to the V: VideoFrame, implementing methods and traits for timestamp calculations.

Fields

ts: VideoTs

The current value of the timestamp.

Implementations

impl<V> VFrameTs<V> where
    V: VideoFrame
[src]

pub const EOF: VFrameTs<V>[src]

The end-of-frame timestamp, equal to the total number of T-states per frame.

pub fn new(vc: i16, hc: i16) -> VFrameTs<V>[src]

Constructs a new VFrameTs from the given vertical and horizontal counter values.

Note: The returned VFrameTs is not normalized.

pub fn is_normalized(self) -> bool[src]

Returns true if a video timestamp is normalized. Otherwise returns false.

pub fn normalized(self) -> VFrameTs<V>[src]

Normalizes self with a horizontal counter within the allowed range and a scan line counter adjusted accordingly.

Panics

Panics when an attempt to normalize leads to an overflow of the capacity of VideoTs.

pub fn saturating_normalized(self) -> VFrameTs<V>[src]

Returns a video timestamp with a horizontal counter within the allowed range and a scan line counter adjusted accordingly. Saturates at VFrameTs::min_value or VFrameTs::max_value.

pub fn max_value() -> VFrameTs<V>[src]

Returns the largest value that can be represented by a normalized timestamp.

pub fn min_value() -> VFrameTs<V>[src]

Returns the smallest value that can be represented by a normalized timestamp.

pub fn is_eof(self) -> bool[src]

Returns true if the counter value is past or near the end of a frame. Otherwise returns false.

Specifically, the condition is met if the vertical counter is equal to or greater than VideoFrame::VSL_COUNT.

pub fn wrap_frame(&mut self)[src]

Ensures the vertical counter is in the range: (-VSL_COUNT, VSL_COUNT) by calculating a remainder of the division of the vertical counter by VideoFrame::VSL_COUNT.

pub fn saturating_sub_frame(self) -> VFrameTs<V>[src]

Returns a video timestamp after subtracting the total number of frame video scanlines from the scan line counter.

pub fn from_tstates(ts: i32) -> VFrameTs<V>[src]

Returns a normalized timestamp from the given number of T-states.

Panics

Panics when the given ts overflows the capacity of the timestamp.

pub fn try_from_tstates(ts: i32) -> Option<VFrameTs<V>>[src]

On success returns a normalized timestamp from the given number of T-states.

Returns None when the given ts overflows the capacity of the timestamp.

pub fn into_tstates(self) -> i32[src]

Converts the timestamp to FTs.

pub fn into_frame_tstates(self, frames: u64) -> (u64, i32)[src]

Returns a tuple with an adjusted frame counter and with the frame-normalized timestamp as the number of T-states measured from the start of the frame.

The frame starts when the horizontal and vertical counter are both 0.

The returned timestamp value is in the range [0, VideoFrame::FRAME_TSTATES_COUNT).

Methods from Deref<Target = VideoTs>

Trait Implementations

impl<V> Add<i32> for VFrameTs<V> where
    V: VideoFrame
[src]

type Output = VFrameTs<V>

The resulting type after applying the + operator.

pub fn add(self, delta: i32) -> VFrameTs<V>[src]

Returns a normalized video timestamp after adding delta T-states.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

impl<V> Add<u32> for VFrameTs<V> where
    V: VideoFrame
[src]

type Output = VFrameTs<V>

The resulting type after applying the + operator.

pub fn add(self, delta: u32) -> VFrameTs<V>[src]

Returns a normalized video timestamp after adding a delta T-state count.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

impl<V> AddAssign<i32> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> AddAssign<u32> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> Clone for VFrameTs<V>[src]

impl<V> Copy for VFrameTs<V> where
    V: Copy
[src]

impl<V> Debug for VFrameTs<V> where
    V: Debug
[src]

impl<V> Default for VFrameTs<V>[src]

impl<V> Deref for VFrameTs<V>[src]

type Target = VideoTs

The resulting type after dereferencing.

impl<V> DerefMut for VFrameTs<V>[src]

impl<'de, V> Deserialize<'de> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> Eq for VFrameTs<V>[src]

impl<'_, V> From<&'_ VideoTsData1> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<'_, V> From<&'_ VideoTsData2> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<'_, V> From<&'_ VideoTsData3> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<'_, V> From<&'_ VideoTsData6> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> From<VFrameTs<V>> for VideoTs[src]

impl<V, C> From<VFrameTsCounter<V, C>> for VFrameTs<V>[src]

impl<V> From<VideoTs> for VFrameTs<V>[src]

pub fn from(ts: VideoTs) -> VFrameTs<V>[src]

Returns a VFrameTs from the given VideoTs. A returned VFrameTs is not being normalized.

Panics

Panics when the given ts overflows the capacity of VideoTs.

impl<V> From<VideoTsData1> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> From<VideoTsData2> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> From<VideoTsData3> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> From<VideoTsData6> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> Hash for VFrameTs<V>[src]

impl<V> Ord for VFrameTs<V>[src]

impl<V> PartialEq<VFrameTs<V>> for VFrameTs<V>[src]

impl<V> PartialOrd<VFrameTs<V>> for VFrameTs<V>[src]

impl<V> Serialize for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> Sub<i32> for VFrameTs<V> where
    V: VideoFrame
[src]

type Output = VFrameTs<V>

The resulting type after applying the - operator.

pub fn sub(self, delta: i32) -> VFrameTs<V>[src]

Returns a normalized video timestamp after subtracting delta T-states.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

impl<V> Sub<u32> for VFrameTs<V> where
    V: VideoFrame
[src]

type Output = VFrameTs<V>

The resulting type after applying the - operator.

pub fn sub(self, delta: u32) -> VFrameTs<V>[src]

Returns a normalized video timestamp after adding a delta T-state count.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

impl<V> SubAssign<i32> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> SubAssign<u32> for VFrameTs<V> where
    V: VideoFrame
[src]

impl<V> TimestampOps for VFrameTs<V> where
    V: VideoFrame
[src]

pub fn saturating_add(self, other: VFrameTs<V>) -> VFrameTs<V>[src]

Panics

May panic if self or other hasn't been normalized.

pub fn saturating_sub(self, other: VFrameTs<V>) -> VFrameTs<V>[src]

Panics

May panic if self or other hasn't been normalized.

impl<V> TryFrom<i32> for VFrameTs<V> where
    V: VideoFrame
[src]

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<V> RefUnwindSafe for VFrameTs<V> where
    V: RefUnwindSafe
[src]

impl<V> Send for VFrameTs<V> where
    V: Send
[src]

impl<V> Sync for VFrameTs<V> where
    V: Sync
[src]

impl<V> Unpin for VFrameTs<V> where
    V: Unpin
[src]

impl<V> UnwindSafe for VFrameTs<V> where
    V: UnwindSafe
[src]

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> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

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

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

impl<S, T> IntoSample<S> for T where
    S: FromSample<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,