From d1de08f431ebff4c20f7cb7567e85258a364c7a2 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 12 Aug 2023 09:24:17 +0200 Subject: [PATCH] flashsv: the codec uses BGR24 format instead of RGB24 --- nihav-flash/src/codecs/flashsv.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 +}; -- 2.39.5