projects
/
nihav.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switch NACodecInfo to Arc
[nihav.git]
/
nihav-core
/
src
/
codecs
/
mod.rs
diff --git
a/nihav-core/src/codecs/mod.rs
b/nihav-core/src/codecs/mod.rs
index 4edb2ee8aa97254e845bc96ad9087e7574d114e5..692269ea7572dd1c03a535ff3a441982a486ab60 100644
(file)
--- a/
nihav-core/src/codecs/mod.rs
+++ b/
nihav-core/src/codecs/mod.rs
@@
-1,8
+1,7
@@
use std::fmt;
use std::ops::{Add, AddAssign, Sub, SubAssign};
use std::fmt;
use std::ops::{Add, AddAssign, Sub, SubAssign};
-use crate::frame::*;
-use std::rc::Rc;
+pub use crate::frame::*;
use std::mem;
use crate::io::byteio::ByteIOError;
use crate::io::bitreader::BitReaderError;
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<NAVideoBuffer<u8>>,
#[allow(dead_code)]
pub struct IPShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
@@
-101,6
+104,10
@@
impl IPShuffler {
}
}
}
}
+impl Default for IPShuffler {
+ fn default() -> Self { Self { lastframe: None } }
+}
+
#[allow(dead_code)]
pub struct IPBShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
#[allow(dead_code)]
pub struct IPBShuffler {
lastframe: Option<NAVideoBuffer<u8>>,
@@
-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,
#[derive(Debug,Clone,Copy,PartialEq)]
pub struct MV {
pub x: i16,
@@
-220,7
+231,7
@@
impl fmt::Display for MV {
pub trait NADecoder {
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>;
}
fn decode(&mut self, pkt: &NAPacket) -> DecoderResult<NAFrameRef>;
}
@@
-255,4
+266,7
@@
impl RegisteredDecoders {
}
None
}
}
None
}
+ pub fn iter(&self) -> std::slice::Iter<DecoderInfo> {
+ self.decs.iter()
+ }
}
}