summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/ipu3
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-16 10:07:26 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-03-18 18:02:40 +0100
commit718f5e99a966246de8d129902ad470872652b749 (patch)
tree0e16bc1b512304c8341c4a1334654d508631a7a7 /src/libcamera/pipeline/ipu3
parent8c0bbcd3d3751a716eb8bf03e703aa6fdbe1bd3f (diff)
libcamera: PixelFormat: Make constructor explicit
To achieve the goal of preventing unwanted conversion between a DRM and a V4L2 FourCC, make the PixelFormat constructor that takes an integer value explicit. All users of pixel formats flagged by the compiler are fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/pipeline/ipu3')
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 84158ebe..9c7ec9ed 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -246,7 +246,7 @@ IPU3CameraConfiguration::IPU3CameraConfiguration(Camera *camera,
void IPU3CameraConfiguration::adjustStream(StreamConfiguration &cfg, bool scale)
{
/* The only pixel format the driver supports is NV12. */
- cfg.pixelFormat = DRM_FORMAT_NV12;
+ cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12);
if (scale) {
/*
@@ -401,7 +401,7 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,
StreamConfiguration cfg = {};
IPU3Stream *stream = nullptr;
- cfg.pixelFormat = DRM_FORMAT_NV12;
+ cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12);
switch (role) {
case StreamRole::StillCapture:
@@ -1141,7 +1141,7 @@ int ImgUDevice::configureOutput(ImgUOutput *output,
return 0;
V4L2DeviceFormat outputFormat = {};
- outputFormat.fourcc = dev->toV4L2Fourcc(DRM_FORMAT_NV12);
+ outputFormat.fourcc = dev->toV4L2Fourcc(PixelFormat(DRM_FORMAT_NV12));
outputFormat.size = cfg.size;
outputFormat.planesCount = 2;