const KB2H_NUM_SLICES: [usize; 4] = [ 2, 3, 4, 8 ];
impl NADecoder for Bink2Decoder {
- 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();
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);
let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), bufinfo);
frm.set_frame_type(if self.key_frame { FrameType::I } else { FrameType::P });
- Ok(Rc::new(RefCell::new(frm)))
+ Ok(frm.into_ref())
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Bink2Decoder::new())
}