[PATCH v4 10/20] pipeline: rkisp1: Query dewarper crop bounds if no stream configured

Stefan Klug stefan.klug at ideasonboard.com
Mon Dec 16 16:40:50 CET 2024


Query the crop bounds on the dewarper instead of the stream in case the
camera was not yet configured when updateControls() gets called. This
provides sane defaults for the controls.

Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>

---

Changes in v4:
- Split patch from libcamera: converter_v4l2_m2m: Improve crop bounds
  support
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 89946b782854..56192451eb3c 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -1220,8 +1220,11 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)
 	ControlInfoMap::Map controls;
 
 	if (dewarper_) {
-		std::pair<Rectangle, Rectangle> cropLimits =
-			dewarper_->inputCropBounds(&data->mainPathStream_);
+		std::pair<Rectangle, Rectangle> cropLimits;
+		if (dewarper_->isConfigured(&data->mainPathStream_))
+			cropLimits = dewarper_->inputCropBounds(&data->mainPathStream_);
+		else
+			cropLimits = dewarper_->inputCropBounds();
 
 		controls[&controls::ScalerCrop] = ControlInfo(cropLimits.first,
 							      cropLimits.second,
-- 
2.43.0



More information about the libcamera-devel mailing list