[PATCH v4 10/20] pipeline: rkisp1: Query dewarper crop bounds if no stream configured
Paul Elder
paul.elder at ideasonboard.com
Tue Dec 17 04:50:03 CET 2024
On Mon, Dec 16, 2024 at 04:40:50PM +0100, Stefan Klug wrote:
> 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();
Ah that's how it comes together, neat.
Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>
>
> controls[&controls::ScalerCrop] = ControlInfo(cropLimits.first,
> cropLimits.second,
> --
> 2.43.0
>
More information about the libcamera-devel
mailing list