From a4e8a3bf3da1526cb74970c0312c357f35d72525 Mon Sep 17 00:00:00 2001 From: Helen Koike Date: Fri, 6 Nov 2020 17:32:27 -0300 Subject: libcamera: pipeline: rkisp1: fix crop configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Crop rectangle was not being configured on the isp output pad nor in the resizer input pad, causing an unecessary crop in the image and an unecessary scaling by the resizer when streaming with a higher resolution then the default 800x600. Example: cam -c 1 -C -s width=3280,height=2464 In the pipeline: sensor->isp->resizer->dma_engine isp output crop is set to 800x600, which limits the output format to 800x600, which is propagated to the resizer input format set to 800x600, and the resizer output format is set to the desired end resolution 3280x2464. Signed-off-by: Helen Koike Reviewed-by: Niklas Söderlund Signed-off-by: Niklas Söderlund --- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libcamera/pipeline/rkisp1/rkisp1_path.cpp') diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index 80e1818d..3f77b1c1 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -117,9 +117,14 @@ int RkISP1Path::configure(const StreamConfiguration &config, if (ret < 0) return ret; + Rectangle rect(0, 0, ispFormat.size); + ret = resizer_->setSelection(0, V4L2_SEL_TGT_CROP, &rect); + if (ret < 0) + return ret; + LOG(RkISP1, Debug) << "Configured " << name_ << " resizer input pad with " - << ispFormat.toString(); + << ispFormat.toString() << " crop " << rect.toString(); ispFormat.size = config.size; -- cgit v1.2.1