From: Kostya Shishkov Date: Wed, 6 Feb 2019 09:38:20 +0000 (+0100) Subject: core: implement defaults for some objects X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=241e56f135c572e4bd9f33d59826f978be5e9302;p=nihav.git core: implement defaults for some objects --- diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 1d12883..2999cb6 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -77,6 +77,10 @@ impl HAMShuffler { } } +impl Default for HAMShuffler { + fn default() -> Self { Self { lastframe: None } } +} + #[allow(dead_code)] pub struct IPShuffler { lastframe: Option>, @@ -101,6 +105,10 @@ impl IPShuffler { } } +impl Default for IPShuffler { + fn default() -> Self { Self { lastframe: None } } +} + #[allow(dead_code)] pub struct IPBShuffler { lastframe: Option>, @@ -151,6 +159,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, diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 9756dfb..cd25ca2 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -430,6 +430,10 @@ impl NACodecInfo { } } +impl Default for NACodecInfo { + fn default() -> Self { DUMMY_CODEC_INFO } +} + impl fmt::Display for NACodecInfo { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let edata = match self.extradata.clone() {