<div dir="ltr"><div dir="ltr">Hi David,<div><br></div></div>Thank you for this fix!<div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 12 Jan 2023 at 11:06, David Plowman via libcamera-devel <<a href="mailto:libcamera-devel@lists.libcamera.org">libcamera-devel@lists.libcamera.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Previously the x,y offsets in the min/max ScalerCrop control values<br>
were zero. Here we make them the same as the sensor's analogue crop<br>
offset which is I think less misleading.<br>
<br>
With this change, it also seems reasonable to advertise the default<br>
scaler crop value to be the true default that you will get. This makes<br>
it possible for applications to see what that value will be without<br>
having to start the camera and wait for frames.<br>
<br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 ++++---<br>
 1 file changed, 4 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
index 8569df17..809af4d2 100644<br>
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
@@ -905,6 +905,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)<br>
        /* Adjust aspect ratio by providing crops on the input image. */<br>
        Size size = unicamFormat.size.boundedToAspectRatio(maxSize);<br>
        Rectangle crop = size.centeredTo(Rectangle(unicamFormat.size).center());<br>
+       Rectangle defaultCrop = crop;<br>
        data->ispCrop_ = crop;<br>
<br>
        data->isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop);<br>
@@ -958,9 +959,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)<br>
                ctrlMap.emplace(c.first, c.second);<br>
<br>
        /* Add the ScalerCrop control limits based on the current mode. */<br>
-       Rectangle ispMinCrop(data->ispMinCropSize_);<br>
-       ispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize);<br>
-       ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()));<br>
+       Rectangle ispMinCrop = data->scaleIspCrop(Rectangle(data->ispMinCropSize_));<br>
+       defaultCrop = data->scaleIspCrop(defaultCrop);<br>
+       ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, data->sensorInfo_.analogCrop, defaultCrop);<br>
<br>
        data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());<br>
<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div></div></div>