allow errors, import new modules
This commit is contained in:
parent
101afc4406
commit
3aa8cba150
2 changed files with 27 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
mod input;
|
||||||
|
mod flv;
|
||||||
|
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
// Data structs/enums
|
||||||
|
|
||||||
pub struct VideoMetadata {
|
pub struct VideoMetadata {
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
|
@ -51,3 +53,25 @@ pub struct RawMedia {
|
||||||
pub media_type: RawMediaType,
|
pub media_type: RawMediaType,
|
||||||
pub sample: Vec<u8>,
|
pub sample: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue