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 const fn hardware_inner(&self) -> Option<&VideoDecoder>
pub const fn hardware_inner(&self) -> Option<&VideoDecoder>
Borrow the inner VideoDecoder when this decoder is still on
the HW path. Returns None after the SW fallback has fired.
Trait Implementations§
Source§impl VideoStreamDecoder for FfmpegVideoStreamDecoder
impl VideoStreamDecoder for FfmpegVideoStreamDecoder
Source§type Buffer = FfmpegBuffer
type Buffer = FfmpegBuffer
Buffer type held by the packets and frames this decoder
produces or accepts.
Source§type Error = VideoDecodeError
type Error = VideoDecodeError
Decoder-specific error type.
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>
Submits one compressed packet.
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>
Drains one decoded frame into
dst. Backends signal “no
frame ready” via a backend-specific Error variant.Auto Trait Implementations§
impl Freeze for FfmpegVideoStreamDecoder
impl !RefUnwindSafe for FfmpegVideoStreamDecoder
impl Send for FfmpegVideoStreamDecoder
impl !Sync for FfmpegVideoStreamDecoder
impl Unpin for FfmpegVideoStreamDecoder
impl UnsafeUnpin for FfmpegVideoStreamDecoder
impl !UnwindSafe for FfmpegVideoStreamDecoder
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