pub enum Error {
Ffmpeg(Error),
NoCodec(u32),
BackendUnsupportedByCodec(Backend),
HwDeviceInitFailed(HwDeviceInitFailed),
AllBackendsFailed(AllBackendsFailed),
FallbackFailed(FallbackFailed),
}Expand description
Errors returned from crate::VideoDecoder.
Debug is derived; the variants that wrap a payload struct
(HwDeviceInitFailed, AllBackendsFailed, FallbackFailed)
delegate their Debug to the payload, which is hand-written
where needed because ffmpeg_next::Packet (carried by
AllBackendsFailed::unconsumed_packets /
FallbackFailed::unconsumed_packets) does not derive
Debug. Those payloads summarize the packet count rather
than dumping each packet’s fields, which would be both noisy
and useless for triage.
Variants§
Ffmpeg(Error)
An underlying FFmpeg error.
NoCodec(u32)
avcodec_find_decoder returned null for the input codec id. The id
is reported as the raw integer (AVCodecID discriminant) — we do not
construct the bindgen AVCodecID enum from a runtime value, since
values outside our build’s discriminant set would invoke UB.
BackendUnsupportedByCodec(Backend)
The codec does not advertise a hardware configuration matching the
requested backend (via avcodec_get_hw_config).
HwDeviceInitFailed(HwDeviceInitFailed)
av_hwdevice_ctx_create failed for the requested backend. See
[HwDeviceInitFailed] for the payload details. #[from] gives
a free impl From<HwDeviceInitFailed> for Error, so inner
helpers that return Result<_, HwDeviceInitFailed> can be
?-propagated into Error directly.
AllBackendsFailed(AllBackendsFailed)
Auto-probe exhausted every backend in the platform’s order. See
[AllBackendsFailed] for the payload details (in particular the
unconsumed_packets history that callers should replay through
their own software decoder for non-seekable inputs). #[from]
gives a free impl From<AllBackendsFailed> for Error.
FallbackFailed(FallbackFailed)
Surfaced by crate::FfmpegVideoStreamDecoder when a HW->SW
fallback attempt itself fails. See [FallbackFailed] for the
payload details (in particular the rescued unconsumed_packets
the HW path had already consumed from the caller). #[from]
gives a free impl From<FallbackFailed> for Error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()