1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-06-02 21:49:24 +00:00
mp4-rust/src/error.rs
Alfred Gutierrez 6ec013b7b9
Fragmented tracks (#31)
* Add trun box.

* Adding Movie Extends Box and subboxes (mvex, mehd, trex).

* Adding more support for parsing fragmented tracks. Add mp4sample example.

* cleanup

* Set default_sample_duration from moov.mvex.trex for getting fragmented samples.

* fix trex box parsing/writing.
2020-09-14 18:05:34 -07:00

28 lines
828 B
Rust

use thiserror::Error;
use crate::mp4box::BoxType;
#[derive(Error, Debug)]
pub enum Error {
#[error("{0}")]
IoError(#[from] std::io::Error),
#[error("{0}")]
InvalidData(&'static str),
#[error("{0} not found")]
BoxNotFound(BoxType),
#[error("{0} and {1} not found")]
Box2NotFound(BoxType, BoxType),
#[error("trak[{0}] not found")]
TrakNotFound(u32),
#[error("trak[{0}].{1} not found")]
BoxInTrakNotFound(u32, BoxType),
#[error("traf[{0}].{1} not found")]
BoxInTrafNotFound(u32, BoxType),
#[error("trak[{0}].stbl.{1} not found")]
BoxInStblNotFound(u32, BoxType),
#[error("trak[{0}].stbl.{1}.entry[{2}] not found")]
EntryInStblNotFound(u32, BoxType, u32),
#[error("traf[{0}].trun.{1}.entry[{2}] not found")]
EntryInTrunNotFound(u32, BoxType, u32),
}