use thiserror::Error;
#[derive(Debug, Clone, Error)]
pub enum DecoderError {
#[error("end of video file reached")]
EndOfFile,
#[error("failed to open input file ({cause})")]
FileReadError {
cause: String,
},
#[cfg(feature = "vapoursynth")]
#[error("Vapoursynth script error ({cause})")]
VapoursynthScriptError {
cause: String,
},
#[cfg(feature = "vapoursynth")]
#[error("Vapoursynth internal error ({cause})")]
VapoursynthInternalError {
cause: String,
},
#[cfg(feature = "vapoursynth")]
#[error("error setting Vapoursynth script args ({cause})")]
VapoursynthArgsError {
cause: String,
},
#[cfg(feature = "ffmpeg")]
#[error("FFMpeg internal error ({cause})")]
FfmpegInternalError {
cause: String,
},
#[cfg(feature = "ffms2")]
#[error("FFMS2 internal error ({cause})")]
Ffms2InternalError {
cause: String,
},
#[error("internal decoder error ({cause})")]
GenericDecodeError {
cause: String,
},
#[error("no decodeable video stream found in file")]
NoVideoStream,
#[error("no decoder found which can decode this file--perhaps you need to enable the ffmpeg or vapoursynth feature")]
NoDecoder,
#[error("this function is not supported by the decoder in use")]
UnsupportedDecoder,
#[error("variable format clips are not currently supported")]
VariableFormat,
#[error("variable resolution clips are not currently supported")]
VariableResolution,
#[error("variable framerate clips are not currently supported")]
VariableFramerate,
#[error("unsupported chroma subsampling ({x}, {y})")]
UnsupportedChromaSubsampling {
x: usize,
y: usize,
},
#[error("unsupported video format {fmt}")]
UnsupportedFormat {
fmt: String,
},
}