1use crate::mp4box::BoxType;
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5 #[error("{0}")]
6 IoError(#[from] std::io::Error),
7
8 #[error("{0}")]
9 InvalidData(&'static str),
10
11 #[error("{0} not found")]
12 BoxNotFound(BoxType),
13
14 #[error("{0} and {1} not found")]
15 Box2NotFound(BoxType, BoxType),
16
17 #[error("trak[{0}].{1} not found")]
18 BoxInTrakNotFound(u32, BoxType),
19
20 #[error("traf[{0}].{1} not found")]
21 BoxInTrafNotFound(u32, BoxType),
22
23 #[error("trak[{0}].stbl.{1} not found")]
24 BoxInStblNotFound(u32, BoxType),
25
26 #[error("trak[{0}].stbl.{1}.entry[{2}] not found")]
27 EntryInStblNotFound(u32, BoxType, u32),
28
29 #[error("traf[{0}].trun.{1}.entry[{2}] not found")]
30 EntryInTrunNotFound(u32, BoxType, u32),
31
32 #[error("{0} version {1} is not supported")]
33 UnsupportedBoxVersion(BoxType, u8),
34
35 #[error("trak[{0}] not found")]
36 TrakNotFound(u32),
37
38 #[error("data buffer with index {0} not found")]
39 DataBufferNotFound(usize),
40
41 #[error("failed read length delimeted nalu data")]
42 NaluLengthDelimetedRedFail,
43
44 #[error("unsupported media type")]
45 UnsupportedMediaType,
46}