From: Kostya Shishkov Date: Sun, 28 May 2017 09:41:20 +0000 (+0200) Subject: add skip frames and paletted alloc X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=bc6aac3dfdc4b4161f9b7284b058a752bd78c4b4;hp=81b3165fbc84a22e0329116d5345a5805f96a0ed;p=nihav.git add skip frames and paletted alloc --- diff --git a/src/frame.rs b/src/frame.rs index 97b0a50..02bdf33 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -250,7 +250,20 @@ pub fn alloc_video_buffer(vinfo: NAVideoInfo, align: u8) -> Result = Vec::with_capacity(new_size.unwrap()); + data.resize(new_size.unwrap(), 0); + let buf: NAVideoBuffer = NAVideoBuffer { data: Rc::new(RefCell::new(data)), info: vinfo, offs: offs }; + Ok(NABufferType::Video(buf)) + } else if !all_packed { for i in 0..fmt.get_num_comp() { let chr = fmt.get_chromaton(i).unwrap(); if !vinfo.is_flipped() { @@ -412,6 +425,7 @@ pub enum FrameType { I, P, B, + Skip, Other, } @@ -421,6 +435,7 @@ impl fmt::Display for FrameType { FrameType::I => write!(f, "I"), FrameType::P => write!(f, "P"), FrameType::B => write!(f, "B"), + FrameType::Skip => write!(f, "skip"), FrameType::Other => write!(f, "x"), } }