use std::fmt;
use std::ops::{Add, AddAssign, Sub, SubAssign};
-use crate::frame::*;
-use std::rc::Rc;
-use std::cell::RefCell;
+pub use crate::frame::*;
use std::mem;
use crate::io::byteio::ByteIOError;
use crate::io::bitreader::BitReaderError;
fn from(_: AllocatorError) -> Self { DecoderError::AllocError }
}
-macro_rules! validate {
- ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
-}
-
#[allow(dead_code)]
pub struct HAMShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
}
}
+impl Default for HAMShuffler {
+ fn default() -> Self { Self { lastframe: None } }
+}
+
#[allow(dead_code)]
pub struct IPShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
}
}
+impl Default for IPShuffler {
+ fn default() -> Self { Self { lastframe: None } }
+}
+
#[allow(dead_code)]
pub struct IPBShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
}
}
+impl Default for IPBShuffler {
+ fn default() -> Self { Self { lastframe: None, nextframe: None } }
+}
+
#[derive(Debug,Clone,Copy,PartialEq)]
pub struct MV {
pub x: i16,
pub trait NADecoder {
- fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()>;
+ fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()>;
fn decode(&mut self, pkt: &NAPacket) -> DecoderResult<NAFrameRef>;
}
}
None
}
+ pub fn iter(&self) -> std::slice::Iter<DecoderInfo> {
+ self.decs.iter()
+ }
}