aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2019-02-06 10:38:20 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2019-02-06 10:38:20 +0100
commit241e56f135c572e4bd9f33d59826f978be5e9302 (patch)
tree4c9a000ba25cd11c147b1e2d6200a2a7ebd23a31
parent7d109765c123dba7bbb49573e7a1973f1c3d7777 (diff)
downloadnihav-241e56f135c572e4bd9f33d59826f978be5e9302.tar.gz
core: implement defaults for some objects
-rw-r--r--nihav-core/src/codecs/mod.rs12
-rw-r--r--nihav-core/src/frame.rs4
2 files changed, 16 insertions, 0 deletions
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<NAVideoBuffer<u8>>,
@@ -101,6 +105,10 @@ impl IPShuffler {
}
}
+impl Default for IPShuffler {
+ fn default() -> Self { Self { lastframe: None } }
+}
+
#[allow(dead_code)]
pub struct IPBShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
@@ -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() {