]> git.nihav.org Git - nihav.git/blobdiff - nihav-flash/src/codecs/flashsv.rs
avimux: do not record palette change chunks in OpenDML index
[nihav.git] / nihav-flash / src / codecs / flashsv.rs
index 91d5825a4b692439ff5e6383cd5e9d5c9a5fbcd3..195df105c4dd284eb1087d3b3ec58ec4b8c46b7b 100644 (file)
@@ -9,7 +9,6 @@ struct FSVShuffler {
     keyframe:  Option<NAVideoBufferRef<u8>>,
 }
 
-#[allow(dead_code)]
 impl FSVShuffler {
     fn new() -> Self { Self::default() }
     fn clear(&mut self) {
@@ -33,17 +32,11 @@ impl FSVShuffler {
     }
     fn has_last_frame(&self) -> bool { self.lastframe.is_some() }
     fn get_key_frame(&mut self) -> Option<NAVideoBufferRef<u8>> {
-        match self.keyframe {
-            Some(ref frm) => Some(frm.clone()),
-            None => None,
-        }
-    }
-    fn get_last_frame(&mut self) -> Option<NAVideoBufferRef<u8>> {
-        match self.lastframe {
-            Some(ref frm) => Some(frm.clone()),
-            None => None,
-        }
+        self.keyframe.as_ref().cloned()
     }
+    /*fn get_last_frame(&mut self) -> Option<NAVideoBufferRef<u8>> {
+        self.lastframe.as_ref().cloned()
+    }*/
 }
 
 
@@ -235,7 +228,7 @@ impl NADecoder for FSVDecoder {
         if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
             let w = vinfo.get_width();
             let h = vinfo.get_height();
-            let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(w, h, true, RGB24_FORMAT));
+            let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(w, h, true, BGR24_FORMAT));
             self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref();
 
             Ok(())
@@ -390,7 +383,7 @@ mod test {
 }
 
 const DEFAULT_PAL: [u8; 128 * 3] = [
-     0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x66, 0x66, 0x66, 0x99, 0x99, 0x99,
+    0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x66, 0x66, 0x66, 0x99, 0x99, 0x99,
     0xCC, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x00, 0x66, 0x00, 0x00,
     0x99, 0x00, 0x00, 0xCC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x33, 0x00,
     0x00, 0x66, 0x00, 0x00, 0x99, 0x00, 0x00, 0xCC, 0x00, 0x00, 0xFF, 0x00,
@@ -423,3 +416,16 @@ const DEFAULT_PAL: [u8; 128 * 3] = [
     0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x44, 0x44, 0x44, 0x55, 0x55, 0x55,
     0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xBB, 0xDD, 0xDD, 0xDD, 0xEE, 0xEE, 0xEE
 ];
+
+const BGR24_FORMAT: NAPixelFormaton = NAPixelFormaton {
+        model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+        comp_info: [
+            Some(NAPixelChromaton{
+                h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 3 }),
+            Some(NAPixelChromaton{
+                h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 3 }),
+            Some(NAPixelChromaton{
+                h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 0, next_elem: 3 }),
+            None, None],
+        elem_size: 3, be: false, alpha: false, palette: false
+};