summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-04-19 13:26:10 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-04-19 13:38:11 +0300
commit8cf52e378d60cbd255a20eb51827e17814264073 (patch)
tree648f6339b6ee6e2f73e2e9b994b5184d41ca91e9
parent8bc88758d29cd8a73369ca62813d713517d414b7 (diff)
libcamera: pipeline: rkisp1: Don't hardcode NV12 in configureStreams()
Use the pixel format requested by the application in the RkISP1PipelineHandler::configureStreams() method instead of hardcoding NV12. The streamsConfiguration() method still proposes NV12 by default. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 8ed0ba84..51f00fb6 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -223,7 +223,7 @@ int PipelineHandlerRkISP1::configureStreams(Camera *camera,
V4L2DeviceFormat outputFormat = {};
outputFormat.width = cfg.width;
outputFormat.height = cfg.height;
- outputFormat.fourcc = V4L2_PIX_FMT_NV12;
+ outputFormat.fourcc = cfg.pixelFormat;
outputFormat.planesCount = 2;
ret = video_->setFormat(&outputFormat);
@@ -232,12 +232,12 @@ int PipelineHandlerRkISP1::configureStreams(Camera *camera,
if (outputFormat.width != cfg.width ||
outputFormat.height != cfg.height ||
- outputFormat.fourcc != V4L2_PIX_FMT_NV12) {
+ outputFormat.fourcc != cfg.pixelFormat) {
LOG(RkISP1, Error)
<< "Unable to configure capture in " << cfg.width
<< "x" << cfg.height << "-0x"
<< std::hex << std::setfill('0') << std::setw(8)
- << V4L2_PIX_FMT_NV12;
+ << cfg.pixelFormat;
return -EINVAL;
}