[libcamera-devel] [PATCH] Add enable_auto_focus option to the GStreamer plugin

Cedric Nugteren cedric at plumerai.com
Fri Jun 2 15:53:03 CEST 2023


I have fixed the review comments and have installed and configured git
send-email. However, apparently it started a new thread, I don't think that
is what it should have done:
https://lists.libcamera.org/pipermail/libcamera-devel/2023-May/037925.html
(I used "git send-email --in-reply-to=037947 --to=
libcamera-devel at lists.libcamera.org patch_file.patch")

Also, you mentioned that would like to see the original patch better
formatted. Should I just create a whole new patch altogether?

Finally, about the default/non-default discussion, I was trying to be
conservative here, because when I opened the original bug (#188), the reply
I got sounded like you thought it was a missing feature rather than a bug.
For me this is a blocking bug: I can't use the PiCamV3 at all due to random
focus behaviour. So therefore I opted for keeping the default behaviour as
it was before to make it more likely that this patch will be accepted.

On Fri, Jun 2, 2023 at 7:19 AM Laurent Pinchart <
laurent.pinchart at ideasonboard.com> wrote:

> On Thu, Jun 01, 2023 at 12:24:22PM -0400, Nicolas Dufresne wrote:
> > Le jeudi 01 juin 2023 à 08:39 +0100, Naushir Patuck a écrit :
> > > > If you have any idea what the default should be in the GStreamer
> > > > element, please feel free to chime in :-)
> > >
> > > Perhaps GStreamer should do nothing with focus by default and rely on
> the IPA
> > > default behaviour (i.e. go to hyperfocal)?  This then relies on the
> application
> > > to choose what it wants to do on startup, just like any other
> application that
> > > directly uses libcamera.
> >
> > To reassure you, it can't be worse then what most UVC camera do today.
> Having a
> > default matching this would help consistency though (or being similarly
> bad from
> > some point of view). Later, on top, there should be ways to move to a
> more
> > manual control in focus aware Gst applications.
>
> Hmmmm... I'm really in two minds here.
>
> First of all, we can't expect the same default behaviour for all cameras
> when it comes to auto-focus, simply because many cameras don't have a
> controllable focus lens, and some (I'm thinking about UVC devices here)
> may not have the ability to turn auto-focus on. Still, implementing
> consistent defaults where possible is a goal I highly value, in order to
> maximize application portability.
>
> When it comes to the libcamera core, setting the focus lens to the
> hyperfocal distance and disabling auto-focus seems like a good default
> to me. Different use cases would favour different defaults, and I don't
> think there's one particular use case that could be considered so
> prevalent that it would call for enabling continuous auto-focus by
> default. Different defaults could however be implemented in different
> layers. For instance, I could imagine PipeWire deciding to enabling
> continuous auto-focus by default on desktop or mobile systems.
>
> For libcamerasrc, I don't know if the same reasoning should lead to the
> same result, or if we should consider that the vast majority of use
> cases for the GStreamer element call for enabling auto-focus by default.
> I currently side towards doing the same as in the libcamera core, as I
> believe it would be confusing for users to have different default
> behaviours when using libcamera through different adaptation layers.
> However, I could also imagine enabling auto-focus by default in the V4L2
> adaptation layer for instance, as that layer is mostly meant to expose
> libcamera-based cameras as webcams.
>
> --
> Regards,
>
> Laurent Pinchart
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20230602/a6420289/attachment.htm>


More information about the libcamera-devel mailing list