[{"id":27313,"web_url":"https://patchwork.libcamera.org/comment/27313/","msgid":"<6989922f-e3d9-7254-fea2-9f2a9ddaecec@lankhorst.se>","date":"2023-06-09T14:54:50","subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","submitter":{"id":166,"url":"https://patchwork.libcamera.org/api/people/166/","name":"Maarten Lankhorst","email":"dev@lankhorst.se"},"content":"Hey,\n\nCan confirm it helps my v3 camera to focus. Together with patches to set hflip/vflip (to rotate 180°)\nand setting flicker mode, the v3 is better than v2 was with gstreamer's rpicamsrc. I don't need to use\na screwdriver any more to set a fixed focus. :-)\n\nReviewed-by: Maarten Lankhorst <dev@lankhorst.se>\n\nOn 2023-06-09 16:31, Cedric Nugteren via libcamera-devel wrote:\n> Subject:\n> [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus option to the GStreamer plugin\n> From:\n> Cedric Nugteren via libcamera-devel <libcamera-devel@lists.libcamera.org>\n> Date:\n> 2023-06-09 16:31\n>\n> To:\n> libcamera-devel@lists.libcamera.org\n> CC:\n> Cedric Nugteren <web@cedricnugteren.nl>\n>\n>\n> Cameras such as the PiCam 3 support auto-focus, but the GStreamer plugin\n> for libcamera does not enable auto-focus. With this patch auto-focus can\n> be enabled for cameras that support it. By default it is disabled, which\n> means default behaviour remains unchanged. For cameras that do not\n> support auto-focus, an error message shows up if auto-focus is enabled.\n>\n> This was tested on cameras that do not support auto-focus (e.g. PiCam2)\n> and was tested on a camera that does support auto-focus (PiCam3) by\n> setting it to AfModeContinous, observing auto-focus, and by setting it\n> to AfModeManual or by not setting the option, both resulting in\n> auto-focus being disabled.\n>\n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=188.\n>\n> Signed-off-by: Cedric Nugteren <web@cedricnugteren.nl>\n> ---\n> Changes since v1:\n> - Now re-using the GParamSpec variables instead of re-creating.\n> - Use bool instead of gboolean for enable_auto_focus.\n> - Remove changes from the reconfigure_element functions.\n>\n> Changes since v2:\n> - Fix a typo in the commit message (remove 'it').\n> - Fix the link to the actual bug.\n> - Apply the style suggestions of utils/checkstyle.py.\n> - Start the commit message with 'gstreamer:'.\n> - Change the boolean to a 3-option AfMode enum and change variable\n>   names and strings accordingly.\n>\n> ---\n>  src/gstreamer/gstlibcameraprovider.cpp | 14 ++++++++++++\n>  src/gstreamer/gstlibcamerasrc.cpp      | 30 ++++++++++++++++++++++++-\n>  src/gstreamer/gstlibcamerasrc.h        | 31 ++++++++++++++++++++++++++\n>  3 files changed, 74 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..aece3506 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -31,6 +31,7 @@ GST_DEBUG_CATEGORY_STATIC(provider_debug);\n>  \n>  enum {\n>  \tPROP_DEVICE_NAME = 1,\n> +\tPROP_AUTO_FOCUS_MODE = 2,\n>  };\n>  \n>  #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()\n> @@ -40,6 +41,7 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,\n>  struct _GstLibcameraDevice {\n>  \tGstDevice parent;\n>  \tgchar *name;\n> +\tint auto_focus_mode = libcamera::controls::AfModeManual;\n>  };\n>  \n>  G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)\n> @@ -56,6 +58,7 @@ gst_libcamera_device_create_element(GstDevice *device, const gchar *name)\n>  \tg_assert(source);\n>  \n>  \tg_object_set(source, \"camera-name\", GST_LIBCAMERA_DEVICE(device)->name, nullptr);\n> +\tg_object_set(source, \"auto-focus-mode\", GST_LIBCAMERA_DEVICE(device)->auto_focus_mode, nullptr);\n>  \n>  \treturn source;\n>  }\n> @@ -82,6 +85,9 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,\n>  \tcase PROP_DEVICE_NAME:\n>  \t\tdevice->name = g_value_dup_string(value);\n>  \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tdevice->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +\t\tbreak;\n>  \tdefault:\n>  \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>  \t\tbreak;\n> @@ -121,6 +127,14 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>  \t\t\t\t\t\t(GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |\n>  \t\t\t\t\t\t\t      G_PARAM_CONSTRUCT_ONLY));\n>  \tg_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec);\n> +\tpspec = g_param_spec_enum(\"auto-focus-mode\",\n> +\t\t\t\t  \"Set auto-focus mode\",\n> +\t\t\t\t  \"Available options: AfModeManual, \"\n> +\t\t\t\t  \"AfModeAuto or AfModeContinuous.\",\n> +\t\t\t\t  gst_libcamera_auto_focus_get_type(),\n> +\t\t\t\t  static_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\t  G_PARAM_WRITABLE);\n> +\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);\n>  }\n>  \n>  static GstDevice *\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..cfb8f70c 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -146,6 +146,7 @@ struct _GstLibcameraSrc {\n>  \tGstTask *task;\n>  \n>  \tgchar *camera_name;\n> +\tint auto_focus_mode = libcamera::controls::AfModeManual;\n>  \n>  \tGstLibcameraSrcState *state;\n>  \tGstLibcameraAllocator *allocator;\n> @@ -154,7 +155,8 @@ struct _GstLibcameraSrc {\n>  \n>  enum {\n>  \tPROP_0,\n> -\tPROP_CAMERA_NAME\n> +\tPROP_CAMERA_NAME,\n> +\tPROP_AUTO_FOCUS_MODE,\n>  };\n>  \n>  G_DEFINE_TYPE_WITH_CODE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT,\n> @@ -577,6 +579,18 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>  \t\tgst_flow_combiner_add_pad(self->flow_combiner, srcpad);\n>  \t}\n>  \n> +\tif (self->auto_focus_mode != libcamera::controls::AfModeManual) {\n> +\t\tconst ControlInfoMap &infoMap = state->cam_->controls();\n> +\t\tif (infoMap.find(&controls::AfMode) != infoMap.end()) {\n> +\t\t\tstate->initControls_.set(controls::AfMode, self->auto_focus_mode);\n> +\t\t} else {\n> +\t\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> +\t\t\t\t\t  (\"Failed to enable auto focus\"),\n> +\t\t\t\t\t  (\"AfMode not supported by this camera, \"\n> +\t\t\t\t\t   \"please retry with 'auto-focus-mode=AfModeManual'\"));\n> +\t\t}\n> +\t}\n> +\n>  \tret = state->cam_->start(&state->initControls_);\n>  \tif (ret) {\n>  \t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> @@ -659,6 +673,9 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id,\n>  \t\tg_free(self->camera_name);\n>  \t\tself->camera_name = g_value_dup_string(value);\n>  \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tself->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +\t\tbreak;\n>  \tdefault:\n>  \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>  \t\tbreak;\n> @@ -676,6 +693,9 @@ gst_libcamera_src_get_property(GObject *object, guint prop_id, GValue *value,\n>  \tcase PROP_CAMERA_NAME:\n>  \t\tg_value_set_string(value, self->camera_name);\n>  \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tg_value_set_enum(value, static_cast<gint>(self->auto_focus_mode));\n> +\t\tbreak;\n>  \tdefault:\n>  \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>  \t\tbreak;\n> @@ -844,4 +864,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n>  \t\t\t\t\t\t\t     | G_PARAM_READWRITE\n>  \t\t\t\t\t\t\t     | G_PARAM_STATIC_STRINGS));\n>  \tg_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);\n> +\tspec = g_param_spec_enum(\"auto-focus-mode\",\n> +\t\t\t\t \"Set auto-focus mode\",\n> +\t\t\t\t \"Available options: AfModeManual, \"\n> +\t\t\t\t \"AfModeAuto or AfModeContinuous.\",\n> +\t\t\t\t gst_libcamera_auto_focus_get_type(),\n> +\t\t\t\t static_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\t G_PARAM_WRITABLE);\n> +\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec);\n>  }\n> diff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h\n> index fdea2f10..0a88ba02 100644\n> --- a/src/gstreamer/gstlibcamerasrc.h\n> +++ b/src/gstreamer/gstlibcamerasrc.h\n> @@ -8,6 +8,8 @@\n>  \n>  #pragma once\n>  \n> +#include <libcamera/control_ids.h>\n> +\n>  #include <gst/gst.h>\n>  \n>  G_BEGIN_DECLS\n> @@ -17,3 +19,32 @@ G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src,\n>  \t\t     GST_LIBCAMERA, SRC, GstElement)\n>  \n>  G_END_DECLS\n> +\n> +inline GType\n> +gst_libcamera_auto_focus_get_type()\n> +{\n> +\tstatic GType type = 0;\n> +\tstatic const GEnumValue values[] = {\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\"AfModeManual\",\n> +\t\t\t\"manual-focus\",\n> +\t\t},\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeAuto),\n> +\t\t\t\"AfModeAuto\",\n> +\t\t\t\"automatic-auto-focus\",\n> +\t\t},\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeContinuous),\n> +\t\t\t\"AfModeContinuous\",\n> +\t\t\t\"continuous-auto-focus\",\n> +\t\t},\n> +\t\t{ 0, NULL, NULL }\n> +\t};\n> +\n> +\tif (!type)\n> +\t\ttype = g_enum_register_static(\"GstLibcameraAutoFocus\", values);\n> +\n> +\treturn type;\n> +}\n> -- 2.34.1","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 00B41C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Jun 2023 14:54:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 81E5761E61;\n\tFri,  9 Jun 2023 16:54:53 +0200 (CEST)","from mblankhorst.nl (lankhorst.se [141.105.120.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1517C61E4E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Jun 2023 16:54:52 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686322493;\n\tbh=UYgUkGXx3CUo3DLZnWujXsNwGR3KKf69/5+hnb5R91k=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=VI9n8ok6DRHpxkL/s/0Dki7X7DKAoOGn6kMA+T0S22TlpClty3bVVy2sjlAN9iZuX\n\tVeIZSvohajtNFT1bCZYaH8oJbpq9/j859eug9QiFnfkTHauxp1Qc11tnY0hS14+p8w\n\tteiDQVfbzF6aFrKU4qPUk7YD0iONmJphMrk1nrhnqh3aIUh2WnDRRxqcbafCSnGSqm\n\tt+1c1jTwfJDpAXRisXJv6YNQppGSsg4jgodlz531LP16od8Il0BRPzz6dc26hfloDa\n\tzgj3Y/bWfbrpdZL8o05N9f6ZJKl2iFrFn+eU7gG7bjT7DI16HAYKWreqlhj2MX3FQx\n\tL+4qepgcb9CXA==","Message-ID":"<6989922f-e3d9-7254-fea2-9f2a9ddaecec@lankhorst.se>","Date":"Fri, 9 Jun 2023 16:54:50 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tFirefox/102.0 Thunderbird/102.12.0","Content-Language":"en-US","To":"Cedric Nugteren <cedric@plumerai.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20230609143142.77049-1-web@cedricnugteren.nl>","In-Reply-To":"<20230609143142.77049-1-web@cedricnugteren.nl>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Maarten Lankhorst via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Maarten Lankhorst <dev@lankhorst.se>","Cc":"Cedric Nugteren <web@cedricnugteren.nl>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27345,"web_url":"https://patchwork.libcamera.org/comment/27345/","msgid":"<168678265755.3779969.9344936797644427979@Monstersaurus>","date":"2023-06-14T22:44:17","subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Cedric,\n\nThank you for taking this on.\n\nQuoting Cedric Nugteren via libcamera-devel (2023-06-09 15:31:42)\n> Cameras such as the PiCam 3 support auto-focus, but the GStreamer plugin\n> for libcamera does not enable auto-focus. With this patch auto-focus can\n> be enabled for cameras that support it. By default it is disabled, which\n> means default behaviour remains unchanged. For cameras that do not\n> support auto-focus, an error message shows up if auto-focus is enabled.\n> \n> This was tested on cameras that do not support auto-focus (e.g. PiCam2)\n> and was tested on a camera that does support auto-focus (PiCam3) by\n> setting it to AfModeContinous, observing auto-focus, and by setting it\n> to AfModeManual or by not setting the option, both resulting in\n> auto-focus being disabled.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=188.\n\nNo period required at the end of a link. I can remove that when we get\nto applying. I don't think we need another version of this patch.\n\n> Signed-off-by: Cedric Nugteren <web@cedricnugteren.nl>\n> ---\n> Changes since v1:\n> - Now re-using the GParamSpec variables instead of re-creating.\n> - Use bool instead of gboolean for enable_auto_focus.\n> - Remove changes from the reconfigure_element functions.\n> \n> Changes since v2:\n> - Fix a typo in the commit message (remove 'it').\n> - Fix the link to the actual bug.\n> - Apply the style suggestions of utils/checkstyle.py.\n> - Start the commit message with 'gstreamer:'.\n> - Change the boolean to a 3-option AfMode enum and change variable\n>   names and strings accordingly.\n> \n> ---\n>  src/gstreamer/gstlibcameraprovider.cpp | 14 ++++++++++++\n>  src/gstreamer/gstlibcamerasrc.cpp      | 30 ++++++++++++++++++++++++-\n>  src/gstreamer/gstlibcamerasrc.h        | 31 ++++++++++++++++++++++++++\n>  3 files changed, 74 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..aece3506 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -31,6 +31,7 @@ GST_DEBUG_CATEGORY_STATIC(provider_debug);\n>  \n>  enum {\n>         PROP_DEVICE_NAME = 1,\n> +       PROP_AUTO_FOCUS_MODE = 2,\n>  };\n>  \n>  #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()\n> @@ -40,6 +41,7 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,\n>  struct _GstLibcameraDevice {\n>         GstDevice parent;\n>         gchar *name;\n> +       int auto_focus_mode = libcamera::controls::AfModeManual;\n\nI think this could be an enum ... it would be controls::AfModeEnum ...\n\n\nI think we can also drop the libcamera:: namespace as we have a 'using\nnamespace libcamera;' statement in the file.\n\n\nDoing so here produces the following diff:\n\ndiff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\nindex aece3506653f..d92160460f91 100644\n--- a/src/gstreamer/gstlibcameraprovider.cpp\n+++ b/src/gstreamer/gstlibcameraprovider.cpp\n@@ -41,7 +41,7 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,\n struct _GstLibcameraDevice {\n \tGstDevice parent;\n \tgchar *name;\n-\tint auto_focus_mode = libcamera::controls::AfModeManual;\n+\tcontrols::AfModeEnum auto_focus_mode = controls::AfModeManual;\n };\n\n G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)\n@@ -86,7 +86,7 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,\n \t\tdevice->name = g_value_dup_string(value);\n \t\tbreak;\n \tcase PROP_AUTO_FOCUS_MODE:\n-\t\tdevice->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n+\t\tdevice->auto_focus_mode = static_cast<controls::AfModeEnum>(g_value_get_enum(value));\n \t\tbreak;\n \tdefault:\n \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n@@ -132,7 +132,7 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n \t\t\t\t  \"Available options: AfModeManual, \"\n \t\t\t\t  \"AfModeAuto or AfModeContinuous.\",\n \t\t\t\t  gst_libcamera_auto_focus_get_type(),\n-\t\t\t\t  static_cast<gint>(libcamera::controls::AfModeManual),\n+\t\t\t\t  static_cast<gint>(controls::AfModeManual),\n \t\t\t\t  G_PARAM_WRITABLE);\n \tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);\n }\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex cfb8f70c69b7..78e7422b337a 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -146,7 +146,7 @@ struct _GstLibcameraSrc {\n \tGstTask *task;\n\n \tgchar *camera_name;\n-\tint auto_focus_mode = libcamera::controls::AfModeManual;\n+\tcontrols::AfModeEnum auto_focus_mode = controls::AfModeManual;\n\n \tGstLibcameraSrcState *state;\n \tGstLibcameraAllocator *allocator;\n@@ -579,7 +579,7 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n \t\tgst_flow_combiner_add_pad(self->flow_combiner, srcpad);\n \t}\n\n-\tif (self->auto_focus_mode != libcamera::controls::AfModeManual) {\n+\tif (self->auto_focus_mode != controls::AfModeManual) {\n \t\tconst ControlInfoMap &infoMap = state->cam_->controls();\n \t\tif (infoMap.find(&controls::AfMode) != infoMap.end()) {\n \t\t\tstate->initControls_.set(controls::AfMode, self->auto_focus_mode);\n@@ -674,7 +674,7 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id,\n \t\tself->camera_name = g_value_dup_string(value);\n \t\tbreak;\n \tcase PROP_AUTO_FOCUS_MODE:\n-\t\tself->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n+\t\tself->auto_focus_mode = static_cast<controls::AfModeEnum>(g_value_get_enum(value));\n \t\tbreak;\n \tdefault:\n \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n@@ -869,7 +869,7 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n \t\t\t\t \"Available options: AfModeManual, \"\n \t\t\t\t \"AfModeAuto or AfModeContinuous.\",\n \t\t\t\t gst_libcamera_auto_focus_get_type(),\n-\t\t\t\t static_cast<gint>(libcamera::controls::AfModeManual),\n+\t\t\t\t static_cast<gint>(controls::AfModeManual),\n \t\t\t\t G_PARAM_WRITABLE);\n \tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec);\n }\n\n\n\n\nSome lines get longer, some get shorter ;-)\n\n\nAnyway, either with or without the above diff suggestion, it looks to me\nlike you've catered for all of Nicholas' previous review comments and I\ndon't have anything more than the diff above so:\n\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n>  };\n>  \n>  G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)\n> @@ -56,6 +58,7 @@ gst_libcamera_device_create_element(GstDevice *device, const gchar *name)\n>         g_assert(source);\n>  \n>         g_object_set(source, \"camera-name\", GST_LIBCAMERA_DEVICE(device)->name, nullptr);\n> +       g_object_set(source, \"auto-focus-mode\", GST_LIBCAMERA_DEVICE(device)->auto_focus_mode, nullptr);\n>  \n>         return source;\n>  }\n> @@ -82,6 +85,9 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,\n>         case PROP_DEVICE_NAME:\n>                 device->name = g_value_dup_string(value);\n>                 break;\n> +       case PROP_AUTO_FOCUS_MODE:\n> +               device->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +               break;\n>         default:\n>                 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>                 break;\n> @@ -121,6 +127,14 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>                                                 (GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |\n>                                                               G_PARAM_CONSTRUCT_ONLY));\n>         g_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec);\n> +       pspec = g_param_spec_enum(\"auto-focus-mode\",\n> +                                 \"Set auto-focus mode\",\n> +                                 \"Available options: AfModeManual, \"\n> +                                 \"AfModeAuto or AfModeContinuous.\",\n> +                                 gst_libcamera_auto_focus_get_type(),\n> +                                 static_cast<gint>(libcamera::controls::AfModeManual),\n> +                                 G_PARAM_WRITABLE);\n> +       g_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);\n>  }\n>  \n>  static GstDevice *\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..cfb8f70c 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -146,6 +146,7 @@ struct _GstLibcameraSrc {\n>         GstTask *task;\n>  \n>         gchar *camera_name;\n> +       int auto_focus_mode = libcamera::controls::AfModeManual;\n>  \n>         GstLibcameraSrcState *state;\n>         GstLibcameraAllocator *allocator;\n> @@ -154,7 +155,8 @@ struct _GstLibcameraSrc {\n>  \n>  enum {\n>         PROP_0,\n> -       PROP_CAMERA_NAME\n> +       PROP_CAMERA_NAME,\n> +       PROP_AUTO_FOCUS_MODE,\n>  };\n>  \n>  G_DEFINE_TYPE_WITH_CODE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT,\n> @@ -577,6 +579,18 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>                 gst_flow_combiner_add_pad(self->flow_combiner, srcpad);\n>         }\n>  \n> +       if (self->auto_focus_mode != libcamera::controls::AfModeManual) {\n> +               const ControlInfoMap &infoMap = state->cam_->controls();\n> +               if (infoMap.find(&controls::AfMode) != infoMap.end()) {\n> +                       state->initControls_.set(controls::AfMode, self->auto_focus_mode);\n> +               } else {\n> +                       GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> +                                         (\"Failed to enable auto focus\"),\n> +                                         (\"AfMode not supported by this camera, \"\n> +                                          \"please retry with 'auto-focus-mode=AfModeManual'\"));\n> +               }\n> +       }\n> +\n>         ret = state->cam_->start(&state->initControls_);\n>         if (ret) {\n>                 GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> @@ -659,6 +673,9 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id,\n>                 g_free(self->camera_name);\n>                 self->camera_name = g_value_dup_string(value);\n>                 break;\n> +       case PROP_AUTO_FOCUS_MODE:\n> +               self->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +               break;\n>         default:\n>                 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>                 break;\n> @@ -676,6 +693,9 @@ gst_libcamera_src_get_property(GObject *object, guint prop_id, GValue *value,\n>         case PROP_CAMERA_NAME:\n>                 g_value_set_string(value, self->camera_name);\n>                 break;\n> +       case PROP_AUTO_FOCUS_MODE:\n> +               g_value_set_enum(value, static_cast<gint>(self->auto_focus_mode));\n> +               break;\n>         default:\n>                 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>                 break;\n> @@ -844,4 +864,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n>                                                              | G_PARAM_READWRITE\n>                                                              | G_PARAM_STATIC_STRINGS));\n>         g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);\n> +       spec = g_param_spec_enum(\"auto-focus-mode\",\n> +                                \"Set auto-focus mode\",\n> +                                \"Available options: AfModeManual, \"\n> +                                \"AfModeAuto or AfModeContinuous.\",\n> +                                gst_libcamera_auto_focus_get_type(),\n> +                                static_cast<gint>(libcamera::controls::AfModeManual),\n> +                                G_PARAM_WRITABLE);\n> +       g_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec);\n>  }\n> diff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h\n> index fdea2f10..0a88ba02 100644\n> --- a/src/gstreamer/gstlibcamerasrc.h\n> +++ b/src/gstreamer/gstlibcamerasrc.h\n> @@ -8,6 +8,8 @@\n>  \n>  #pragma once\n>  \n> +#include <libcamera/control_ids.h>\n> +\n>  #include <gst/gst.h>\n>  \n>  G_BEGIN_DECLS\n> @@ -17,3 +19,32 @@ G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src,\n>                      GST_LIBCAMERA, SRC, GstElement)\n>  \n>  G_END_DECLS\n> +\n> +inline GType\n> +gst_libcamera_auto_focus_get_type()\n> +{\n> +       static GType type = 0;\n> +       static const GEnumValue values[] = {\n> +               {\n> +                       static_cast<gint>(libcamera::controls::AfModeManual),\n> +                       \"AfModeManual\",\n> +                       \"manual-focus\",\n> +               },\n> +               {\n> +                       static_cast<gint>(libcamera::controls::AfModeAuto),\n> +                       \"AfModeAuto\",\n> +                       \"automatic-auto-focus\",\n> +               },\n> +               {\n> +                       static_cast<gint>(libcamera::controls::AfModeContinuous),\n> +                       \"AfModeContinuous\",\n> +                       \"continuous-auto-focus\",\n> +               },\n> +               { 0, NULL, NULL }\n> +       };\n> +\n> +       if (!type)\n> +               type = g_enum_register_static(\"GstLibcameraAutoFocus\", values);\n> +\n> +       return type;\n> +}\n> -- \n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 55820C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jun 2023 22:44:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A0563628B6;\n\tThu, 15 Jun 2023 00:44:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 478C361E49\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Jun 2023 00:44:20 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 09954D20;\n\tThu, 15 Jun 2023 00:43:48 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686782662;\n\tbh=RmWWfNhOFGZPXnMyeHdD6bim14MNIpy8mkr25xgu0b0=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=mmdo3haVK+z4OXOdjCHR+15mU8nyBuW/jRx1CP2JkxFhyDz8FUVc6vbyTKKH6oWAp\n\taOMrxdNYi39dqyerXTNCu5vtfp43fTSLbx/mGRoqW0ybU/xjejl16j6ntEQt8ZrRnI\n\tYwjfbMaw3wwxcLXf/xvV7R52FxacUqxOg/+z9eeUfHSf0YrxeJRyf/e/l92dz5VTlA\n\tJa/14aV0cYeadlgOtKfRXejFO93fkQPWhzdnrW36WeVmFfQ4CMtmlIrnWJIxCiDI89\n\tMx52YmzCZN+oNJfPGXpocRkYyiXzY91/kXP8SV3JPZBSlC0WbIIAkLq+7b/t6aKyUB\n\trFgwlJyrxB3VQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1686782629;\n\tbh=RmWWfNhOFGZPXnMyeHdD6bim14MNIpy8mkr25xgu0b0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=PMsyCTnPbNuk1mIJInoZr2gj7g8BLAaVS4o9kwIDBdRPBI+Zf0/hekXMZ1o+Y7iTm\n\tyZ03fro07BaeWQyuc25b6KoJlGSN00bIjj1oIrdBeYWgnowZ+OROxUPpVaKq5jK0Pr\n\tSi9oBjoaAWG3fOfSykiF5Cwz5Iae17np9gsKKPcw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"PMsyCTnP\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230609143142.77049-1-web@cedricnugteren.nl>","References":"<20230609143142.77049-1-web@cedricnugteren.nl>","To":"Cedric Nugteren <cedric@plumerai.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 14 Jun 2023 23:44:17 +0100","Message-ID":"<168678265755.3779969.9344936797644427979@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Cedric Nugteren <web@cedricnugteren.nl>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27348,"web_url":"https://patchwork.libcamera.org/comment/27348/","msgid":"<8df4a171-f488-3069-6447-5d2d7bd782dd@ideasonboard.com>","date":"2023-06-15T07:23:36","subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Cedric\n\nOn 6/9/23 8:01 PM, Cedric Nugteren via libcamera-devel wrote:\n> Cameras such as the PiCam 3 support auto-focus, but the GStreamer plugin\n> for libcamera does not enable auto-focus. With this patch auto-focus can\n> be enabled for cameras that support it. By default it is disabled, which\n> means default behaviour remains unchanged. For cameras that do not\n> support auto-focus, an error message shows up if auto-focus is enabled.\n>\n> This was tested on cameras that do not support auto-focus (e.g. PiCam2)\n> and was tested on a camera that does support auto-focus (PiCam3) by\n> setting it to AfModeContinous, observing auto-focus, and by setting it\n> to AfModeManual or by not setting the option, both resulting in\n> auto-focus being disabled.\n\nThis is a very long sentence - probably worth splitting it out.\n\n```\nThis was tested on cameras that do not support auto-focus (e.g. PiCam2)\nand was tested on a camera that does support auto-focus (PiCam3). The\ntest involved setting the focus to AfModeContinous and observing it.\nHowever, by not setting \"auto-focus-mode\" or using AfModeManual as\nthe \"auto-focus-mode\" both resulting in auto-focus being disabled.\n```\n>\n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=188.\n>\n> Signed-off-by: Cedric Nugteren <web@cedricnugteren.nl>\n> ---\n> Changes since v1:\n> - Now re-using the GParamSpec variables instead of re-creating.\n> - Use bool instead of gboolean for enable_auto_focus.\n> - Remove changes from the reconfigure_element functions.\n>\n> Changes since v2:\n> - Fix a typo in the commit message (remove 'it').\n> - Fix the link to the actual bug.\n> - Apply the style suggestions of utils/checkstyle.py.\n> - Start the commit message with 'gstreamer:'.\n> - Change the boolean to a 3-option AfMode enum and change variable\n>    names and strings accordingly.\n>\n> ---\n>   src/gstreamer/gstlibcameraprovider.cpp | 14 ++++++++++++\n>   src/gstreamer/gstlibcamerasrc.cpp      | 30 ++++++++++++++++++++++++-\n>   src/gstreamer/gstlibcamerasrc.h        | 31 ++++++++++++++++++++++++++\n>   3 files changed, 74 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..aece3506 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -31,6 +31,7 @@ GST_DEBUG_CATEGORY_STATIC(provider_debug);\n>   \n>   enum {\n>   \tPROP_DEVICE_NAME = 1,\n> +\tPROP_AUTO_FOCUS_MODE = 2,\n>   };\n>   \n>   #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()\n> @@ -40,6 +41,7 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,\n>   struct _GstLibcameraDevice {\n>   \tGstDevice parent;\n>   \tgchar *name;\n> +\tint auto_focus_mode = libcamera::controls::AfModeManual;\n\nProbably enums as Kieran pointed out.\n>   };\n>   \n>   G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)\n> @@ -56,6 +58,7 @@ gst_libcamera_device_create_element(GstDevice *device, const gchar *name)\n>   \tg_assert(source);\n>   \n>   \tg_object_set(source, \"camera-name\", GST_LIBCAMERA_DEVICE(device)->name, nullptr);\n> +\tg_object_set(source, \"auto-focus-mode\", GST_LIBCAMERA_DEVICE(device)->auto_focus_mode, nullptr);\n>   \n>   \treturn source;\n>   }\n> @@ -82,6 +85,9 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,\n>   \tcase PROP_DEVICE_NAME:\n>   \t\tdevice->name = g_value_dup_string(value);\n>   \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tdevice->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +\t\tbreak;\n>   \tdefault:\n>   \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>   \t\tbreak;\n> @@ -121,6 +127,14 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>   \t\t\t\t\t\t(GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |\n>   \t\t\t\t\t\t\t      G_PARAM_CONSTRUCT_ONLY));\n>   \tg_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec);\n> +\tpspec = g_param_spec_enum(\"auto-focus-mode\",\n> +\t\t\t\t  \"Set auto-focus mode\",\n> +\t\t\t\t  \"Available options: AfModeManual, \"\n> +\t\t\t\t  \"AfModeAuto or AfModeContinuous.\",\n> +\t\t\t\t  gst_libcamera_auto_focus_get_type(),\n> +\t\t\t\t  static_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\t  G_PARAM_WRITABLE);\n> +\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);\n>   }\n>   \n>   static GstDevice *\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..cfb8f70c 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -146,6 +146,7 @@ struct _GstLibcameraSrc {\n>   \tGstTask *task;\n>   \n>   \tgchar *camera_name;\n> +\tint auto_focus_mode = libcamera::controls::AfModeManual;\n>   \n>   \tGstLibcameraSrcState *state;\n>   \tGstLibcameraAllocator *allocator;\n> @@ -154,7 +155,8 @@ struct _GstLibcameraSrc {\n>   \n>   enum {\n>   \tPROP_0,\n> -\tPROP_CAMERA_NAME\n> +\tPROP_CAMERA_NAME,\n> +\tPROP_AUTO_FOCUS_MODE,\n>   };\n>   \n>   G_DEFINE_TYPE_WITH_CODE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT,\n> @@ -577,6 +579,18 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>   \t\tgst_flow_combiner_add_pad(self->flow_combiner, srcpad);\n>   \t}\n>   \n> +\tif (self->auto_focus_mode != libcamera::controls::AfModeManual) {\n> +\t\tconst ControlInfoMap &infoMap = state->cam_->controls();\n> +\t\tif (infoMap.find(&controls::AfMode) != infoMap.end()) {\n> +\t\t\tstate->initControls_.set(controls::AfMode, self->auto_focus_mode);\n> +\t\t} else {\n> +\t\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> +\t\t\t\t\t  (\"Failed to enable auto focus\"),\n> +\t\t\t\t\t  (\"AfMode not supported by this camera, \"\n> +\t\t\t\t\t   \"please retry with 'auto-focus-mode=AfModeManual'\"));\n> +\t\t}\n> +\t}\n> +\n>   \tret = state->cam_->start(&state->initControls_);\n>   \tif (ret) {\n>   \t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> @@ -659,6 +673,9 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id,\n>   \t\tg_free(self->camera_name);\n>   \t\tself->camera_name = g_value_dup_string(value);\n>   \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tself->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +\t\tbreak;\n>   \tdefault:\n>   \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>   \t\tbreak;\n> @@ -676,6 +693,9 @@ gst_libcamera_src_get_property(GObject *object, guint prop_id, GValue *value,\n>   \tcase PROP_CAMERA_NAME:\n>   \t\tg_value_set_string(value, self->camera_name);\n>   \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tg_value_set_enum(value, static_cast<gint>(self->auto_focus_mode));\n> +\t\tbreak;\n>   \tdefault:\n>   \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>   \t\tbreak;\n> @@ -844,4 +864,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n>   \t\t\t\t\t\t\t     | G_PARAM_READWRITE\n>   \t\t\t\t\t\t\t     | G_PARAM_STATIC_STRINGS));\n>   \tg_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);\n> +\tspec = g_param_spec_enum(\"auto-focus-mode\",\n\nnew line ?\n\nRest looks good to me:\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> +\t\t\t\t \"Set auto-focus mode\",\n> +\t\t\t\t \"Available options: AfModeManual, \"\n> +\t\t\t\t \"AfModeAuto or AfModeContinuous.\",\n> +\t\t\t\t gst_libcamera_auto_focus_get_type(),\n> +\t\t\t\t static_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\t G_PARAM_WRITABLE);\n> +\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec);\n>   }\n> diff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h\n> index fdea2f10..0a88ba02 100644\n> --- a/src/gstreamer/gstlibcamerasrc.h\n> +++ b/src/gstreamer/gstlibcamerasrc.h\n> @@ -8,6 +8,8 @@\n>   \n>   #pragma once\n>   \n> +#include <libcamera/control_ids.h>\n> +\n>   #include <gst/gst.h>\n>   \n>   G_BEGIN_DECLS\n> @@ -17,3 +19,32 @@ G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src,\n>   \t\t     GST_LIBCAMERA, SRC, GstElement)\n>   \n>   G_END_DECLS\n> +\n> +inline GType\n> +gst_libcamera_auto_focus_get_type()\n> +{\n> +\tstatic GType type = 0;\n> +\tstatic const GEnumValue values[] = {\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\"AfModeManual\",\n> +\t\t\t\"manual-focus\",\n> +\t\t},\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeAuto),\n> +\t\t\t\"AfModeAuto\",\n> +\t\t\t\"automatic-auto-focus\",\n> +\t\t},\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeContinuous),\n> +\t\t\t\"AfModeContinuous\",\n> +\t\t\t\"continuous-auto-focus\",\n> +\t\t},\n> +\t\t{ 0, NULL, NULL }\n> +\t};\n> +\n> +\tif (!type)\n> +\t\ttype = g_enum_register_static(\"GstLibcameraAutoFocus\", values);\n> +\n> +\treturn type;\n> +}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9C3DDC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Jun 2023 07:23:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5795F61E4D;\n\tThu, 15 Jun 2023 09:23:44 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1121E61E4D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Jun 2023 09:23:42 +0200 (CEST)","from [192.168.1.108] (unknown [103.86.18.143])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 16822891;\n\tThu, 15 Jun 2023 09:23:09 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686813824;\n\tbh=bNUmIbWnOZCEGKWn/ofZDH8+oyCmNUb8hwNnLWIqPr4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=DY6UxKgxxpXt6o1NGjwb1stdZXuNu+bUS7RMqL/CrnfUm0VpQNJ3MIW0/kyNOjItR\n\tu99QtKzwN4pdgg/BrqA9yF3A7gzGMncH/w3Ffyzx3Z8pPZtnhW9zBugUSv5NbcpeJx\n\tvDX6mMOG+Y6hHJMXzXv7fqSorMNo9q/YPshhwo0RJbFfsYJRRaS1KvNJrXtiQBtkcf\n\tvEXgoStYIoCCabVAjJp+IdkDLN9gBaC0urgaQboUDU4r32hmAnOqOJMF0ynAa8uYkn\n\t6n96kq8kKnUiRfUDIOIury44rUWaDy3f0etb+ZdSw2G9RU3w+VIZKD6PuKey2UTfM1\n\toNix0FwMwbl3A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1686813790;\n\tbh=bNUmIbWnOZCEGKWn/ofZDH8+oyCmNUb8hwNnLWIqPr4=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=TYmwGCrMe+wVZ1Gd1dw7G5tzfGS7eM97rwGOnWDUGC7OYObdpQNdHRMcbgnBgazzl\n\t1sZqAZlgUtWS8eM0MltCb74+mM/bYyU4g2UJZTq6KQ9T7bmc9uX0Dvwg7wtynquI53\n\twEyibR32qr3pJPXSn+J7LJvg55np6RgUb8a5X5p0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TYmwGCrM\"; dkim-atps=neutral","Message-ID":"<8df4a171-f488-3069-6447-5d2d7bd782dd@ideasonboard.com>","Date":"Thu, 15 Jun 2023 12:53:36 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.7.1","To":"Cedric Nugteren <cedric@plumerai.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20230609143142.77049-1-web@cedricnugteren.nl>","Content-Language":"en-US","In-Reply-To":"<20230609143142.77049-1-web@cedricnugteren.nl>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"Cedric Nugteren <web@cedricnugteren.nl>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27358,"web_url":"https://patchwork.libcamera.org/comment/27358/","msgid":"<927eb3ca-22fc-d9d2-a3df-41634ad3d0fb@ideasonboard.com>","date":"2023-06-15T17:57:37","subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi,\n\nOn 6/9/23 8:01 PM, Cedric Nugteren via libcamera-devel wrote:\n> Cameras such as the PiCam 3 support auto-focus, but the GStreamer plugin\n> for libcamera does not enable auto-focus. With this patch auto-focus can\n> be enabled for cameras that support it. By default it is disabled, which\n> means default behaviour remains unchanged. For cameras that do not\n> support auto-focus, an error message shows up if auto-focus is enabled.\n>\n> This was tested on cameras that do not support auto-focus (e.g. PiCam2)\n> and was tested on a camera that does support auto-focus (PiCam3) by\n> setting it to AfModeContinous, observing auto-focus, and by setting it\n> to AfModeManual or by not setting the option, both resulting in\n> auto-focus being disabled.\n>\n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=188.\n>\n> Signed-off-by: Cedric Nugteren <web@cedricnugteren.nl>\n\n  I have tested it as well on raspberrypi Pi with PDAF supported IMX519.\n\nSo I think the plumbing is correct and just needs to address the comments.\n\nTested-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n> Changes since v1:\n> - Now re-using the GParamSpec variables instead of re-creating.\n> - Use bool instead of gboolean for enable_auto_focus.\n> - Remove changes from the reconfigure_element functions.\n>\n> Changes since v2:\n> - Fix a typo in the commit message (remove 'it').\n> - Fix the link to the actual bug.\n> - Apply the style suggestions of utils/checkstyle.py.\n> - Start the commit message with 'gstreamer:'.\n> - Change the boolean to a 3-option AfMode enum and change variable\n>    names and strings accordingly.\n>\n> ---\n>   src/gstreamer/gstlibcameraprovider.cpp | 14 ++++++++++++\n>   src/gstreamer/gstlibcamerasrc.cpp      | 30 ++++++++++++++++++++++++-\n>   src/gstreamer/gstlibcamerasrc.h        | 31 ++++++++++++++++++++++++++\n>   3 files changed, 74 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 6eb0a0eb..aece3506 100644\n> --- a/src/gstreamer/gstlibcameraprovider.cpp\n> +++ b/src/gstreamer/gstlibcameraprovider.cpp\n> @@ -31,6 +31,7 @@ GST_DEBUG_CATEGORY_STATIC(provider_debug);\n>   \n>   enum {\n>   \tPROP_DEVICE_NAME = 1,\n> +\tPROP_AUTO_FOCUS_MODE = 2,\n>   };\n>   \n>   #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()\n> @@ -40,6 +41,7 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,\n>   struct _GstLibcameraDevice {\n>   \tGstDevice parent;\n>   \tgchar *name;\n> +\tint auto_focus_mode = libcamera::controls::AfModeManual;\n>   };\n>   \n>   G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)\n> @@ -56,6 +58,7 @@ gst_libcamera_device_create_element(GstDevice *device, const gchar *name)\n>   \tg_assert(source);\n>   \n>   \tg_object_set(source, \"camera-name\", GST_LIBCAMERA_DEVICE(device)->name, nullptr);\n> +\tg_object_set(source, \"auto-focus-mode\", GST_LIBCAMERA_DEVICE(device)->auto_focus_mode, nullptr);\n>   \n>   \treturn source;\n>   }\n> @@ -82,6 +85,9 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,\n>   \tcase PROP_DEVICE_NAME:\n>   \t\tdevice->name = g_value_dup_string(value);\n>   \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tdevice->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +\t\tbreak;\n>   \tdefault:\n>   \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>   \t\tbreak;\n> @@ -121,6 +127,14 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)\n>   \t\t\t\t\t\t(GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |\n>   \t\t\t\t\t\t\t      G_PARAM_CONSTRUCT_ONLY));\n>   \tg_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec);\n> +\tpspec = g_param_spec_enum(\"auto-focus-mode\",\n> +\t\t\t\t  \"Set auto-focus mode\",\n> +\t\t\t\t  \"Available options: AfModeManual, \"\n> +\t\t\t\t  \"AfModeAuto or AfModeContinuous.\",\n> +\t\t\t\t  gst_libcamera_auto_focus_get_type(),\n> +\t\t\t\t  static_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\t  G_PARAM_WRITABLE);\n> +\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);\n>   }\n>   \n>   static GstDevice *\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index a10cbd4f..cfb8f70c 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -146,6 +146,7 @@ struct _GstLibcameraSrc {\n>   \tGstTask *task;\n>   \n>   \tgchar *camera_name;\n> +\tint auto_focus_mode = libcamera::controls::AfModeManual;\n>   \n>   \tGstLibcameraSrcState *state;\n>   \tGstLibcameraAllocator *allocator;\n> @@ -154,7 +155,8 @@ struct _GstLibcameraSrc {\n>   \n>   enum {\n>   \tPROP_0,\n> -\tPROP_CAMERA_NAME\n> +\tPROP_CAMERA_NAME,\n> +\tPROP_AUTO_FOCUS_MODE,\n>   };\n>   \n>   G_DEFINE_TYPE_WITH_CODE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT,\n> @@ -577,6 +579,18 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>   \t\tgst_flow_combiner_add_pad(self->flow_combiner, srcpad);\n>   \t}\n>   \n> +\tif (self->auto_focus_mode != libcamera::controls::AfModeManual) {\n> +\t\tconst ControlInfoMap &infoMap = state->cam_->controls();\n> +\t\tif (infoMap.find(&controls::AfMode) != infoMap.end()) {\n> +\t\t\tstate->initControls_.set(controls::AfMode, self->auto_focus_mode);\n> +\t\t} else {\n> +\t\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> +\t\t\t\t\t  (\"Failed to enable auto focus\"),\n> +\t\t\t\t\t  (\"AfMode not supported by this camera, \"\n> +\t\t\t\t\t   \"please retry with 'auto-focus-mode=AfModeManual'\"));\n> +\t\t}\n> +\t}\n> +\n>   \tret = state->cam_->start(&state->initControls_);\n>   \tif (ret) {\n>   \t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> @@ -659,6 +673,9 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id,\n>   \t\tg_free(self->camera_name);\n>   \t\tself->camera_name = g_value_dup_string(value);\n>   \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tself->auto_focus_mode = static_cast<int>(g_value_get_enum(value));\n> +\t\tbreak;\n>   \tdefault:\n>   \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>   \t\tbreak;\n> @@ -676,6 +693,9 @@ gst_libcamera_src_get_property(GObject *object, guint prop_id, GValue *value,\n>   \tcase PROP_CAMERA_NAME:\n>   \t\tg_value_set_string(value, self->camera_name);\n>   \t\tbreak;\n> +\tcase PROP_AUTO_FOCUS_MODE:\n> +\t\tg_value_set_enum(value, static_cast<gint>(self->auto_focus_mode));\n> +\t\tbreak;\n>   \tdefault:\n>   \t\tG_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);\n>   \t\tbreak;\n> @@ -844,4 +864,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n>   \t\t\t\t\t\t\t     | G_PARAM_READWRITE\n>   \t\t\t\t\t\t\t     | G_PARAM_STATIC_STRINGS));\n>   \tg_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);\n> +\tspec = g_param_spec_enum(\"auto-focus-mode\",\n> +\t\t\t\t \"Set auto-focus mode\",\n> +\t\t\t\t \"Available options: AfModeManual, \"\n> +\t\t\t\t \"AfModeAuto or AfModeContinuous.\",\n> +\t\t\t\t gst_libcamera_auto_focus_get_type(),\n> +\t\t\t\t static_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\t G_PARAM_WRITABLE);\n> +\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec);\n>   }\n> diff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h\n> index fdea2f10..0a88ba02 100644\n> --- a/src/gstreamer/gstlibcamerasrc.h\n> +++ b/src/gstreamer/gstlibcamerasrc.h\n> @@ -8,6 +8,8 @@\n>   \n>   #pragma once\n>   \n> +#include <libcamera/control_ids.h>\n> +\n>   #include <gst/gst.h>\n>   \n>   G_BEGIN_DECLS\n> @@ -17,3 +19,32 @@ G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src,\n>   \t\t     GST_LIBCAMERA, SRC, GstElement)\n>   \n>   G_END_DECLS\n> +\n> +inline GType\n> +gst_libcamera_auto_focus_get_type()\n> +{\n> +\tstatic GType type = 0;\n> +\tstatic const GEnumValue values[] = {\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeManual),\n> +\t\t\t\"AfModeManual\",\n> +\t\t\t\"manual-focus\",\n> +\t\t},\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeAuto),\n> +\t\t\t\"AfModeAuto\",\n> +\t\t\t\"automatic-auto-focus\",\n> +\t\t},\n> +\t\t{\n> +\t\t\tstatic_cast<gint>(libcamera::controls::AfModeContinuous),\n> +\t\t\t\"AfModeContinuous\",\n> +\t\t\t\"continuous-auto-focus\",\n> +\t\t},\n> +\t\t{ 0, NULL, NULL }\n> +\t};\n> +\n> +\tif (!type)\n> +\t\ttype = g_enum_register_static(\"GstLibcameraAutoFocus\", values);\n> +\n> +\treturn type;\n> +}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id ED42FBD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Jun 2023 17:57:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D55A61E4F;\n\tThu, 15 Jun 2023 19:57:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2FF88614FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Jun 2023 19:57:44 +0200 (CEST)","from [192.168.1.108] (unknown [103.251.226.67])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5549F547;\n\tThu, 15 Jun 2023 19:57:11 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686851865;\n\tbh=TeFHQn4iq0dd2TvtSuLD504zf0KN0fSqmqNj9TK/ePw=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Nj5U+NA3gbr6cwZTnW38PpISxMUq94HDE6xqnjc4NViS3WAlQaDUJzkFQ5aJ4gpe7\n\tIzTr4/SIRMiLs2uBs5aBYH/1xrcNUkLPPo2fhqxRBx7ouUKEy/JMqbj/693pxgNMW2\n\tCFySpVvQBeqD5qLN6P00FXfiPtQxmGrWGDsFJDUxf+gD/TOVudZzwgbdQqpDXINBjq\n\t6OMOcf3VnALoSWVdUQxC5a46q6vpiHefvAoLTTiEfioxZyovVRwu2m+imwUcg4ozuz\n\tGGArNmRPM9BunJ0DuMudniBrlWH2GesTTuWSmqF+WFPkXOZX9Jozy54HgExx7uY3NW\n\t29dobU/UeXltg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1686851832;\n\tbh=TeFHQn4iq0dd2TvtSuLD504zf0KN0fSqmqNj9TK/ePw=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=a/Bmy+QbY4LQk8+uzhce00bQuXq2ZiR6lNQkfYkfFgfoCFnXnXQzK4Ylx6BOuaRhH\n\tNo0viJGsZgvyDc62Vrv4aiegEVn78g9XI/lIdXe6dzxSOTlQVy0dc9+5VdoYATECGV\n\tYZPNxCxGdCLd4oWJPKMLgf1/h8HJcw0CWXEFLgCU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"a/Bmy+Qb\"; dkim-atps=neutral","Message-ID":"<927eb3ca-22fc-d9d2-a3df-41634ad3d0fb@ideasonboard.com>","Date":"Thu, 15 Jun 2023 23:27:37 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.7.1","Content-Language":"en-US","To":"Cedric Nugteren <cedric@plumerai.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20230609143142.77049-1-web@cedricnugteren.nl>","In-Reply-To":"<20230609143142.77049-1-web@cedricnugteren.nl>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v3] gstreamer: Add enable_auto_focus\n\toption to the GStreamer plugin","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"Cedric Nugteren <web@cedricnugteren.nl>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]