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();
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(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(BinkDecoder::new())
}