From 2cc5d7ac402249d7d41ec75416a0338bf77671dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilbert=20R=C3=B6hrbein?= Date: Sat, 19 Aug 2023 20:51:47 +0200 Subject: [PATCH] fixup! refactor and impl mjpeg --- src/linux_v4l2/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linux_v4l2/mod.rs b/src/linux_v4l2/mod.rs index 2a09f63..3d39c5c 100644 --- a/src/linux_v4l2/mod.rs +++ b/src/linux_v4l2/mod.rs @@ -123,7 +123,7 @@ impl InnerCamera for Camera { let data = match &format.fourcc.repr { b"RGB3" => buf.to_vec(), b"YUYV" => yuyv_to_rgb32(buf, size.0, size.1), - b"MJPG" => mjpeg_to_rgb32(buf, size.0, size.1), + b"MJPG" => mjpeg_to_rgb32(buf), _ => panic!("invalid buffer pixelformat"), }; @@ -210,7 +210,7 @@ fn yuyv_to_rgb32(buf: &[u8], w: u32, h: u32) -> Vec { rgba.into_buf() } -fn mjpeg_to_rgb32(buf: &[u8], w: u32, h: u32) -> Vec { +fn mjpeg_to_rgb32(buf: &[u8]) -> Vec { let jpeg = mozjpeg::Decompress::new_mem(buf).unwrap(); let mut decompress = jpeg.rgba().unwrap(); decompress.read_scanlines_flat().unwrap()