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 <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
This commit is contained in:
Stefan Klug
2024-12-16 16:40:50 +01:00
parent 06346821be
commit c4a523582a
+5 -2
View File
@@ -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,