pub struct FfmpegVideoStreamDecoder { /* private fields */ }Expand description
mediadecode::VideoStreamDecoder impl with transparent HW → SW
fallback.
Implementations§
Source§impl FfmpegVideoStreamDecoder
impl FfmpegVideoStreamDecoder
Sourcepub fn open(parameters: Parameters, time_base: Timebase) -> Result<Self, Error>
pub fn open(parameters: Parameters, time_base: Timebase) -> Result<Self, Error>
Opens a decoder for the given codec parameters with the default
HW backend probe order. If the HW probe can’t open any backend,
falls back to a software ffmpeg::decoder::Video immediately —
open only returns Err when both paths fail.
Subsequent mid-stream AllBackendsFailed from the HW path
triggers the same SW fallback (with rescued packets replayed).
Sourcepub const fn is_software(&self) -> bool
pub const fn is_software(&self) -> bool
Returns true when this decoder has fallen back to the software
path. false while still on the HW probe (the initial state).
Sourcepub const fn is_hardware(&self) -> bool
pub const fn is_hardware(&self) -> bool
Returns true while the HW probe is still active.
Sourcepub fn hardware_inner(&self) -> Option<&VideoDecoder>
pub fn hardware_inner(&self) -> Option<&VideoDecoder>
Borrow the inner VideoDecoder when this decoder is still on the
real HW path. Returns None after the SW fallback has fired (or, in
tests, when the HW seam is a fake rather than a real decoder).
Trait Implementations§
Source§impl VideoStreamDecoder for FfmpegVideoStreamDecoder
impl VideoStreamDecoder for FfmpegVideoStreamDecoder
Source§type Buffer = FfmpegBuffer
type Buffer = FfmpegBuffer
Source§type Error = VideoDecodeError
type Error = VideoDecodeError
Source§fn send_packet(
&mut self,
packet: &VideoPacket<VideoPacketExtra, Self::Buffer>,
) -> Result<(), Self::Error>
fn send_packet( &mut self, packet: &VideoPacket<VideoPacketExtra, Self::Buffer>, ) -> Result<(), Self::Error>
Source§fn receive_frame(
&mut self,
dst: &mut VideoFrame<PixelFormat, VideoFrameExtra, Self::Buffer>,
) -> Result<(), Self::Error>
fn receive_frame( &mut self, dst: &mut VideoFrame<PixelFormat, VideoFrameExtra, Self::Buffer>, ) -> Result<(), Self::Error>
dst. Backends signal “no
frame ready” via a backend-specific Error variant.