From patchwork Fri Jun 2 13:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cedric Nugteren X-Patchwork-Id: 18684 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 C8344C3200 for ; Fri, 2 Jun 2023 13:39:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 22D5A62754; Fri, 2 Jun 2023 15:39:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1685713146; bh=dTwCRrfI4pdz7WS8GFOmR9Lkq0KoO6CezyNpGFZU5FU=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=K/jn2fY6Hs+IBAl/qXqUb+AxqKE21tN1NCdybDQwbtCFwJ8iwZRfN+NfcuIx9m2zo 96S4MyVmyibjK9NjBcQsTJIcyWEGo/G4asLirTf1XaTKCH3n+Fm0m3WZ64qJwGCG/6 X0tTyj9ei27u1BHUKGnUknLk165zygMOTrBpiVkowysRrd6o8ffC0BfDV+8NooXXfI u9U1ge4P1U7VA6Qg1fADo8wjnd7T6KrZ4sf3pUGs7t2PEzD/Bl/iGsQNznXnQAxfXC oxDuRFiY7cYDybCsr/UXLWlBPVIlsTtsdIHlzrx5zI/M4dqsTH7mfTIQMJgqux2dtm Gcdfz80GbpuBQ== Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 16352626FA for ; Fri, 2 Jun 2023 15:39:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=plumerai.com header.i=@plumerai.com header.b="KvW/nnAg"; dkim-atps=neutral Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-96fab30d1e1so448436466b.0 for ; Fri, 02 Jun 2023 06:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plumerai.com; s=google; t=1685713144; x=1688305144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G16UFzawe7BPKlrKgrQzkBeMrZMxB0NE2650bPuJr7Q=; b=KvW/nnAgvF632AspR5GnP9/EuZeZ3Y32Y32LT4GLRZjJ+VL7Tf3O5z0R6+Y9puipoQ 0AW89RhhijhyM55KihMx45EMGcDBhQJ7XOJlrVDrlJx7rXBZhW6lmlgDnGOXu2GfNm3j s2Quqxzfw9Usqcti8j/v7WpyQyfFEY+mFjMkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685713144; x=1688305144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G16UFzawe7BPKlrKgrQzkBeMrZMxB0NE2650bPuJr7Q=; b=IDNQOzONmT7sXuYzbVpw5j1Hzr/cf12W6NtXXnTS5xHz/ATrpGqIjiVkJtyR3XW5lb ftdbJGUYYICaJJnLcrURADNVWnZq2camdKhOjAve6eEQ8S2RUXIMzMqggfh6GsrEv7hI lwwYDOUmhOqb21XiSB7gCb4HPxJJFjIWuhlZA0dFVOXWACt51ZTflcyYWrxTLwxMwmNW GeyVEE5R87larALAtbDP5X8pzoICdrkv7VzoBLhEzgxMZXw+SVb8ik2PX6RYRNO0+I6i eAu9eHAIBSMxBJjoWLyMHlwW6s1QO1HzSfmdRrsN5Cy6CzokfoISJInlMGXUybNJUO5H QNug== X-Gm-Message-State: AC+VfDz+68HXoGP+dhHrZDib8VReGvgkQ+RKwKY8IF4aTMWZjUZ3+S45 zelsF62bwC2Bi+3S3nP5c2xfKvT++XrOKofATvU= X-Google-Smtp-Source: ACHHUZ69lG6DK0aw58YIPIZQ2AHU4f5ZW2uiH4dTm97kDVHfrJHHgJinz8WjaJTshKHKOSheiXnTTg== X-Received: by 2002:a17:906:7311:b0:96a:316f:8aaa with SMTP id di17-20020a170906731100b0096a316f8aaamr4457156ejc.37.1685713144422; Fri, 02 Jun 2023 06:39:04 -0700 (PDT) Received: from kaylee.. (92-68-83-157.biz.kpn.net. [92.68.83.157]) by smtp.gmail.com with ESMTPSA id g6-20020a1709064e4600b00965b416585bsm770659ejw.118.2023.06.02.06.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 06:39:03 -0700 (PDT) X-Google-Original-From: Cedric Nugteren To: libcamera-devel@lists.libcamera.org Date: Fri, 2 Jun 2023 15:38:05 +0200 Message-Id: <20230602133805.198862-1-web@cedricnugteren.nl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <037947> References: <037947> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] Apply review suggestions 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: , X-Patchwork-Original-From: Cedric Nugteren via libcamera-devel From: Cedric Nugteren Reply-To: Cedric Nugteren Cc: Cedric Nugteren Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This addresses the comments from Nicolas. I did not change the default behaviour, I'll wait with that until you have settled on what to do. Signed-off-by: Cedric Nugteren --- src/gstreamer/gstlibcameraprovider.cpp | 15 +++++++-------- src/gstreamer/gstlibcamerasrc.cpp | 14 +++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp index 86fa2542..579cb8c0 100644 --- a/src/gstreamer/gstlibcameraprovider.cpp +++ b/src/gstreamer/gstlibcameraprovider.cpp @@ -41,7 +41,7 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device, struct _GstLibcameraDevice { GstDevice parent; gchar *name; - gboolean enable_auto_focus = false; + bool enable_auto_focus = false; }; G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE) @@ -71,7 +71,6 @@ gst_libcamera_device_reconfigure_element(GstDevice *device, return FALSE; g_object_set(element, "camera-name", GST_LIBCAMERA_DEVICE(device)->name, nullptr); - g_object_set(element, "enable-auto-focus", GST_LIBCAMERA_DEVICE(device)->enable_auto_focus, nullptr); return TRUE; } @@ -128,12 +127,12 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass) (GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec); - GParamSpec *spec2 = g_param_spec_boolean("enable-auto-focus", - "Enable auto-focus", - "Enable auto-focus if set to true, " - "disable it if set to false", - FALSE, G_PARAM_WRITABLE); - g_object_class_install_property(object_class, PROP_ENABLE_AUTO_FOCUS, spec2); + pspec = g_param_spec_boolean("enable-auto-focus", + "Enable auto-focus", + "Enable auto-focus if set to true, " + "disable it if set to false", + FALSE, G_PARAM_WRITABLE); + g_object_class_install_property(object_class, PROP_ENABLE_AUTO_FOCUS, pspec); } static GstDevice * diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 672ea38a..b2d8456b 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -146,7 +146,7 @@ struct _GstLibcameraSrc { GstTask *task; gchar *camera_name; - gboolean enable_auto_focus = false; + bool enable_auto_focus = false; GstLibcameraSrcState *state; GstLibcameraAllocator *allocator; @@ -864,11 +864,11 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass) | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec); - GParamSpec *spec2 = g_param_spec_boolean("enable-auto-focus", - "Enable auto-focus", - "Enable auto-focus if set to true, " - "disable it if set to false", - FALSE, G_PARAM_WRITABLE); - g_object_class_install_property(object_class, PROP_ENABLE_AUTO_FOCUS, spec2); + spec = g_param_spec_boolean("enable-auto-focus", + "Enable auto-focus", + "Enable auto-focus if set to true, " + "disable it if set to false", + FALSE, G_PARAM_WRITABLE); + g_object_class_install_property(object_class, PROP_ENABLE_AUTO_FOCUS, spec); }