use std::mem;
use std::ptr;
use std::f32::consts;
-use std::rc::Rc;
-use std::cell::RefCell;
use nihav_core::formats::*;
use nihav_core::frame::*;
chmap: NAChannelMap,
ainfo: NAAudioInfo,
- info: Rc<NACodecInfo>,
+ info: NACodecInfoRef,
codes: [[Codebook<u8>; 4]; 4],
ch_data: [IMCChannel; 2],
const CHMAP_STEREO: [NAChannelType; 2] = [NAChannelType::L, NAChannelType::R];
impl NADecoder for IMCDecoder {
- fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+ fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
self.chmap = NAChannelMap::new();
match ainfo.get_channels() {
Err(DecoderError::InvalidData)
}
}
- fn decode(&mut self, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
+ fn decode(&mut self, _supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
let info = pkt.get_stream().get_info();
validate!(info.get_properties().is_audio());
let pktbuf = pkt.get_buffer();
let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), abuf);
frm.set_keyframe(true);
- Ok(Rc::new(RefCell::new(frm)))
+ Ok(frm.into_ref())
}
}