{"id":23739,"url":"https://patchwork.libcamera.org/api/patches/23739/?format=json","web_url":"https://patchwork.libcamera.org/patch/23739/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250703123647.21468-1-uajain@igalia.com>","date":"2025-07-03T12:36:47","name":"[v2] libcamera: gstreamer: Report mounting-rotation of camera sensor","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"79c5e2dcc39bb8d4cb37f883090d046b5ba411eb","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/?format=json","name":"Umang Jain","email":"uajain@igalia.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23739/mbox/","series":[{"id":5268,"url":"https://patchwork.libcamera.org/api/series/5268/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5268","date":"2025-07-03T12:36:47","name":"[v2] libcamera: gstreamer: Report mounting-rotation of camera sensor","version":2,"mbox":"https://patchwork.libcamera.org/series/5268/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23739/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23739/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 35145C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Jul 2025 12:36:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 45F8968E40;\n\tThu,  3 Jul 2025 14:36:47 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9C0861528\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Jul 2025 14:36:44 +0200 (CEST)","from [49.36.71.127] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uXJBD-00Btzy-1x; Thu, 03 Jul 2025 14:36:43 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"LJHMDEV/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:\n\tCc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tIn-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=stih1vmxq7q6Q1WyFzuNU6RKE3tH07a7hpUXRlQF27U=;\n\tb=LJHMDEV/cOICtABS2n4laTeHIC\n\tPdI387XZJo1OyLC/Y5l8/9FGhoXlMkTWwSjRvcXpyTu/9gsbjjAxqhZtyyGGqvj1he66G3sp3nR1a\n\tvf0tnX60zXaOhAevv1Hi2Q9DL1k+5jN49h3YpJZc6yIJs4fYPRFrrFgUlFUVaeIf85TReUnCSKJL8\n\tv2GfLGhxpu/Jzyq2rthQztpkKrMN9hFZb8hRD2OYduGE0LBN5DGdx6qqFFzVuGmKfV/CzkvHKKTyl\n\tHYpwUb21r4XmdOrTh5lg5BaCUr4fWns+7XHMUaeoi5diokspu64WX3NHv51VRSTO82a8MvwyfpwSc\n\tH/AL/wJQ==;","From":"Umang Jain <uajain@igalia.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Giacomo Cappellini <giacomo.cappellini.87@gmail.com>,\n\tNicolas Dufresne <nicolas@ndufresne.ca>, Umang Jain <uajain@igalia.com>","Subject":"[PATCH v2] libcamera: gstreamer: Report mounting-rotation of camera\n\tsensor","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","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Report mounting-rotation of the camera sensor by reading the\nproperty::Rotation property from libcamera. This is reported\nin device properties for libcamerasrc.\n\nSigned-off-by: Umang Jain <uajain@igalia.com>\n---\nChanges in v2:\n- Ditch reporting mounting-rotation as libcamera orientation string\n- Use the property naming format as: \"api.libcamera.<property>: <value>\"\n---\n src/gstreamer/gstlibcameraprovider.cpp | 8 ++++++++\n 1 file changed, 8 insertions(+)","diff":"diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\nindex 5da96ea3..b0a7124f 100644\n--- a/src/gstreamer/gstlibcameraprovider.cpp\n+++ b/src/gstreamer/gstlibcameraprovider.cpp\n@@ -12,6 +12,7 @@\n \n #include <libcamera/camera.h>\n #include <libcamera/camera_manager.h>\n+#include <libcamera/property_ids.h>\n \n #include \"gstlibcamerasrc.h\"\n #include \"gstlibcamera-utils.h\"\n@@ -144,12 +145,19 @@ gst_libcamera_device_new(const std::shared_ptr<Camera> &camera)\n \t\t\tgst_caps_append(caps, sub_caps);\n \t}\n \n+\tconst int32_t rotation = camera->properties().get(properties::Rotation).value_or(0);\n+\tg_autoptr(GstStructure) props =\n+\t\tgst_structure_new(\"camera-properties\",\n+\t\t\t\t  \"api.libcamera.mounting-rotation\", G_TYPE_INT, rotation,\n+\t\t\t\t  nullptr);\n+\n \treturn GST_DEVICE(g_object_new(GST_TYPE_LIBCAMERA_DEVICE,\n \t\t\t\t       /* \\todo Use a unique identifier instead of camera name. */\n \t\t\t\t       \"name\", name,\n \t\t\t\t       \"display-name\", name,\n \t\t\t\t       \"caps\", caps,\n \t\t\t\t       \"device-class\", \"Source/Video\",\n+\t\t\t\t       \"properties\", props,\n \t\t\t\t       nullptr));\n }\n \n","prefixes":["v2"]}