#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("ffmpeg: {0}")]
Ffmpeg(String),
#[error("no usable H.264 encoder found (tried: {0})")]
NoEncoder(String),
#[error("capture backend {0:?} not available in this ffmpeg build")]
NoCaptureBackend(&'static str),
#[error("no video stream on capture device {0:?}")]
NoVideoStream(String),
#[error("invalid framerate: {0} (must be non-zero)")]
InvalidFramerate(u32),
#[error(transparent)]
Codec(#[from] anyhow::Error),
#[error(transparent)]
Moq(#[from] moq_net::Error),
#[error(transparent)]
TimeOverflow(#[from] moq_net::TimeOverflow),
}
impl From<ffmpeg_next::Error> for Error {
fn from(err: ffmpeg_next::Error) -> Self {
Self::Ffmpeg(err.to_string())
}
}