use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum FrameExportError {
#[error("input has no video stream")]
NoVideoStream,
#[error("video stream index {index} out of bounds: input has {count} stream(s)")]
StreamIndexOutOfBounds {
index: usize,
count: usize,
},
#[error("stream {index} is not a video stream")]
NotAVideoStream {
index: usize,
},
#[error("UniformN needs a resolvable duration; use duration_hint_us() or EverySec instead")]
UnknownDuration,
#[error(
"HDR input (BT.2020 / PQ / HLG) requires tone mapping, which frame export does not do yet"
)]
HdrRequiresToneMapping,
#[error("UniformN({n}) on a video stream that produced no frames")]
EmptyVideoStream {
n: u32,
},
#[error("invalid frame-export option: {0}")]
InvalidOption(String),
#[error("input has no audio stream")]
NoAudioStream,
#[error("audio stream index {index} out of bounds: input has {count} stream(s)")]
AudioStreamIndexOutOfBounds {
index: usize,
count: usize,
},
#[error("stream {index} is not an audio stream")]
NotAnAudioStream {
index: usize,
},
}