X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-core%2Fsrc%2Fcodecs%2Fmod.rs;h=4f81d9eb8a2ffe61c6a8f2b09e65d6cf3b2a359f;hp=692269ea7572dd1c03a535ff3a441982a486ab60;hb=3fc28ece6664a34af9b7f6a52dbf8a8809fa9204;hpb=cbc3c7a23f8d41c9cb395252a6b795817b5aec96 diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 692269e..4f81d9e 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -45,7 +45,7 @@ impl From for DecoderError { #[allow(dead_code)] pub struct HAMShuffler { - lastframe: Option>, + lastframe: Option>, } impl HAMShuffler { @@ -54,21 +54,21 @@ impl HAMShuffler { #[allow(dead_code)] pub fn clear(&mut self) { self.lastframe = None; } #[allow(dead_code)] - pub fn add_frame(&mut self, buf: NAVideoBuffer) { + pub fn add_frame(&mut self, buf: NAVideoBufferRef) { self.lastframe = Some(buf); } #[allow(dead_code)] - pub fn clone_ref(&mut self) -> Option> { + pub fn clone_ref(&mut self) -> Option> { if let Some(ref mut frm) = self.lastframe { let newfrm = frm.copy_buffer(); - *frm = newfrm.clone(); - Some(newfrm) + *frm = newfrm.clone().into_ref(); + Some(newfrm.into_ref()) } else { None } } #[allow(dead_code)] - pub fn get_output_frame(&mut self) -> Option> { + pub fn get_output_frame(&mut self) -> Option> { match self.lastframe { Some(ref frm) => Some(frm.clone()), None => None, @@ -82,7 +82,7 @@ impl Default for HAMShuffler { #[allow(dead_code)] pub struct IPShuffler { - lastframe: Option>, + lastframe: Option>, } impl IPShuffler { @@ -91,11 +91,11 @@ impl IPShuffler { #[allow(dead_code)] pub fn clear(&mut self) { self.lastframe = None; } #[allow(dead_code)] - pub fn add_frame(&mut self, buf: NAVideoBuffer) { + pub fn add_frame(&mut self, buf: NAVideoBufferRef) { self.lastframe = Some(buf); } #[allow(dead_code)] - pub fn get_ref(&mut self) -> Option> { + pub fn get_ref(&mut self) -> Option> { if let Some(ref frm) = self.lastframe { Some(frm.clone()) } else { @@ -110,8 +110,8 @@ impl Default for IPShuffler { #[allow(dead_code)] pub struct IPBShuffler { - lastframe: Option>, - nextframe: Option>, + lastframe: Option>, + nextframe: Option>, } impl IPBShuffler { @@ -120,12 +120,12 @@ impl IPBShuffler { #[allow(dead_code)] pub fn clear(&mut self) { self.lastframe = None; self.nextframe = None; } #[allow(dead_code)] - pub fn add_frame(&mut self, buf: NAVideoBuffer) { + pub fn add_frame(&mut self, buf: NAVideoBufferRef) { mem::swap(&mut self.lastframe, &mut self.nextframe); self.lastframe = Some(buf); } #[allow(dead_code)] - pub fn get_lastref(&mut self) -> Option> { + pub fn get_lastref(&mut self) -> Option> { if let Some(ref frm) = self.lastframe { Some(frm.clone()) } else { @@ -133,7 +133,7 @@ impl IPBShuffler { } } #[allow(dead_code)] - pub fn get_nextref(&mut self) -> Option> { + pub fn get_nextref(&mut self) -> Option> { if let Some(ref frm) = self.nextframe { Some(frm.clone()) } else { @@ -141,7 +141,7 @@ impl IPBShuffler { } } #[allow(dead_code)] - pub fn get_b_fwdref(&mut self) -> Option> { + pub fn get_b_fwdref(&mut self) -> Option> { if let Some(ref frm) = self.nextframe { Some(frm.clone()) } else { @@ -149,7 +149,7 @@ impl IPBShuffler { } } #[allow(dead_code)] - pub fn get_b_bwdref(&mut self) -> Option> { + pub fn get_b_bwdref(&mut self) -> Option> { if let Some(ref frm) = self.lastframe { Some(frm.clone()) } else {