summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/vimc.cpp
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/vimc.cpp
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/vimc.cpp')
-rw-r--r--src/libcamera/pipeline/vimc.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index 00cb7389..097bbd5b 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -106,9 +106,9 @@ private:
namespace {
static const std::array<PixelFormat, 3> pixelformats{
- DRM_FORMAT_RGB888,
- DRM_FORMAT_BGR888,
- DRM_FORMAT_BGRA8888,
+ PixelFormat(DRM_FORMAT_RGB888),
+ PixelFormat(DRM_FORMAT_BGR888),
+ PixelFormat(DRM_FORMAT_BGRA8888),
};
} /* namespace */
@@ -137,7 +137,7 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()
if (std::find(pixelformats.begin(), pixelformats.end(), cfg.pixelFormat) ==
pixelformats.end()) {
LOG(VIMC, Debug) << "Adjusting format to RGB24";
- cfg.pixelFormat = DRM_FORMAT_BGR888;
+ cfg.pixelFormat = PixelFormat(DRM_FORMAT_BGR888);
status = Adjusted;
}
@@ -186,7 +186,7 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,
StreamConfiguration cfg(formats);
- cfg.pixelFormat = DRM_FORMAT_BGR888;
+ cfg.pixelFormat = PixelFormat(DRM_FORMAT_BGR888);
cfg.size = { 1920, 1080 };
cfg.bufferCount = 4;