Skip to content

Commit 897e4aa

Browse files
authored
Fix V4L2 BGR24 handling (#1748)
1 parent 8c303c8 commit 897e4aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libsrc/grabber/video/v4l2/V4L2Grabber.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(ControlIDPropertyMap, _controlIDPropertyMap, (initCont
5454
static PixelFormat GetPixelFormat(const unsigned int format)
5555
{
5656
if (format == V4L2_PIX_FMT_RGB32) return PixelFormat::RGB32;
57-
if (format == V4L2_PIX_FMT_RGB24) return PixelFormat::BGR24;
57+
if (format == V4L2_PIX_FMT_BGR24) return PixelFormat::BGR24;
5858
if (format == V4L2_PIX_FMT_YUYV) return PixelFormat::YUYV;
5959
if (format == V4L2_PIX_FMT_UYVY) return PixelFormat::UYVY;
6060
if (format == V4L2_PIX_FMT_NV12) return PixelFormat::NV12;
@@ -558,7 +558,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
558558
break;
559559

560560
case PixelFormat::BGR24:
561-
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
561+
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_BGR24;
562562
break;
563563

564564
case PixelFormat::YUYV:
@@ -691,7 +691,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
691691
}
692692
break;
693693

694-
case V4L2_PIX_FMT_RGB24:
694+
case V4L2_PIX_FMT_BGR24:
695695
{
696696
_pixelFormat = PixelFormat::BGR24;
697697
_frameByteSize = _width * _height * 3;

0 commit comments

Comments
 (0)