<div dir="ltr"><div dir="ltr">Hi David,<div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 6 Jan 2022 at 16:16, David Plowman <<a href="mailto:david.plowman@raspberrypi.com">david.plowman@raspberrypi.com</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">Hi Naush<br>
<br>
Thanks for this patch!<br>
<br>
On Thu, 6 Jan 2022 at 11:32, Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>> wrote:<br>
><br>
> The libcamerasrc gstreamer component does seem to not allow stream resolutions<br>
> that are not advertised by PipelineHandler::generateConfiguration(). This has<br>
> been raised in a bug report [1].<br>
><br>
> Fix this behavior by advertising a SizeRange from the minimum ISP resolution, up<br>
> to the sensor resolution from PipelineHandlerRPi::generateConfiguration().<br>
><br>
> [1] <a href="https://bugs.libcamera.org/show_bug.cgi?id=105" rel="noreferrer" target="_blank">https://bugs.libcamera.org/show_bug.cgi?id=105</a><br>
><br>
> Fixes: f16acb275c85 ("pipeline: raspberrypi: Restrict the advertised maximum ISP output resolution")<br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> ---<br>
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 +++++--<br>
>  1 file changed, 5 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> index b5c687da467f..220a5749c0d9 100644<br>
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> @@ -639,8 +639,11 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,<br>
>                          */<br>
>                         for (const auto &format : fmts) {<br>
>                                 PixelFormat pf = format.first.toPixelFormat();<br>
> -                               if (pf.isValid())<br>
> -                                       deviceFormats[pf].emplace_back(sensorSize);<br>
> +                               if (pf.isValid()) {<br>
> +                                       const SizeRange &ispSizes = format.second[0];<br>
> +                                       deviceFormats[pf].emplace_back(ispSizes.min, sensorSize,<br>
> +                                                                      ispSizes.hStep, ispSizes.vStep);<br>
> +                               }<br>
<br>
Yes, looks fine to me.<br>
<br>
Reviewed-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br>
<br>
Just one related question... I wonder if we should munge those sizes<br>
(and step values) so that applications only ever see values where the<br>
width and stride match.<br>
<br>
If I do that then cheese (which uses gstreamer) actually produces<br>
non-garbled images. Hurray (never seen that before)! Though trying to<br>
run cheese using v4l2-compat.so seems to fail whatever I try. *sigh*<br></blockquote><div><br></div><div>I did think about doing this, but wasn't sure if it was how we should solve this</div><div>problem... Still unsure!</div><div><br></div><div>Regards,</div><div>Naush</div><div><br></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>
David<br>
<br>
>                         }<br>
>                 }<br>
><br>
> --<br>
> 2.25.1<br>
><br>
</blockquote></div></div>