1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum MppError {
6 #[error("librockchip_mpp.so not found — install Rockchip MPP runtime")]
8 LibraryNotFound,
9
10 #[error("MPP symbol `{0}` not found — incompatible MPP version")]
12 SymbolMissing(&'static str),
13
14 #[error("MPP `{op}` failed with status {status}")]
16 CallFailed { op: &'static str, status: i32 },
17
18 #[error("MPP encoder config invalid: {0}")]
20 InvalidConfig(String),
21
22 #[error("MPP encoder not initialised")]
24 NotInitialised,
25
26 #[error("MPP buffer would block — caller should retry")]
28 WouldBlock,
29}
30
31pub type MppResult<T> = Result<T, MppError>;