summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/vimc
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/vimc
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/vimc')
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 3881545b..b6530662 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -17,6 +17,7 @@
#include <libcamera/camera.h>
#include <libcamera/control_ids.h>
#include <libcamera/controls.h>
+#include <libcamera/formats.h>
#include <libcamera/ipa/ipa_interface.h>
#include <libcamera/ipa/ipa_module_info.h>
#include <libcamera/request.h>
@@ -108,8 +109,8 @@ private:
namespace {
static const std::map<PixelFormat, uint32_t> pixelformats{
- { PixelFormat(DRM_FORMAT_RGB888), MEDIA_BUS_FMT_BGR888_1X24 },
- { PixelFormat(DRM_FORMAT_BGR888), MEDIA_BUS_FMT_RGB888_1X24 },
+ { formats::RGB888, MEDIA_BUS_FMT_BGR888_1X24 },
+ { formats::BGR888, MEDIA_BUS_FMT_RGB888_1X24 },
};
} /* namespace */
@@ -138,7 +139,7 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()
const std::vector<libcamera::PixelFormat> formats = cfg.formats().pixelformats();
if (std::find(formats.begin(), formats.end(), cfg.pixelFormat) == formats.end()) {
LOG(VIMC, Debug) << "Adjusting format to BGR888";
- cfg.pixelFormat = PixelFormat(DRM_FORMAT_BGR888);
+ cfg.pixelFormat = formats::BGR888;
status = Adjusted;
}
@@ -184,7 +185,7 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,
* but it isn't functional within the pipeline.
*/
if (data->media_->version() < KERNEL_VERSION(5, 7, 0)) {
- if (pixelformat.first != PixelFormat(DRM_FORMAT_BGR888)) {
+ if (pixelformat.first != formats::BGR888) {
LOG(VIMC, Info)
<< "Skipping unsupported pixel format "
<< pixelformat.first.toString();
@@ -201,7 +202,7 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,
StreamConfiguration cfg(formats);
- cfg.pixelFormat = PixelFormat(DRM_FORMAT_BGR888);
+ cfg.pixelFormat = formats::BGR888;
cfg.size = { 1920, 1080 };
cfg.bufferCount = 4;