Skip to main content

empty_video_frame

Function empty_video_frame 

Source
pub fn empty_video_frame() -> VideoFrame<PixelFormat, VideoFrameExtra, FfmpegBuffer>
Expand description

Constructs an empty mediadecode::frame::VideoFrame suitable as the destination argument to mediadecode::decoder::VideoStreamDecoder::receive_frame. The decoder overwrites the frame on success; this just provides a well-formed slot.

All four plane slots get a 1-byte FfmpegBuffer placeholder (the array shape requires a buffer in every slot, but plane_count = 0 reports them as inactive).

§Panics

Panics on FFmpeg-side OOM (the per-plane 1-byte allocation failed). Callers who need to recover from OOM should use try_empty_video_frame.