pub trait RenderFrame {
// Required methods
fn canvas_descriptor(
&self,
track: &TrackInfo,
) -> Result<PixelDescriptor, BoxedError>;
fn render(
&mut self,
frame: &Frame,
canvas: &mut PixelSliceMut<'_>,
) -> Result<(), BoxedError>;
}Expand description
Writes a decoded frame onto a packed canvas: the step between a video decoder and the animation API.
Required Methods§
Sourcefn canvas_descriptor(
&self,
track: &TrackInfo,
) -> Result<PixelDescriptor, BoxedError>
fn canvas_descriptor( &self, track: &TrackInfo, ) -> Result<PixelDescriptor, BoxedError>
The canvas descriptor for frames of track.
§Errors
When this renderer cannot produce a canvas for the track.
Sourcefn render(
&mut self,
frame: &Frame,
canvas: &mut PixelSliceMut<'_>,
) -> Result<(), BoxedError>
fn render( &mut self, frame: &Frame, canvas: &mut PixelSliceMut<'_>, ) -> Result<(), BoxedError>
Write frame’s pixels into canvas, which has the track’s coded size
and canvas_descriptor.
§Errors
When the frame cannot be converted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".