X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;ds=sidebyside;f=nihav-flash%2Fsrc%2Fcodecs%2Fflashsv.rs;h=9e577d1499c5b1cfe8edb8af58fbb42ac57f10d8;hb=fead60e32f35ca21262769174a23f6b4735bf28e;hp=91d5825a4b692439ff5e6383cd5e9d5c9a5fbcd3;hpb=886cde4847280b96e10d240c2f2d76abec121dc8;p=nihav.git diff --git a/nihav-flash/src/codecs/flashsv.rs b/nihav-flash/src/codecs/flashsv.rs index 91d5825..9e577d1 100644 --- a/nihav-flash/src/codecs/flashsv.rs +++ b/nihav-flash/src/codecs/flashsv.rs @@ -33,16 +33,10 @@ impl FSVShuffler { } fn has_last_frame(&self) -> bool { self.lastframe.is_some() } fn get_key_frame(&mut self) -> Option> { - match self.keyframe { - Some(ref frm) => Some(frm.clone()), - None => None, - } + self.keyframe.as_ref().cloned() } fn get_last_frame(&mut self) -> Option> { - match self.lastframe { - Some(ref frm) => Some(frm.clone()), - None => None, - } + self.lastframe.as_ref().cloned() } } @@ -235,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(()) @@ -390,7 +384,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 +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 +};