}
struct BMV3VideoDecoder {
- info: Rc<NACodecInfo>,
+ info: NACodecInfoRef,
stride: usize,
height: usize,
frame: Vec<u16>,
impl BMV3VideoDecoder {
fn new() -> Self {
- let dummy_info = Rc::new(DUMMY_CODEC_INFO);
let mut frame1 = Vec::with_capacity(BMV_MAX_SIZE);
frame1.resize(BMV_MAX_SIZE, 0);
let mut frame2 = Vec::with_capacity(BMV_MAX_SIZE);
}
Self {
- info: dummy_info,
+ info: NACodecInfoRef::default(),
stride: 0,
height: 0,
frame: frame1,
}
impl NADecoder for BMV3VideoDecoder {
- fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+ fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, RGB565_FORMAT));
- self.info = Rc::new(NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()));
+ self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref();
self.stride = vinfo.get_width();
self.height = vinfo.get_height();
}
impl NADecoder for BMV3AudioDecoder {
- fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+ fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
self.ainfo = NAAudioInfo::new(ainfo.get_sample_rate(), ainfo.get_channels(), formats::SND_S16P_FORMAT, 32);
self.chmap = NAChannelMap::from_str("L,R").unwrap();