[libcamera-devel,v5,3/5] libcamera: raspberrypi: Initialise the SensorCropMaximum property
diff mbox series

Message ID 20201023102159.26274-4-david.plowman@raspberrypi.com
State Accepted
Headers show
Series
  • Digital zoom
Related show

Commit Message

David Plowman Oct. 23, 2020, 10:21 a.m. UTC
Initialise it to show we support its use, however, set it to all
zeroes to indicate that it's not meaningful yet.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Laurent Pinchart Oct. 23, 2020, 10:48 p.m. UTC | #1
Hi David,

Thank you for the patch.

On Fri, Oct 23, 2020 at 11:21:57AM +0100, David Plowman wrote:
> Initialise it to show we support its use, however, set it to all
> zeroes to indicate that it's not meaningful yet.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index dd62dfc7..763451a8 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -926,6 +926,13 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
>  	/* Initialize the camera properties. */
>  	data->properties_ = data->sensor_->properties();
>  
> +	/*
> +	 * Set a default value for the ScalerCropMaximum property to show
> +	 * that we support its use, however, initialise it to zero because
> +	 * it's not meaningful until a camera mode has been chosen.
> +	 */
> +	data->properties_.set(properties::ScalerCropMaximum, Rectangle{});

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
>  	/*
>  	 * We cache three things about the sensor in relation to transforms
>  	 * (meaning horizontal and vertical flips).

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index dd62dfc7..763451a8 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -926,6 +926,13 @@  bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
 	/* Initialize the camera properties. */
 	data->properties_ = data->sensor_->properties();
 
+	/*
+	 * Set a default value for the ScalerCropMaximum property to show
+	 * that we support its use, however, initialise it to zero because
+	 * it's not meaningful until a camera mode has been chosen.
+	 */
+	data->properties_.set(properties::ScalerCropMaximum, Rectangle{});
+
 	/*
 	 * We cache three things about the sensor in relation to transforms
 	 * (meaning horizontal and vertical flips).