summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-22 04:02:06 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-18 13:26:53 +0300
commit56c99424edd64c5a2bfe255eabc9e00787fc75a0 (patch)
tree953cf6d6bffa3ed0921694931a75bc6512d81c2b /src/libcamera/pipeline/raspberrypi
parent98b05ba37850431be8ebbfd4febcef477633a7b5 (diff)
libcamera: pipeline: Replace explicit DRM FourCCs with libcamera formats
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp10
1 files changed, 5 insertions, 5 deletions
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 <libcamera/camera.h>
#include <libcamera/control_ids.h>
+#include <libcamera/formats.h>
#include <libcamera/ipa/raspberrypi.h>
#include <libcamera/logging.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
-#include <linux/drm_fourcc.h>
#include <linux/videodev2.h>
#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;