aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2023-08-12 09:24:17 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2023-08-12 09:24:39 +0200
commitd1de08f431ebff4c20f7cb7567e85258a364c7a2 (patch)
treea7fe894d4269a445ca5089073a45c12f760c6783
parent964dffda42954044e7628b212bd389ff554c1027 (diff)
downloadnihav-d1de08f431ebff4c20f7cb7567e85258a364c7a2.tar.gz
flashsv: the codec uses BGR24 format instead of RGB24
-rw-r--r--nihav-flash/src/codecs/flashsv.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/nihav-flash/src/codecs/flashsv.rs b/nihav-flash/src/codecs/flashsv.rs
index 0cc98ba..9e577d1 100644
--- a/nihav-flash/src/codecs/flashsv.rs
+++ b/nihav-flash/src/codecs/flashsv.rs
@@ -229,7 +229,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(())
@@ -417,3 +417,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
+};