introduce NADecoderSupport and buffer pools
[nihav.git] / nihav-indeo / src / codecs / indeo2.rs
index 5ea8b3f5ad5666e53333c9f104890e835f34d0dc..c7037180145c0ecd6bfbf76ebc2d82892c9c8c90 100644 (file)
@@ -307,7 +307,7 @@ impl Indeo2Decoder {
 const IR2_START: usize = 48;
 
 impl NADecoder for Indeo2Decoder {
-    fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
+    fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
             let w = vinfo.get_width();
             let h = vinfo.get_height();
@@ -321,7 +321,7 @@ impl NADecoder for Indeo2Decoder {
             Err(DecoderError::InvalidData)
         }
     }
-    fn decode(&mut self, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
+    fn decode(&mut self, _supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
         let src = pkt.get_buffer();
         if src.len() <= IR2_START { return Err(DecoderError::ShortData); }
         let interframe = src[18];
@@ -343,7 +343,7 @@ impl NADecoder for Indeo2Decoder {
             let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), bufinfo);
             frm.set_keyframe(true);
             frm.set_frame_type(FrameType::I);
-            Ok(Rc::new(RefCell::new(frm)))
+            Ok(frm.into_ref())
         } else {
             let bufret = self.frmmgr.clone_ref();
             if let None = bufret { return Err(DecoderError::MissingReference); }
@@ -356,7 +356,7 @@ impl NADecoder for Indeo2Decoder {
             let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), NABufferType::Video(buf));
             frm.set_keyframe(false);
             frm.set_frame_type(FrameType::P);
-            Ok(Rc::new(RefCell::new(frm)))
+            Ok(frm.into_ref())
         }
     }
 }