From 897e4aac8a8708cd785b385254b5da423b7ce626 Mon Sep 17 00:00:00 2001 From: Thinner77 <59623671+Thinner77@users.noreply.github.com> Date: Thu, 30 May 2024 22:30:29 +0200 Subject: [PATCH] Fix V4L2 BGR24 handling (#1748) --- libsrc/grabber/video/v4l2/V4L2Grabber.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/grabber/video/v4l2/V4L2Grabber.cpp b/libsrc/grabber/video/v4l2/V4L2Grabber.cpp index 081b978b4..b0c404e55 100644 --- a/libsrc/grabber/video/v4l2/V4L2Grabber.cpp +++ b/libsrc/grabber/video/v4l2/V4L2Grabber.cpp @@ -54,7 +54,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(ControlIDPropertyMap, _controlIDPropertyMap, (initCont static PixelFormat GetPixelFormat(const unsigned int format) { if (format == V4L2_PIX_FMT_RGB32) return PixelFormat::RGB32; - if (format == V4L2_PIX_FMT_RGB24) return PixelFormat::BGR24; + if (format == V4L2_PIX_FMT_BGR24) return PixelFormat::BGR24; if (format == V4L2_PIX_FMT_YUYV) return PixelFormat::YUYV; if (format == V4L2_PIX_FMT_UYVY) return PixelFormat::UYVY; if (format == V4L2_PIX_FMT_NV12) return PixelFormat::NV12; @@ -558,7 +558,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard) break; case PixelFormat::BGR24: - fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; + fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_BGR24; break; case PixelFormat::YUYV: @@ -691,7 +691,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard) } break; - case V4L2_PIX_FMT_RGB24: + case V4L2_PIX_FMT_BGR24: { _pixelFormat = PixelFormat::BGR24; _frameByteSize = _width * _height * 3;