2020-07-28 16:36:17 +00:00
|
|
|
use thiserror::Error;
|
|
|
|
|
2020-08-04 23:56:59 +00:00
|
|
|
use crate::mp4box::BoxType;
|
2020-07-31 17:12:26 +00:00
|
|
|
|
2020-07-28 16:36:17 +00:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum Error {
|
|
|
|
#[error("{0}")]
|
|
|
|
IoError(#[from] std::io::Error),
|
|
|
|
#[error("{0}")]
|
|
|
|
InvalidData(&'static str),
|
2020-07-31 17:12:26 +00:00
|
|
|
#[error("{0} not found")]
|
|
|
|
BoxNotFound(BoxType),
|
2020-08-04 23:56:59 +00:00
|
|
|
#[error("{0} and {1} not found")]
|
|
|
|
Box2NotFound(BoxType, BoxType),
|
2020-07-31 17:12:26 +00:00
|
|
|
#[error("trak[{0}] not found")]
|
|
|
|
TrakNotFound(u32),
|
|
|
|
#[error("trak[{0}].{1} not found")]
|
|
|
|
BoxInTrakNotFound(u32, BoxType),
|
2020-09-15 01:05:34 +00:00
|
|
|
#[error("traf[{0}].{1} not found")]
|
|
|
|
BoxInTrafNotFound(u32, BoxType),
|
2020-07-31 17:12:26 +00:00
|
|
|
#[error("trak[{0}].stbl.{1} not found")]
|
|
|
|
BoxInStblNotFound(u32, BoxType),
|
|
|
|
#[error("trak[{0}].stbl.{1}.entry[{2}] not found")]
|
|
|
|
EntryInStblNotFound(u32, BoxType, u32),
|
2020-09-15 01:05:34 +00:00
|
|
|
#[error("traf[{0}].trun.{1}.entry[{2}] not found")]
|
|
|
|
EntryInTrunNotFound(u32, BoxType, u32),
|
2022-07-21 02:05:38 +00:00
|
|
|
#[error("{0} version {1} is not supported")]
|
|
|
|
UnsupportedBoxVersion(BoxType, u8),
|
2020-07-28 16:36:17 +00:00
|
|
|
}
|