summaryrefslogtreecommitdiff
path: root/src/qcam
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-10-25 13:05:16 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-28 17:04:20 +0200
commit448716d8f75185795d9b01164440d0753850a80a (patch)
treebe19233b0fa0e29b607e52dd62ea10d255dde36a /src/qcam
parent2a8bf04227811b29bc94b942e78f1567afd8874b (diff)
libcamera: Switch PixelFormat to DRM FourCC values
Use DRM FourCC values for the newly defined PixelFormat. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/qcam')
-rw-r--r--src/qcam/format_converter.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/qcam/format_converter.cpp b/src/qcam/format_converter.cpp
index 86b03b2c..383d4822 100644
--- a/src/qcam/format_converter.cpp
+++ b/src/qcam/format_converter.cpp
@@ -7,7 +7,7 @@
#include <errno.h>
-#include <linux/videodev2.h>
+#include <linux/drm_fourcc.h>
#include <QImage>
@@ -31,84 +31,84 @@ int FormatConverter::configure(unsigned int format, unsigned int width,
unsigned int height)
{
switch (format) {
- case V4L2_PIX_FMT_NV12:
+ case DRM_FORMAT_NV12:
formatFamily_ = NV;
horzSubSample_ = 2;
vertSubSample_ = 2;
nvSwap_ = false;
break;
- case V4L2_PIX_FMT_NV21:
+ case DRM_FORMAT_NV21:
formatFamily_ = NV;
horzSubSample_ = 2;
vertSubSample_ = 2;
nvSwap_ = true;
break;
- case V4L2_PIX_FMT_NV16:
+ case DRM_FORMAT_NV16:
formatFamily_ = NV;
horzSubSample_ = 2;
vertSubSample_ = 1;
nvSwap_ = false;
break;
- case V4L2_PIX_FMT_NV61:
+ case DRM_FORMAT_NV61:
formatFamily_ = NV;
horzSubSample_ = 2;
vertSubSample_ = 1;
nvSwap_ = true;
break;
- case V4L2_PIX_FMT_NV24:
+ case DRM_FORMAT_NV24:
formatFamily_ = NV;
horzSubSample_ = 1;
vertSubSample_ = 1;
nvSwap_ = false;
break;
- case V4L2_PIX_FMT_NV42:
+ case DRM_FORMAT_NV42:
formatFamily_ = NV;
horzSubSample_ = 1;
vertSubSample_ = 1;
nvSwap_ = true;
break;
- case V4L2_PIX_FMT_BGR24:
+ case DRM_FORMAT_RGB888:
formatFamily_ = RGB;
r_pos_ = 2;
g_pos_ = 1;
b_pos_ = 0;
bpp_ = 3;
break;
- case V4L2_PIX_FMT_RGB24:
+ case DRM_FORMAT_BGR888:
formatFamily_ = RGB;
r_pos_ = 0;
g_pos_ = 1;
b_pos_ = 2;
bpp_ = 3;
break;
- case V4L2_PIX_FMT_ARGB32:
+ case DRM_FORMAT_BGRA8888:
formatFamily_ = RGB;
r_pos_ = 1;
g_pos_ = 2;
b_pos_ = 3;
bpp_ = 4;
break;
- case V4L2_PIX_FMT_VYUY:
+ case DRM_FORMAT_VYUY:
formatFamily_ = YUV;
y_pos_ = 1;
cb_pos_ = 2;
break;
- case V4L2_PIX_FMT_YVYU:
+ case DRM_FORMAT_YVYU:
formatFamily_ = YUV;
y_pos_ = 0;
cb_pos_ = 3;
break;
- case V4L2_PIX_FMT_UYVY:
+ case DRM_FORMAT_UYVY:
formatFamily_ = YUV;
y_pos_ = 1;
cb_pos_ = 0;
break;
- case V4L2_PIX_FMT_YUYV:
+ case DRM_FORMAT_YUYV:
formatFamily_ = YUV;
y_pos_ = 0;
cb_pos_ = 1;
break;
- case V4L2_PIX_FMT_MJPEG:
+ case DRM_FORMAT_MJPEG:
formatFamily_ = MJPEG;
break;
default: