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>
impl<D: Demuxer, C: VideoDecoder, R: RenderFrame> VideoAnimationDecoder<D, C, R>
Sourcepub fn new(
bytes: Arc<[u8]>,
dem: D,
dec: C,
render: R,
final_duration: FrameDuration,
window: usize,
) -> Self
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).
Sourcepub fn frames_decoded(&self) -> u64
pub fn frames_decoded(&self) -> u64
Frames the video decoder produced so far (some may still be queued for duration lookahead).
Trait Implementations§
Source§impl<D, C, R> AnimationFrameDecoder for VideoAnimationDecoder<D, C, R>
impl<D, C, R> AnimationFrameDecoder for VideoAnimationDecoder<D, C, R>
Source§type Error = AdaptError<<D as Demuxer>::Error, <C as VideoDecoder>::Error>
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
fn wrap_sink_error(err: SinkError) -> Self::Error
Source§fn render_next_frame(
&mut self,
pulse: Option<&dyn Pulse>,
) -> Result<Option<AnimationFrame<'_>>, Self::Error>
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>
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>
fn frame_count(&self) -> Option<u32>
Number of frames, if known without decoding.
Source§fn render_next_frame_owned(
&mut self,
pulse: Option<&dyn Pulse>,
) -> Result<Option<OwnedAnimationFrame>, Self::Error>
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>
impl<D, C, R> Send for VideoAnimationDecoder<D, C, R>
impl<D, C, R> Sync for VideoAnimationDecoder<D, C, R>
impl<D, C, R> Unpin for VideoAnimationDecoder<D, C, R>
impl<D, C, R> UnsafeUnpin for VideoAnimationDecoder<D, C, R>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more