From c4a523582ae59ff5e056c431feeb62dd7960a634 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Mon, 16 Dec 2024 16:40:50 +0100 Subject: pipeline: rkisp1: Query dewarper crop bounds if no stream configured 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 Reviewed-by: Paul Elder Reviewed-by: Jacopo Mondi --- 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 89946b78..56192451 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 cropLimits = - dewarper_->inputCropBounds(&data->mainPathStream_); + std::pair cropLimits; + if (dewarper_->isConfigured(&data->mainPathStream_)) + cropLimits = dewarper_->inputCropBounds(&data->mainPathStream_); + else + cropLimits = dewarper_->inputCropBounds(); controls[&controls::ScalerCrop] = ControlInfo(cropLimits.first, cropLimits.second, -- cgit v1.2.1