Skip to content

Commit

Permalink
Fix V4L2 BGR24 handling (#1748)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thinner77 authored May 30, 2024
1 parent 8c303c8 commit 897e4aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libsrc/grabber/video/v4l2/V4L2Grabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 897e4aa

Please sign in to comment.