From patchwork Tue Aug 13 12:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaslo Ziska X-Patchwork-Id: 20902 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 26E23BDB13 for ; Tue, 13 Aug 2024 12:48:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C0BF8633BE; Tue, 13 Aug 2024 14:48:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ziska.de header.i=@ziska.de header.b="h7ZZevGZ"; dkim=permerror (0-bit key) header.d=ziska.de header.i=@ziska.de header.b="CDLsz2KX"; dkim-atps=neutral Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.25]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 20FE163398 for ; Tue, 13 Aug 2024 14:48:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1723553305; cv=none; d=strato.com; s=strato-dkim-0002; b=gU7iXpTS/HY1EUNs7l+LrxFIKAhDe7HUf7q3zWZ0aIVMx8X1k2LRpZu2kA2SE3RIZw UW7hK3aNdcYbK9laGpaGD6rOgLYlfB9CduoV+jikOaFWHlH8LT6uL6QKm2POzWSs/9rn /jX7toC02+d7L46IKTZssESLOBJc1cibVHDI9DqhyTAdwSckmoxNyVjk6s2OuGHXaxqW L2qRej0y3F9ZhSbQ7lsz+8gps8VvNAsrtI2C/kjvt5SpVXiosNAjgqse7pKsfU0d3CFy zkCZytrleworxz1+JQpqNv5RGs1L/jzTjteX6J6E+yGz2nhDDThR4unp0wuKzkJAwgqx AzBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1723553305; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=zKfcHKf1QOPVdTHjg/UZOZmZ8CNKYu49n+dkOWwLGSw=; b=IdQs61lEYfkaiVVGKT36+avLL1ipvAB7BTY/V1eSVcikJJwHUUdvzkdvJjepwSWcu1 RXk6cZSV4TFAWp3j7t4eyWOHLUadyO7V2xRp6EJ0GKw219y6WiN0mkSxxgzk6a6Capdi W6LOPjAyuKbv571P7J4HdUsk6xBxZml9vGCT8RgPYkV/KNRVKP8dAkyIJ5n5Afb5N5vO lQ7X0K4QGcPzsyKqYvle3xljn508RStnbcoqLEA5+EgGU6Hc0KYjfTB3JZrsbMeX8ZLM kKAjOQ1UfSWRU4QPHLDb/myhgaBi3nxgcNZ5TDVz2vv82fSD16y4+4EHT/kH+APeo1eW UxYA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1723553305; s=strato-dkim-0002; d=ziska.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=zKfcHKf1QOPVdTHjg/UZOZmZ8CNKYu49n+dkOWwLGSw=; b=h7ZZevGZW6vfz3JHGcLHCYRKLZ1tZvdYHkBJKnM610mvDrzGkrJl/N2wl5gS4jzdI0 AdQZGKkzcpsdjUnpa/Mnqrfy6Ug7vXh8EAPGz6Ug8Epd4kKjXmyw/Y5THDLYIhJ4ox4r Wqa/TKLppqA+ZN/KsHOxvdzR3d/SsS4cZNTMx/R9nFQLErEq6NB6MLufPiWKN9tYQAJF pCnbQqwSZZb2Mt+YLujTNRp4aFSwYoEezJoR8TO8uLUakkpogBQO1TjnYnxq0T8nyTjb DkRtwzjsUPdmAWKTJjxPU/7H+anxpYeTJ8x//E8F2DklopZZsKh8NtVyYFIgP0XPhStV cuDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1723553305; s=strato-dkim-0003; d=ziska.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=zKfcHKf1QOPVdTHjg/UZOZmZ8CNKYu49n+dkOWwLGSw=; b=CDLsz2KXDLcRJI5FJSF9ZOzroPnWnb1aEuO5Ip4NaroCyFp8nRKPXOulwVCNcI62Ys JRG8p0FS4dgCSFYUS/BQ== X-RZG-AUTH: ":Jm0XeU+IYfb0x77LHmrjN5Wlb7TBwusDqIM6Hizy8VdfzvKi4yoFC9cGhoqwVPJQb1HfVSED9d9Z5psVXjkhV67rRpA=" Received: from archlinux.fritz.box by smtp.strato.de (RZmta 51.1.0 AUTH) with ESMTPSA id zb9f0a07DCmPU7i (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 13 Aug 2024 14:48:25 +0200 (CEST) From: Jaslo Ziska To: libcamera-devel@lists.libcamera.org Cc: Jaslo Ziska Subject: [PATCH v2 2/3] gstreamer: Remove auto-focus-mode property from libcamerasrc Date: Tue, 13 Aug 2024 14:25:06 +0200 Message-ID: <20240813124722.22425-3-jaslo@ziska.de> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240813124722.22425-1-jaslo@ziska.de> References: <20240813124722.22425-1-jaslo@ziska.de> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" In preparation for generic support of all libcamera controls, remove the manual handling of the auto-focus-mode property from the libcamerasrc element. Signed-off-by: Jaslo Ziska Reviewed-by: Laurent Pinchart --- src/gstreamer/gstlibcamerasrc.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 912a8d55..40b787c8 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -142,7 +142,6 @@ struct _GstLibcameraSrc { GstTask *task; gchar *camera_name; - controls::AfModeEnum auto_focus_mode = controls::AfModeManual; std::atomic pending_eos; @@ -154,7 +153,6 @@ struct _GstLibcameraSrc { enum { PROP_0, PROP_CAMERA_NAME, - PROP_AUTO_FOCUS_MODE, }; static void gst_libcamera_src_child_proxy_init(gpointer g_iface, @@ -663,18 +661,6 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread, gst_pad_push_event(srcpad, gst_event_new_segment(&segment)); } - if (self->auto_focus_mode != controls::AfModeManual) { - const ControlInfoMap &infoMap = state->cam_->controls(); - if (infoMap.find(&controls::AfMode) != infoMap.end()) { - state->initControls_.set(controls::AfMode, self->auto_focus_mode); - } else { - GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS, - ("Failed to enable auto focus"), - ("AfMode not supported by this camera, " - "please retry with 'auto-focus-mode=AfModeManual'")); - } - } - ret = state->cam_->start(&state->initControls_); if (ret) { GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS, @@ -742,9 +728,6 @@ gst_libcamera_src_set_property(GObject *object, guint prop_id, g_free(self->camera_name); self->camera_name = g_value_dup_string(value); break; - case PROP_AUTO_FOCUS_MODE: - self->auto_focus_mode = static_cast(g_value_get_enum(value)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -762,9 +745,6 @@ gst_libcamera_src_get_property(GObject *object, guint prop_id, GValue *value, case PROP_CAMERA_NAME: g_value_set_string(value, self->camera_name); break; - case PROP_AUTO_FOCUS_MODE: - g_value_set_enum(value, static_cast(self->auto_focus_mode)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -967,14 +947,6 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass) | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec); - spec = g_param_spec_enum("auto-focus-mode", - "Set auto-focus mode", - "Available options: AfModeManual, " - "AfModeAuto or AfModeContinuous.", - gst_libcamera_auto_focus_get_type(), - static_cast(controls::AfModeManual), - G_PARAM_WRITABLE); - g_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, spec); } /* GstChildProxy implementation */