introduce NADecoderSupport and buffer pools
[nihav.git] / nihav-rad / src / codecs / binkvid.rs
index 2f95ed6b58c1add29a8d1f437e1043663c06e56e..e091b72f92ccee55170700179debee6614ac9591 100644 (file)
@@ -1157,7 +1157,7 @@ const BINK_FLAG_ALPHA:  u32 = 0x00100000;
 const BINK_FLAG_GRAY:   u32 = 0x00020000;
 
 impl NADecoder for BinkDecoder {
-    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();
@@ -1206,7 +1206,7 @@ impl NADecoder for BinkDecoder {
             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();
 
         let mut br = BitReader::new(&src, src.len(), BitReaderMode::LE);
@@ -1260,7 +1260,7 @@ println!("decode frame {} b={} i={}", pkt.get_pts().unwrap(), self.is_ver_b, sel
 
         let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), bufinfo);
         frm.set_frame_type(FrameType::P);
-        Ok(Rc::new(RefCell::new(frm)))
+        Ok(frm.into_ref())
     }
 }