From patchwork Thu Jul 3 12:36:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 23739 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 35145C3237 for ; Thu, 3 Jul 2025 12:36:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 45F8968E40; Thu, 3 Jul 2025 14:36:47 +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="LJHMDEV/"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E9C0861528 for ; Thu, 3 Jul 2025 14:36:44 +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=stih1vmxq7q6Q1WyFzuNU6RKE3tH07a7hpUXRlQF27U=; b=LJHMDEV/cOICtABS2n4laTeHIC PdI387XZJo1OyLC/Y5l8/9FGhoXlMkTWwSjRvcXpyTu/9gsbjjAxqhZtyyGGqvj1he66G3sp3nR1a vf0tnX60zXaOhAevv1Hi2Q9DL1k+5jN49h3YpJZc6yIJs4fYPRFrrFgUlFUVaeIf85TReUnCSKJL8 v2GfLGhxpu/Jzyq2rthQztpkKrMN9hFZb8hRD2OYduGE0LBN5DGdx6qqFFzVuGmKfV/CzkvHKKTyl HYpwUb21r4XmdOrTh5lg5BaCUr4fWns+7XHMUaeoi5diokspu64WX3NHv51VRSTO82a8MvwyfpwSc H/AL/wJQ==; Received: from [49.36.71.127] (helo=uajain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1uXJBD-00Btzy-1x; Thu, 03 Jul 2025 14:36:43 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Giacomo Cappellini , Nicolas Dufresne , Umang Jain Subject: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of camera sensor Date: Thu, 3 Jul 2025 18:06:47 +0530 Message-ID: <20250703123647.21468-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" Report mounting-rotation of the camera sensor by reading the property::Rotation property from libcamera. This is reported in device properties for libcamerasrc. Signed-off-by: Umang Jain --- Changes in v2: - Ditch reporting mounting-rotation as libcamera orientation string - Use the property naming format as: "api.libcamera.: " --- src/gstreamer/gstlibcameraprovider.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp index 5da96ea3..b0a7124f 100644 --- a/src/gstreamer/gstlibcameraprovider.cpp +++ b/src/gstreamer/gstlibcameraprovider.cpp @@ -12,6 +12,7 @@ #include #include +#include #include "gstlibcamerasrc.h" #include "gstlibcamera-utils.h" @@ -144,12 +145,19 @@ gst_libcamera_device_new(const std::shared_ptr &camera) gst_caps_append(caps, sub_caps); } + const int32_t rotation = camera->properties().get(properties::Rotation).value_or(0); + g_autoptr(GstStructure) props = + gst_structure_new("camera-properties", + "api.libcamera.mounting-rotation", G_TYPE_INT, rotation, + nullptr); + return GST_DEVICE(g_object_new(GST_TYPE_LIBCAMERA_DEVICE, /* \todo Use a unique identifier instead of camera name. */ "name", name, "display-name", name, "caps", caps, "device-class", "Source/Video", + "properties", props, nullptr)); }