[{"id":30848,"web_url":"https://patchwork.libcamera.org/comment/30848/","msgid":"<20240815225744.GD23911@pendragon.ideasonboard.com>","date":"2024-08-15T22:57:44","subject":"Re: [PATCH v2 2/3] gstreamer: Remove auto-focus-mode property from\n\tlibcamerasrc","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jaslo,\n\nThank you for the patch.\n\nOn Tue, Aug 13, 2024 at 02:25:06PM +0200, Jaslo Ziska wrote:\n> In preparation for generic support of all libcamera controls, remove the\n> manual handling of the auto-focus-mode property from the libcamerasrc\n> element.\n> \n> Signed-off-by: Jaslo Ziska <jaslo@ziska.de>\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 28 ----------------------------\n>  1 file changed, 28 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 912a8d55..40b787c8 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -142,7 +142,6 @@ struct _GstLibcameraSrc {\n>  \tGstTask *task;\n>  \n>  \tgchar *camera_name;\n> -\tcontrols::AfModeEnum auto_focus_mode = controls::AfModeManual;\n>  \n>  \tstd::atomic<GstEvent *> pending_eos;\n>  \n> @@ -154,7 +153,6 @@ struct _GstLibcameraSrc {\n>  enum {\n>  \tPROP_0,\n>  \tPROP_CAMERA_NAME,\n> -\tPROP_AUTO_FOCUS_MODE,\n>  };\n>  \n>  static void gst_libcamera_src_child_proxy_init(gpointer g_iface,\n> @@ -663,18 +661,6 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>  \t\tgst_pad_push_event(srcpad, gst_event_new_segment(&segment));\n>  \t}\n>  \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> -\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> @@ -742,9 +728,6 @@ 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<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>  \t\tbreak;\n> @@ -762,9 +745,6 @@ 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> @@ -967,14 +947,6 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\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>  \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>(controls::AfModeManual),\n> -\t\t\t\t G_PARAM_WRITABLE);\n> -\tg_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec);\n\nYou should also drop gst_libcamera_auto_focus_get_type() from\nsrc/gstreamer/gstlibcamerasrc.h (and drop the libcamera/control_ids.h\ninclude from there). With that,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  }\n>  \n>  /* GstChildProxy implementation */","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 8D617BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Aug 2024 22:58:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5BCFA633B3;\n\tFri, 16 Aug 2024 00:58:14 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C75B63369\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Aug 2024 00:58:12 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 90CD2471;\n\tFri, 16 Aug 2024 00:57:13 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kvEf+OVk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723762633;\n\tbh=mGzzOJP0q5O4bAuMHV3ABKzu1/ksFmTDw1LXvYw3pDg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=kvEf+OVky/QBBXNJkaNIol6kzdzaQ3C01YifNbL3WQkwlz923JXGz8G3TXKITrBsr\n\tegv4eXwcxmAkwS/XEQdSVdSNBrUre5NjST9HQJJh/OiNsSLRoOmcfwWBwGq71rOWUg\n\t1b7X2CQThItEuhwVBdTLmHF3vhGBiBlpEZddD2SQ=","Date":"Fri, 16 Aug 2024 01:57:44 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jaslo Ziska <jaslo@ziska.de>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 2/3] gstreamer: Remove auto-focus-mode property from\n\tlibcamerasrc","Message-ID":"<20240815225744.GD23911@pendragon.ideasonboard.com>","References":"<20240813124722.22425-1-jaslo@ziska.de>\n\t<20240813124722.22425-3-jaslo@ziska.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240813124722.22425-3-jaslo@ziska.de>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]