1#[derive(thiserror::Error, Debug)]
2pub enum Error {
3 #[error("transfork error: {0}")]
4 Transfork(#[from] moq_transfork::Error),
5
6 #[error("mp4 error: {0}")]
7 Mp4(#[from] mp4_atom::Error),
8
9 #[error("karp error: {0}")]
10 Karp(#[from] crate::Error),
11
12 #[error("missing tracks")]
13 MissingTracks,
14
15 #[error("unknown track")]
16 UnknownTrack,
17
18 #[error("missing box: {0}")]
19 MissingBox(mp4_atom::FourCC),
20
21 #[error("duplicate box: {0}")]
22 DuplicateBox(mp4_atom::FourCC),
23
24 #[error("expected box: {0}")]
25 ExpectedBox(mp4_atom::FourCC),
26
27 #[error("unexpected box: {0}")]
28 UnexpectedBox(mp4_atom::FourCC),
29
30 #[error("unsupported codec: {0}")]
31 UnsupportedCodec(String),
32
33 #[error("missing codec")]
34 MissingCodec,
35
36 #[error("multiple codecs")]
37 MultipleCodecs,
38
39 #[error("invalid size")]
40 InvalidSize,
41
42 #[error("empty init")]
43 EmptyInit,
44
45 #[error("missing init segment")]
46 MissingInit,
47
48 #[error("multiple init segments")]
49 MultipleInit,
50
51 #[error("trailing data")]
52 TrailingData,
53
54 #[error("closed")]
55 Closed,
56
57 #[error("invalid offset")]
58 InvalidOffset,
59
60 #[error("unsupported track: {0}")]
61 UnsupportedTrack(&'static str),
62
63 #[error("io error: {0}")]
64 Io(#[from] std::io::Error),
65}
66
67pub type Result<T> = std::result::Result<T, Error>;