diff --git a/src/demux/mod.rs b/src/demux/mod.rs index 5fbb4aa..f84670e 100644 --- a/src/demux/mod.rs +++ b/src/demux/mod.rs @@ -1,3 +1,6 @@ +mod input; +mod flv; + use std::sync::mpsc; use std::error::Error; diff --git a/src/util/mod.rs b/src/util/mod.rs index 9a8d351..c48f2ce 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1,6 +1,8 @@ use std::error::Error; use std::fmt; +// Data structs/enums + pub struct VideoMetadata { pub width: u32, pub height: u32, @@ -51,3 +53,25 @@ pub struct RawMedia { pub media_type: RawMediaType, pub sample: Vec, } + +// Errors + +pub enum GenericError { + UnknownSyncByte +} + +impl Error for GenericError {} + +impl fmt::Debug for GenericError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + GenericError::UnknownSyncByte => write!(f, "sync byte does not match any implemented input format"), + } + } +} + +impl fmt::Display for GenericError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(self, f) + } +}