use thiserror::Error;
#[derive(Debug, Error)]
pub enum MppError {
#[error("librockchip_mpp.so not found — install Rockchip MPP runtime")]
LibraryNotFound,
#[error("MPP symbol `{0}` not found — incompatible MPP version")]
SymbolMissing(&'static str),
#[error("MPP `{op}` failed with status {status}")]
CallFailed { op: &'static str, status: i32 },
#[error("MPP encoder config invalid: {0}")]
InvalidConfig(String),
#[error("MPP encoder not initialised")]
NotInitialised,
#[error("MPP buffer would block — caller should retry")]
WouldBlock,
}
pub type MppResult<T> = Result<T, MppError>;