X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fcodecs%2Fmod.rs;h=692269ea7572dd1c03a535ff3a441982a486ab60;hb=2422d9699cd56cbb86ac32b3e8dd026e20a89db5;hp=1d128833234b5c944d7bd7de7cd7cd911d0e9590;hpb=4e8b4f31bc2ef2b22b4c725aa07dfc776664a97b;p=nihav.git diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 1d12883..692269e 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -2,7 +2,6 @@ use std::fmt; use std::ops::{Add, AddAssign, Sub, SubAssign}; pub use crate::frame::*; -pub use std::rc::Rc; use std::mem; use crate::io::byteio::ByteIOError; use crate::io::bitreader::BitReaderError; @@ -77,6 +76,10 @@ impl HAMShuffler { } } +impl Default for HAMShuffler { + fn default() -> Self { Self { lastframe: None } } +} + #[allow(dead_code)] pub struct IPShuffler { lastframe: Option>, @@ -101,6 +104,10 @@ impl IPShuffler { } } +impl Default for IPShuffler { + fn default() -> Self { Self { lastframe: None } } +} + #[allow(dead_code)] pub struct IPBShuffler { lastframe: Option>, @@ -151,6 +158,10 @@ impl IPBShuffler { } } +impl Default for IPBShuffler { + fn default() -> Self { Self { lastframe: None, nextframe: None } } +} + #[derive(Debug,Clone,Copy,PartialEq)] pub struct MV { pub x: i16, @@ -220,7 +231,7 @@ impl fmt::Display for MV { pub trait NADecoder { - fn init(&mut self, info: Rc) -> DecoderResult<()>; + fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()>; fn decode(&mut self, pkt: &NAPacket) -> DecoderResult; } @@ -255,4 +266,7 @@ impl RegisteredDecoders { } None } + pub fn iter(&self) -> std::slice::Iter { + self.decs.iter() + } }