Skip to main content

VideoAnimationDecoder

Struct VideoAnimationDecoder 

Source
pub struct VideoAnimationDecoder<D, C, R> { /* private fields */ }
Expand description

A composited-canvas animation view over a demuxed, decoded video: the first video track, in presentation order.

Implementations§

Source§

impl<D: Demuxer, C: VideoDecoder, R: RenderFrame> VideoAnimationDecoder<D, C, R>

Source

pub fn new( bytes: Arc<[u8]>, dem: D, dec: C, render: R, final_duration: FrameDuration, window: usize, ) -> Self

Decode bytes with dem and dec, rendering through render. final_duration is how long the last frame lasts: a video stream has none for its last presentation unless the container records one. window is the slice driver’s read size (bytes per step).

Source

pub fn frames_decoded(&self) -> u64

Frames the video decoder produced so far (some may still be queued for duration lookahead).

Source

pub fn demuxer(&self) -> &D

The demuxer.

Trait Implementations§

Source§

impl<D, C, R> AnimationFrameDecoder for VideoAnimationDecoder<D, C, R>
where D: Demuxer + Send, C: VideoDecoder + Send, R: RenderFrame + Send,

Source§

type Error = AdaptError<<D as Demuxer>::Error, <C as VideoDecoder>::Error>

The codec-specific error type.
Source§

fn wrap_sink_error(err: SinkError) -> Self::Error

Wrap a SinkError into this decoder’s error type. Read more
Source§

fn info(&self) -> &ImageInfo

Image metadata, available after construction.
Source§

fn render_next_frame( &mut self, pulse: Option<&dyn Pulse>, ) -> Result<Option<AnimationFrame<'_>>, Self::Error>

Render the next composited full-canvas frame. Read more
Source§

fn render_next_frame_to_sink( &mut self, pulse: Option<&dyn Pulse>, sink: &mut dyn DecodeRowSink, ) -> Result<Option<OutputInfo>, Self::Error>

Render the next frame directly into a caller-owned sink (push model). Read more
Source§

fn frame_count(&self) -> Option<u32>

Number of frames, if known without decoding.
Source§

fn loop_count(&self) -> Option<u32>

Animation loop count from the container. Read more
Source§

fn render_next_frame_owned( &mut self, pulse: Option<&dyn Pulse>, ) -> Result<Option<OwnedAnimationFrame>, Self::Error>

Render the next frame as an owned copy. Read more

Auto Trait Implementations§

§

impl<D, C, R> !RefUnwindSafe for VideoAnimationDecoder<D, C, R>

§

impl<D, C, R> !UnwindSafe for VideoAnimationDecoder<D, C, R>

§

impl<D, C, R> Freeze for VideoAnimationDecoder<D, C, R>
where D: Freeze, C: Freeze, R: Freeze,

§

impl<D, C, R> Send for VideoAnimationDecoder<D, C, R>
where D: Send, C: Send, R: Send,

§

impl<D, C, R> Sync for VideoAnimationDecoder<D, C, R>
where D: Sync, C: Sync, R: Sync,

§

impl<D, C, R> Unpin for VideoAnimationDecoder<D, C, R>
where D: Unpin, C: Unpin, R: Unpin,

§

impl<D, C, R> UnsafeUnpin for VideoAnimationDecoder<D, C, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.