From patchwork Thu Oct 17 17:04:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaslo Ziska X-Patchwork-Id: 21661 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 A6797C32FC for ; Thu, 17 Oct 2024 17:24:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 427BD65383; Thu, 17 Oct 2024 19:24:31 +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="TtQBYMzt"; dkim=permerror (0-bit key) header.d=ziska.de header.i=@ziska.de header.b="DgEk5foa"; dkim-atps=neutral Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.221]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 53D1065383 for ; Thu, 17 Oct 2024 19:24:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1729185866; cv=none; d=strato.com; s=strato-dkim-0002; b=n+Rgxl3VKZnUc1vpED35xWeAvkWvwZtqWoxM5oceEjodPII0cXHHQOtSHLusBVJ/C4 KP9Cij8qzytffci/24caRieZQgPFZZT9T3xBwdywmGzA/KZvUHcGVk2RP8WWkhquzRIY uohR9fkK4urqxOBQho5bXfrhkBfifo1SsdNs5KRoObLEn0/TYXYn1QurmXCSrp9+swdh jr2Zh17v4V5WNARz2Cn+ETrjFF4O8uBsv1bLSDZ3zBIPeTJ5jnyT3/ARFV1pKtvL3wVa fTVOvsKb8OfHZZQvIjMd9g3Jhl03x5IG5arlwGDA3EHokALAQGJoA6pbk0qrEIUUql24 Y4Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1729185866; 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=ZKf/n02rjzMepGpSkuuXmnPJ1Dn+plIEKRrTMDtLW3A=; b=P+uN531fiEd17K5ujB6YetOcAG5B2QFM0B+LErvkahwDSs6gcqyaBnMVzZRvGxh++b pDAko+4VnLIe4jts62EJjjBCCsosKSufTEXFWhN8XJZg1spQ+PND85fgqNfsnx1vcInw 7L3E9Hh45daq/oivo7Ak6097YXOfRUMxVQLLOCgIfWKV8UBHMAWV0sDzWswqgESCG0iP NbwZhtOirjcOfSakKdp0cBIETweUASBOxhep8DI/Vjaq6THdJfJowAaOEdoIVgszjCwx H3ZWjpz14lTI17TrER6rqwsPepnROEegPfxUCo92nKWqoMtjM7PeQ8dYcoe/XrzReXEO RV6w== 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=1729185866; 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=ZKf/n02rjzMepGpSkuuXmnPJ1Dn+plIEKRrTMDtLW3A=; b=TtQBYMztX42SObr45b11YmDhfam6h7uaTd6h2d/2h7n7igLTJOTp2i/5UYnroQ+AJH 5sFMIAAST5LZUJOBUOjLo3Gq65037He3ZnRzyiNziP5Lb8fQbnbTxRugaqSVW6guLVWR 8WsjUq7Boycr9WjjU5nNV5fsQCPGNU6ELaLeg15xmJeb3rZUFZQVZ9ra2riZ7ZSNEwsd 9h+qvieuigm/zd0kfOP7Q1TabvYUA/reKJRRyWiDFw2I//IIbTK+bOxCPR4CKVGgQA9S KYQ7u+zcOSivrCxtJFHV8doOoYwCqGwhyIWP/uZfJMVBIiTguasrhJNrFiSCdm/ICKec JXoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1729185866; 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=ZKf/n02rjzMepGpSkuuXmnPJ1Dn+plIEKRrTMDtLW3A=; b=DgEk5foaTzlBMfVVFPEF16/+yC2HhVBAl81iwQkapn7v9hjbQ45jgNuuB9QUx+pMD3 iJ+idkE5H8nAQY5BzgCg== X-RZG-AUTH: ":Jm0XeU+IYfb0x77LHmrjN5Wlb7TBwusDqIM6Hizy8VdfzvKi4yoFC9cChoruAPJaMLnEXgE4US4SwNHvFuM4Ih4GFfdN" Received: from archlinux.fritz.box by smtp.strato.de (RZmta 51.2.11 AUTH) with ESMTPSA id zf9ba109HHOQI7I (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 17 Oct 2024 19:24:26 +0200 (CEST) From: Jaslo Ziska To: libcamera-devel@lists.libcamera.org Cc: Jaslo Ziska , Laurent Pinchart Subject: [PATCH v3 2/3] gstreamer: Remove auto-focus-mode property from libcamerasrc Date: Thu, 17 Oct 2024 19:04:14 +0200 Message-ID: <20241017172331.16377-3-jaslo@ziska.de> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241017172331.16377-1-jaslo@ziska.de> References: <20241017172331.16377-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 Reviewed-by: Kieran Bingham --- src/gstreamer/gstlibcamerasrc.cpp | 28 ---------------------------- src/gstreamer/gstlibcamerasrc.h | 31 ------------------------------- 2 files changed, 59 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 */ diff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h index fd1f8193..a27db9ca 100644 --- a/src/gstreamer/gstlibcamerasrc.h +++ b/src/gstreamer/gstlibcamerasrc.h @@ -8,8 +8,6 @@ #pragma once -#include - #include G_BEGIN_DECLS @@ -19,32 +17,3 @@ G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src, GST_LIBCAMERA, SRC, GstElement) G_END_DECLS - -inline GType -gst_libcamera_auto_focus_get_type() -{ - static GType type = 0; - static const GEnumValue values[] = { - { - static_cast(libcamera::controls::AfModeManual), - "AfModeManual", - "manual-focus", - }, - { - static_cast(libcamera::controls::AfModeAuto), - "AfModeAuto", - "automatic-auto-focus", - }, - { - static_cast(libcamera::controls::AfModeContinuous), - "AfModeContinuous", - "continuous-auto-focus", - }, - { 0, NULL, NULL } - }; - - if (!type) - type = g_enum_register_static("GstLibcameraAutoFocus", values); - - return type; -}