From 56c99424edd64c5a2bfe255eabc9e00787fc75a0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 22 May 2020 04:02:06 +0300 Subject: libcamera: pipeline: Replace explicit DRM FourCCs with libcamera formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the new pixel format constants to replace usage of macros from drm_fourcc.h. The IPU3 pipeline handler still uses DRM FourCCs for IPU3-specific formats that are not defined in the libcamera public API. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libcamera/pipeline/raspberrypi') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 7f23666e..60985b71 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -13,12 +13,12 @@ #include #include +#include #include #include #include #include -#include #include #include "libcamera/internal/camera_sensor.h" @@ -490,7 +490,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate() if (fmts.find(V4L2PixelFormat::fromPixelFormat(cfgPixFmt, false)) == fmts.end()) { /* If we cannot find a native format, use a default one. */ - cfgPixFmt = PixelFormat(DRM_FORMAT_NV12); + cfgPixFmt = formats::NV12; status = Adjusted; } } @@ -537,20 +537,20 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, break; case StreamRole::StillCapture: - cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12); + cfg.pixelFormat = formats::NV12; /* Return the largest sensor resolution. */ cfg.size = data->sensor_->resolution(); cfg.bufferCount = 1; break; case StreamRole::VideoRecording: - cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12); + cfg.pixelFormat = formats::NV12; cfg.size = { 1920, 1080 }; cfg.bufferCount = 4; break; case StreamRole::Viewfinder: - cfg.pixelFormat = PixelFormat(DRM_FORMAT_ARGB8888); + cfg.pixelFormat = formats::ARGB8888; cfg.size = { 800, 600 }; cfg.bufferCount = 4; break; -- cgit v1.2.1