Struct FrameTiming
pub struct FrameTiming {
pub kind: MediaKind,
pub pts: Duration,
pub arrived: Option<Instant>,
pub decoded: Instant,
pub presented: Instant,
}Expand description
When one frame arrived, left its decoder, and was presented.
Read with Player::timeline for a timeline view
of playback, Player::video_timing for one
picture, Player::take_latest_video
with the newest picture, or VideoBacklog::take
with every picture. From arrived to decoded is the time in the
decoder, and from decoded to presented the time the playout clock held
the frame. Pictures and audio with the same timestamp should be presented
together.
Fields§
§kind: MediaKindThe medium.
pts: DurationThe frame’s presentation timestamp on the broadcast clock.
This is the frame’s timestamp as a Duration, so timings sort and
subtract. Player::video_timing takes
the frame’s timestamp itself.
arrived: Option<Instant>When the frame’s data was complete on this node, before decoding.
Set for pictures, from the decoder’s
arrival. It is None for
audio, and for a picture the decoder could not match to one access
unit.
decoded: InstantWhen the decoder handed the frame over.
presented: InstantWhen the frame was presented.
A picture is presented when it is handed to the player’s frames. Audio is presented when it reaches the speaker: when it was written plus the audio already queued ahead of it.
Implementations§
§impl FrameTiming
impl FrameTiming
pub fn decode_time(&self) -> Option<Duration>
pub fn decode_time(&self) -> Option<Duration>
Returns how long the frame spent in the decoder, from arrived to decoded.
None when the arrival is not known.
Trait Implementations§
§impl Clone for FrameTiming
impl Clone for FrameTiming
§fn clone(&self) -> FrameTiming
fn clone(&self) -> FrameTiming
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FrameTiming
§impl Debug for FrameTiming
impl Debug for FrameTiming
impl Eq for FrameTiming
§impl PartialEq for FrameTiming
impl PartialEq for FrameTiming
impl StructuralPartialEq for FrameTiming
Auto Trait Implementations§
impl Freeze for FrameTiming
impl RefUnwindSafe for FrameTiming
impl Send for FrameTiming
impl Sync for FrameTiming
impl Unpin for FrameTiming
impl UnsafeUnpin for FrameTiming
impl UnwindSafe for FrameTiming
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.