summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rkisp1
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/rkisp1
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/rkisp1')
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index d1abdb50..6ee8da35 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -433,13 +433,13 @@ RkISP1CameraConfiguration::RkISP1CameraConfiguration(Camera *camera,
CameraConfiguration::Status RkISP1CameraConfiguration::validate()
{
static const std::array<PixelFormat, 8> formats{
- DRM_FORMAT_YUYV,
- DRM_FORMAT_YVYU,
- DRM_FORMAT_VYUY,
- DRM_FORMAT_NV16,
- DRM_FORMAT_NV61,
- DRM_FORMAT_NV21,
- DRM_FORMAT_NV12,
+ PixelFormat(DRM_FORMAT_YUYV),
+ PixelFormat(DRM_FORMAT_YVYU),
+ PixelFormat(DRM_FORMAT_VYUY),
+ PixelFormat(DRM_FORMAT_NV16),
+ PixelFormat(DRM_FORMAT_NV61),
+ PixelFormat(DRM_FORMAT_NV21),
+ PixelFormat(DRM_FORMAT_NV12),
/* \todo Add support for 8-bit greyscale to DRM formats */
};
@@ -461,7 +461,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
if (std::find(formats.begin(), formats.end(), cfg.pixelFormat) ==
formats.end()) {
LOG(RkISP1, Debug) << "Adjusting format to NV12";
- cfg.pixelFormat = DRM_FORMAT_NV12,
+ cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12),
status = Adjusted;
}
@@ -540,7 +540,7 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera
return config;
StreamConfiguration cfg{};
- cfg.pixelFormat = DRM_FORMAT_NV12;
+ cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12);
cfg.size = data->sensor_->resolution();
config->addConfiguration(cfg);