From patchwork Thu Jul 24 13:33:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 23944 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 DF0CEC3237 for ; Thu, 24 Jul 2025 13:33:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 25A66690F3; Thu, 24 Jul 2025 15:33:44 +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="RLbN7nLA"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BF839690E2 for ; Thu, 24 Jul 2025 15:33:38 +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=Gi8A/odT+ZLAOQJr+EN+zXn/wgeFc+WkKKcvuKPWVMI=; b=RLbN7nLA1mo8eEd8i/bq/f1q5i Q36Fz58OZ/CYSXBLLPYdnr6qizuhgbkko7NTOLbx5HpzTB493nZTOo+uE7JX2HuPsPQICxqrGN3dl EMDf8rxoOLTjpTxZjdyQk8xnOc1lEt/dct9bTo/u1fC/YK73eGsx+x3goHGm5oSjNLZaxWQoM0mQp 4lDRP+oUbIgtYX/7nIaVeA0bpHnoOOG4scz0nC5fMjM8IYC7k27GLXDE0XmzuvQoJvxp/wMbwbN9Z AAwZjcPozq2GZYtSdhg6gmdCspM1EcaYUuJbVdhrbjxhilrIgJbEXEFSqOs+jo7ToMiBL/C+eBCsN sY9jbgfw==; 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 1uew4n-003CfR-2F; Thu, 24 Jul 2025 15:33:37 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Jaslo Ziska , Nicolas Dufresne , Umang Jain Subject: [PATCH v4 0/3] gstreamer: Report camera properties as device properties Date: Thu, 24 Jul 2025 19:03:40 +0530 Message-ID: <20250724133343.353044-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 v3: - 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 | 246 +++++++++++++++++++++ src/gstreamer/gstlibcamera-utils.h | 7 + src/gstreamer/gstlibcameraprovider.cpp | 16 ++ 4 files changed, 274 insertions(+), 45 deletions(-)