From patchwork Tue Jul 29 15:39:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 24023 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 ECDF9BDCC1 for ; Tue, 29 Jul 2025 15:39:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BDB1B691DF; Tue, 29 Jul 2025 17:39:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="QKxzaHox"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 61C2469052 for ; Tue, 29 Jul 2025 17:39:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PCeBHY6cZG507QtfshHQdcwD2+i7FL9Hiyfxg899Woc=; b=QKxzaHoxoVcPukzJAy+P3qy7Kg ZVJymjfHAGwR7YmjZwpmuEWz9fXqRN9BeVLY6New871uBxnYZuFcJEWjF+gP/aO98FuYi9L8Ob5wy Cp40IGpDaUOavZmaSzhSOmrXEAY68KAy2A966Hk83Fp48tdLnoZmQY1Q3xMUez02axtkTj6Uv0saE h7V8ztIXiOGxN1AZysWRqdxAE9U+lzxXUVbWViy+o0ZqKthQXKnE3mfD3XcdPvfDToVA39i1oWD+P GkUnXqvVTTjo/b+qkxdE5OEK7yJsw+E5+goile2RV5EeRfqMbaa3zZBS8eAS5+LGVBWVR4cl2RLLN j7u5/rVw==; Received: from [49.36.71.87] (helo=uajain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1ugmQ3-005UrS-Uu; Tue, 29 Jul 2025 17:39:12 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Jaslo Ziska , Nicolas Dufresne , Umang Jain Subject: [PATCH v5 0/3] gstreamer: Report camera properties as device properties Date: Tue, 29 Jul 2025 21:09:12 +0530 Message-ID: <20250729153915.159243-1-uajain@igalia.com> X-Mailer: git-send-email 2.50.0 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" This series aims to report camera properties from libcamera to device properties in gstreamer device provider. Patch 1/3 splits the Rectangle GValue helper into two: Point and Size. Patch 2/3 moves all three 3 GValue helpers(Rectangle, Size, Point) from gstlibcamera-controls.cpp.in to libcamera-utils.cpp. This enables code sharing when we report properties which are Rectangle, Size, Points types. Patch 3/3 is the integration patch. It maps all ControlType from libcamera to corresponding GType. If the ControlValue::isArray() is true, GST_VALUE_ARRAY is preferred to report all array values, with corresponding type GType. Output on RPi3: ============== uajain1@uajain:~$ cam -c1 -p ... Property: SystemDevices = [ 20749, 20739, 20740, 20741 ] Property: ScalerCropMaximum = (0, 0)/0x0 Property: PixelArrayActiveAreas = [ (8, 8)/3280x2464 ] Property: PixelArraySize = 3280x2464 Property: Rotation = 180 Property: Location = 2 (CameraLocationExternal) Property: ColorFilterArrangement = 0 (RGGB) Property: UnitCellSize = 1120x1120 Property: Model = imx219 uajain1@uajain:~$ gst-device-monitor-1.0 .... properties: api.libcamera.SystemDevices = < (gint64)20749, (gint64)20739, (gint64)20740, (gint64)20741 > api.libcamera.ScalerCropMaximum = < (int)0, (int)0, (int)0, (int)0 > api.libcamera.PixelArrayActiveAreas = < (int)8, (int)8, (int)3280, (int)2464 > api.libcamera.PixelArraySize = < (int)3280, (int)2464 > api.libcamera.Rotation = 180 api.libcamera.Location = CameraLocationExternal api.libcamera.ColorFilterArrangement = RGGB api.libcamera.UnitCellSize = < (int)1120, (int)1120 > api.libcamera.Model = imx219 gst-launch-1.0 libcamerasrc camera-name="/base/soc/i2c0mux/i2c\@1/imx219\@10" ! ... Changes in v5: - Use of g_auto() for GValue cleanups - Construct property string api.libcamera.xxx in gst_libcamera_set_structure_field() directly - Unset GValue array before setting string type property - Use G_TYPE_INT for 32-bit integers (drop long-type) as per Nicolas' comment. - few cosmetic changes for better readability Changes in v4: - Extensively reworked to map ControlType<>GType for ControlValues Umang Jain (3): gstreamer: Split value_set_rectangle() GValue helper gstreamer: Move existing GValue helpers to gstreamer-utils gstreamer: Report camera properties as device properties src/gstreamer/gstlibcamera-controls.cpp.in | 50 +---- src/gstreamer/gstlibcamera-utils.cpp | 244 +++++++++++++++++++++ src/gstreamer/gstlibcamera-utils.h | 7 + src/gstreamer/gstlibcameraprovider.cpp | 13 ++ 4 files changed, 269 insertions(+), 45 deletions(-)