introduce NADecoderSupport and buffer pools
[nihav.git] / nihav-realmedia / src / codecs / rv30.rs
index a2d7090cc19098ddefdc98b92b4c0b5d6510035a..95e619090861b5392e7c042b39438e99d47b1d31 100644 (file)
@@ -117,7 +117,7 @@ impl RealVideo30Decoder {
 }
 
 impl NADecoder for RealVideo30Decoder {
-    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 fmt = formats::YUV420_FORMAT;
             let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, false, fmt));
@@ -144,7 +144,7 @@ println!("???");
             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 (bufinfo, ftype, pts) = self.dec.parse_frame(src.as_slice(), &mut self.bd)?;
@@ -153,7 +153,7 @@ println!("???");
         frm.set_keyframe(ftype == FrameType::I);
         frm.set_pts(Some(pts));
         frm.set_frame_type(ftype);//if ftype == FrameType::B { FrameType::Skip } else { ftype } );
-        Ok(Rc::new(RefCell::new(frm)))
+        Ok(frm.into_ref())
     }
 }