[{"id":34776,"web_url":"https://patchwork.libcamera.org/comment/34776/","msgid":"<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>","date":"2025-07-03T12:44:52","subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain (2025-07-03 13:36:47)\n> Report mounting-rotation of the camera sensor by reading the\n> property::Rotation property from libcamera. This is reported\n> in device properties for libcamerasrc.\n> \n> Signed-off-by: Umang Jain <uajain@igalia.com>\n> ---\n> Changes 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(+)\n> \n> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> index 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>                         gst_caps_append(caps, sub_caps);\n>         }\n>  \n> +       const int32_t rotation = camera->properties().get(properties::Rotation).value_or(0);\n> +       g_autoptr(GstStructure) props =\n> +               gst_structure_new(\"camera-properties\",\n> +                                 \"api.libcamera.mounting-rotation\", G_TYPE_INT, rotation,\n\nIf we extend this to iterate over all properties and report them as\napi.libcamera.$PROPERTY_NAME this would just be 'rotation' I think ?\n\nCould you envisage iterating all the properties and including them with\ntheir property name ?\n\nSuch as the way cam does it with \"cam -c 1 -p\"\n\nThen this would handle all camera properties automatically ?\n\n--\nKieran\n\n\n> +                                 nullptr);\n> +\n>         return GST_DEVICE(g_object_new(GST_TYPE_LIBCAMERA_DEVICE,\n>                                        /* \\todo Use a unique identifier instead of camera name. */\n>                                        \"name\", name,\n>                                        \"display-name\", name,\n>                                        \"caps\", caps,\n>                                        \"device-class\", \"Source/Video\",\n> +                                      \"properties\", props,\n>                                        nullptr));\n>  }\n>  \n> -- \n> 2.50.0\n>","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 6B90BBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Jul 2025 12:44:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C0AB68E3C;\n\tThu,  3 Jul 2025 14:44:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5DFE961528\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Jul 2025 14:44:55 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DE796F3;\n\tThu,  3 Jul 2025 14:44:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Ca07O3TG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751546671;\n\tbh=pg35uECSKtgYzB+0CXWh3RykiZ+l9OPiyHLop/G7rFg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Ca07O3TGMHcWCqJFEF+oyXeq71mA1AXeeMMsDtinBSQWJ7q0Q4FnpBaPJcijHwalP\n\t6kIf+65YH3DeMi2dcXai2U5EumeBNkoXqAvYI8M1rxBSD7GmEUZ8idWEysf8TcAzFW\n\tT0MXpZKweV2lMh99evG71tjOtmQRKahF8tQSZqpQ=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250703123647.21468-1-uajain@igalia.com>","References":"<20250703123647.21468-1-uajain@igalia.com>","Subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Giacomo Cappellini <giacomo.cappellini.87@gmail.com>,\n\tNicolas Dufresne <nicolas@ndufresne.ca>, Umang Jain <uajain@igalia.com>","To":"Umang Jain <uajain@igalia.com>, libcamera-devel@lists.libcamera.org","Date":"Thu, 03 Jul 2025 13:44:52 +0100","Message-ID":"<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":34777,"web_url":"https://patchwork.libcamera.org/comment/34777/","msgid":"<175154983364.2875288.3144428834936921218@ping.linuxembedded.co.uk>","date":"2025-07-03T13:37:13","subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Kieran Bingham (2025-07-03 13:44:52)\n> Quoting Umang Jain (2025-07-03 13:36:47)\n> > Report mounting-rotation of the camera sensor by reading the\n> > property::Rotation property from libcamera. This is reported\n> > in device properties for libcamerasrc.\n> > \n> > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > ---\n> > Changes 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(+)\n> > \n> > diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> > index 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> >                         gst_caps_append(caps, sub_caps);\n> >         }\n> >  \n> > +       const int32_t rotation = camera->properties().get(properties::Rotation).value_or(0);\n> > +       g_autoptr(GstStructure) props =\n> > +               gst_structure_new(\"camera-properties\",\n> > +                                 \"api.libcamera.mounting-rotation\", G_TYPE_INT, rotation,\n> \n> If we extend this to iterate over all properties and report them as\n> api.libcamera.$PROPERTY_NAME this would just be 'rotation' I think ?\n> \n> Could you envisage iterating all the properties and including them with\n> their property name ?\n> \n> Such as the way cam does it with \"cam -c 1 -p\"\n> \n> Then this would handle all camera properties automatically ?\n\nAs Laurent asked if I'm asking for yak-shaving here ... to be clearer:\n\n- If you want to just add this rotation property - I'd be fine - if it\nmatched the property name - so that for the bigger picture - handling\n'all properties' could be handled on top, Otherwise someone will have to\nspecial case the name of the rotation property.\n\nOr handling all properties now is certainly a yak - and if you like\nshaving yaks then that's fine too ;-)\n\n--\nKieran\n\n\n> \n> --\n> Kieran\n> \n> \n> > +                                 nullptr);\n> > +\n> >         return GST_DEVICE(g_object_new(GST_TYPE_LIBCAMERA_DEVICE,\n> >                                        /* \\todo Use a unique identifier instead of camera name. */\n> >                                        \"name\", name,\n> >                                        \"display-name\", name,\n> >                                        \"caps\", caps,\n> >                                        \"device-class\", \"Source/Video\",\n> > +                                      \"properties\", props,\n> >                                        nullptr));\n> >  }\n> >  \n> > -- \n> > 2.50.0\n> >","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 C4452C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Jul 2025 13:37:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 74EDA68E3C;\n\tThu,  3 Jul 2025 15:37:18 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 17FA861528\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Jul 2025 15:37:17 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0F33C6DE;\n\tThu,  3 Jul 2025 15:36:53 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hqSpDqJ9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751549813;\n\tbh=WP9kQe9vj2g7fJejWHlWnHd1CfQZBB3u/FhfhboxOPQ=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=hqSpDqJ9QNS+lHtf4U8gfCe3HXuGE58VXV/ZpyhbtdL6/nvo13JPmfVsFHUL8428G\n\ti7IUIcHyVRDo3Rmre8gWy2bFq/oBty7qCneK9Nu5GJuUCTpHp9zURIG99t7GllKGcN\n\tIct2Dttg2R0le8BMTEjD83p3762VZK3dCP5xtI/s=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>","References":"<20250703123647.21468-1-uajain@igalia.com>\n\t<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>","Subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Giacomo Cappellini <giacomo.cappellini.87@gmail.com>,\n\tNicolas Dufresne <nicolas@ndufresne.ca>, Umang Jain <uajain@igalia.com>","To":"Umang Jain <uajain@igalia.com>, libcamera-devel@lists.libcamera.org","Date":"Thu, 03 Jul 2025 14:37:13 +0100","Message-ID":"<175154983364.2875288.3144428834936921218@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":34778,"web_url":"https://patchwork.libcamera.org/comment/34778/","msgid":"<5o5vjkje4gz3i25uk3s6tm5zvcei36dtbb2sosd4zbhtb2mvma@336mczr2au3a>","date":"2025-07-03T14:28:01","subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Thu, Jul 03, 2025 at 02:37:13PM +0100, Kieran Bingham wrote:\n> Quoting Kieran Bingham (2025-07-03 13:44:52)\n> > Quoting Umang Jain (2025-07-03 13:36:47)\n> > > Report mounting-rotation of the camera sensor by reading the\n> > > property::Rotation property from libcamera. This is reported\n> > > in device properties for libcamerasrc.\n> > > \n> > > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > > ---\n> > > Changes 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(+)\n> > > \n> > > diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp\n> > > index 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> > >                         gst_caps_append(caps, sub_caps);\n> > >         }\n> > >  \n> > > +       const int32_t rotation = camera->properties().get(properties::Rotation).value_or(0);\n> > > +       g_autoptr(GstStructure) props =\n> > > +               gst_structure_new(\"camera-properties\",\n> > > +                                 \"api.libcamera.mounting-rotation\", G_TYPE_INT, rotation,\n> > \n> > If we extend this to iterate over all properties and report them as\n> > api.libcamera.$PROPERTY_NAME this would just be 'rotation' I think ?\n> > \n> > Could you envisage iterating all the properties and including them with\n> > their property name ?\n> > \n> > Such as the way cam does it with \"cam -c 1 -p\"\n> > \n> > Then this would handle all camera properties automatically ?\n> \n> As Laurent asked if I'm asking for yak-shaving here ... to be clearer:\n> \n> - If you want to just add this rotation property - I'd be fine - if it\n> matched the property name - so that for the bigger picture - handling\n> 'all properties' could be handled on top, Otherwise someone will have to\n> special case the name of the rotation property.\n\nNaming is hard.. we recently went through whole cycle of rotation,\nmounting-rotation, orientaion, ... eh\n\n> \n> Or handling all properties now is certainly a yak - and if you like\n> shaving yaks then that's fine too ;-)\n\nShould be do-able, I will take a look at some point.\n\n> \n> --\n> Kieran\n> \n> \n> > \n> > --\n> > Kieran\n> > \n> > \n> > > +                                 nullptr);\n> > > +\n> > >         return GST_DEVICE(g_object_new(GST_TYPE_LIBCAMERA_DEVICE,\n> > >                                        /* \\todo Use a unique identifier instead of camera name. */\n> > >                                        \"name\", name,\n> > >                                        \"display-name\", name,\n> > >                                        \"caps\", caps,\n> > >                                        \"device-class\", \"Source/Video\",\n> > > +                                      \"properties\", props,\n> > >                                        nullptr));\n> > >  }\n> > >  \n> > > -- \n> > > 2.50.0\n> > >","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 D7ACBC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Jul 2025 14:28:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 917E068E3C;\n\tThu,  3 Jul 2025 16:28:03 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E69C61528\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Jul 2025 16:28:02 +0200 (CEST)","from [49.36.71.127] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uXKut-00BwOg-NN; Thu, 03 Jul 2025 16:28:00 +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=\"kBY5fWyE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=VtYToaB1xpPf1x8eZruVfNrYUQE29zBHk0qajyB/X1s=;\n\tb=kBY5fWyEmsX/Dj7S8IfxD9Z4Sp\n\trs31e6Qo0CjNHEBwwAG5AsNBjA8wVt2oYqPyWR9bFWNozWn4kf+fPKmVk/kVaE1HYKsKKGbB7yeYD\n\tlMhknuv3xP0cArC54GxWG/hjS8AAo89lyZyZV/99DEryEIyOgDopcUgDEUw6ElOFSqIyMZHdT6dVd\n\tr5PNH+P2qr9JvmEF/iSLoaMX+nbdQDlr28xXhGcwQnJKHBUmyqLOSHIQ8bqg2saogv6PRJzj0YhJr\n\twc4egKWrxEXTVsayECNc6hQGWllkdb3sd4Y/gg3l5y6dSsmhEhcQXDrI/BagRNlPUZR8ux6dAqes7\n\tjiO7NLMg==;","Date":"Thu, 3 Jul 2025 19:58:01 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tGiacomo Cappellini <giacomo.cappellini.87@gmail.com>,\n\tNicolas Dufresne <nicolas@ndufresne.ca>","Subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","Message-ID":"<5o5vjkje4gz3i25uk3s6tm5zvcei36dtbb2sosd4zbhtb2mvma@336mczr2au3a>","References":"<20250703123647.21468-1-uajain@igalia.com>\n\t<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>\n\t<175154983364.2875288.3144428834936921218@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<175154983364.2875288.3144428834936921218@ping.linuxembedded.co.uk>","User-Agent":"NeoMutt/20250510-dirty","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>"}},{"id":34779,"web_url":"https://patchwork.libcamera.org/comment/34779/","msgid":"<e515c1f73fe3b2dda8419d9aef559208b546c234.camel@ndufresne.ca>","date":"2025-07-04T00:34:29","subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le jeudi 03 juillet 2025 à 13:44 +0100, Kieran Bingham a écrit :\n> Quoting Umang Jain (2025-07-03 13:36:47)\n> > Report mounting-rotation of the camera sensor by reading the\n> > property::Rotation property from libcamera. This is reported\n> > in device properties for libcamerasrc.\n> > \n> > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > ---\n> > Changes 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(+)\n> > \n> > diff --git a/src/gstreamer/gstlibcameraprovider.cpp\n> > b/src/gstreamer/gstlibcameraprovider.cpp\n> > index 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>\n> > &camera)\n> >                         gst_caps_append(caps, sub_caps);\n> >         }\n> >  \n> > +       const int32_t rotation = camera-\n> > >properties().get(properties::Rotation).value_or(0);\n> > +       g_autoptr(GstStructure) props =\n> > +               gst_structure_new(\"camera-properties\",\n> > +                                 \"api.libcamera.mounting-rotation\",\n> > G_TYPE_INT, rotation,\n> \n> If we extend this to iterate over all properties and report them as\n> api.libcamera.$PROPERTY_NAME this would just be 'rotation' I think ?\n> \n> Could you envisage iterating all the properties and including them with\n> their property name ?\n> \n> Such as the way cam does it with \"cam -c 1 -p\"\n> \n> Then this would handle all camera properties automatically ?\n\nSeems like a good suggestion to me, and with the api.libcamera namespace, we\nknow where to look for documentation.\n\nNicolas\n\n> \n> --\n> Kieran\n> \n> \n> > +                                 nullptr);\n> > +\n> >         return GST_DEVICE(g_object_new(GST_TYPE_LIBCAMERA_DEVICE,\n> >                                        /* \\todo Use a unique identifier\n> > instead of camera name. */\n> >                                        \"name\", name,\n> >                                        \"display-name\", name,\n> >                                        \"caps\", caps,\n> >                                        \"device-class\", \"Source/Video\",\n> > +                                      \"properties\", props,\n> >                                        nullptr));\n> >  }\n> >  \n> > -- \n> > 2.50.0\n> >","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 14E5BC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  4 Jul 2025 00:34:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DAD8368E55;\n\tFri,  4 Jul 2025 02:34:35 +0200 (CEST)","from mail-qt1-x834.google.com (mail-qt1-x834.google.com\n\t[IPv6:2607:f8b0:4864:20::834])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6320A6151C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Jul 2025 02:34:33 +0200 (CEST)","by mail-qt1-x834.google.com with SMTP id\n\td75a77b69052e-4a43d2d5569so4798661cf.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 03 Jul 2025 17:34:33 -0700 (PDT)","from ?IPv6:2606:6d00:17:b699::5ac? ([2606:6d00:17:b699::5ac])\n\tby smtp.gmail.com with ESMTPSA id\n\td75a77b69052e-4a994a3093asm6063281cf.36.2025.07.03.17.34.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 03 Jul 2025 17:34:31 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ndufresne-ca.20230601.gappssmtp.com\n\theader.i=@ndufresne-ca.20230601.gappssmtp.com\n\theader.b=\"DdWNdqZm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1751589272;\n\tx=1752194072; darn=lists.libcamera.org; \n\th=mime-version:user-agent:autocrypt:references:in-reply-to:date:cc:to\n\t:from:subject:message-id:from:to:cc:subject:date:message-id:reply-to; \n\tbh=wrsckWhjAkJltVIHT4mSgQx7Q9WENiOULe9Mp8Jj26A=;\n\tb=DdWNdqZmTSBpyWAKfpWZPKp2BMIcxKn1hpc1Bbq/kOQQzTHZmJoG//fu+0EpP1cEnM\n\t4wB6rekhIzK1C74ZkgPdMpmaX0RHQsYphIrXTkvWvDOyhKhOBlW82q9H7eCzMW5bz7ff\n\tjJ7AhHru5IVqBeO4oRWe7qQMJdqU3ULczg+zdzovo/r2iSqPhEnOy/wGAbzrZxtOBoN3\n\tipwrdgIMnp9KqIEQaaxDzrt8+dd2/gr2exM/pAOkf9t7+sdIama/IoFvEq6riZ+HuFnj\n\tC3XKkDHQVLTBNDIpH8HC9Q3lBPHXkdKy2c5AWySlaGHz6+0A6xf/W3PwdCXfkEfJ0Ct6\n\tditw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1751589272; x=1752194072;\n\th=mime-version:user-agent:autocrypt:references:in-reply-to:date:cc:to\n\t:from:subject:message-id:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=wrsckWhjAkJltVIHT4mSgQx7Q9WENiOULe9Mp8Jj26A=;\n\tb=JgAwzX9aPizJhyMIufRQulpNn4no2cCVaruSJkEv5gPz1e3qg84L6m2BpiW9Uu73Yw\n\tgDgWDVhyzdmtdkd6fpFfps1XlpmQ1Inlyyry2yCp0CN3T9wWOioJQSKEARz5mKCjFGVD\n\tnYcJWH3m8KXz0pWrLXLvv0+zCd++ciQfreCIxGDEP81BpJNwN9+qTdGH3BDrsNJPVOYw\n\tESboGjIxsCd2SpUQysCDURCTyeYpBZEIdkwfaRWWRmlTBLlMSz4IW/PHNqg61d8xBkYQ\n\t8s3FSEcJwyJXlrYqM44jGUrI15QWHuMObuLZN5Qld8m9eJDuXNwlV45rhWz6vhiukWfh\n\tBXcg==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCU/HR1ucWqTfTosOahg5qh3xYFTlrK1vM4W/LWRJDMO5HtDGKotOtb9l+gqFK/hhuZ7Urf0wrT/+tFS5sJJCOo=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YwYvuGiwYWoLMiHmLXoMEgVM80drH3OelkIKZhDN3gt597owRK4\n\tYdjUxuc/GpCFe9QaOPRmZUdIZQ7EGgWBsQlzkboOYVI0hHUu/WUXns61GEaOVSlBPT4=","X-Gm-Gg":"ASbGncu4r18IoZT9kgttJCUNXwQmzg9UDDzAFG6wkH3yj/8/+6yBgp7LH9gS3aAtuW6\n\tkYxUSd72+5dfGiLHYG9jF2GuXP3g9qExkUKPmKGbShW/mSNhNTJFjIgRJrI+VTQR1Eq4IW31n/D\n\tXqNna5v51sedFCLHstqhqiCh0hCuKXxKWas6pzX6/VDYOm2rA05loBidba+fxLHshI+zGO1+E6v\n\tiAMqDijubkLyBUadU4qONd0B9F3yqbos5oU5OLJq8PSx7FrUnJEL2bRqUa+PWMMR/+chfX9txVo\n\tTNjHmW30PYaXBpLN8vTJhX/nCGo5qXsUDIZ+n4XO0TVzRT8AU+oY1m044KB88RfHbtI=","X-Google-Smtp-Source":"AGHT+IF8+FrQQeBgL92wwedqpforcMo6Cc3XAG+54p9pTeFjQOymH+fSrG3BMiKp8dRkVcE6gQPwcg==","X-Received":"by 2002:a05:622a:429b:b0:4a4:2d64:a7e4 with SMTP id\n\td75a77b69052e-4a99652007emr10119911cf.35.1751589272045; \n\tThu, 03 Jul 2025 17:34:32 -0700 (PDT)","Message-ID":"<e515c1f73fe3b2dda8419d9aef559208b546c234.camel@ndufresne.ca>","Subject":"Re: [PATCH v2] libcamera: gstreamer: Report mounting-rotation of\n\tcamera sensor","From":"Nicolas Dufresne <nicolas@ndufresne.ca>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>, Umang Jain\n\t<uajain@igalia.com>, libcamera-devel@lists.libcamera.org","Cc":"Giacomo Cappellini <giacomo.cappellini.87@gmail.com>","Date":"Thu, 03 Jul 2025 20:34:29 -0400","In-Reply-To":"<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>","References":"<20250703123647.21468-1-uajain@igalia.com>\n\t<175154669251.2285260.15021503626935178041@ping.linuxembedded.co.uk>","Autocrypt":"addr=nicolas@ndufresne.ca; prefer-encrypt=mutual;\n\tkeydata=mDMEaCN2ixYJKwYBBAHaRw8BAQdAM0EHepTful3JOIzcPv6ekHOenE1u0vDG1gdHFrChD\n\t/e0MU5pY29sYXMgRHVmcmVzbmUgPG5pY29sYXMuZHVmcmVzbmVAY29sbGFib3JhLmNvbT6ImQQTFg\n\toAQQIbAwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBO8NUoEVxMPCGgRvEtlBlFEpYHL0BQJ\n\toLLLGBQkJZfd1AAoJENlBlFEpYHL0BEkA/3qkWYt99myYFSmTJUF8UB/7OroEm3vr1HRqXeQe9Qp2\n\tAP0bsoAe6KjEPa/pJfuJ2khrOPPHxvyt/PBNbI5BYcIABLQnTmljb2xhcyBEdWZyZXNuZSA8bmljb\n\t2xhc0BuZHVmcmVzbmUuY2E+iJkEExYKAEECGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AWIQ\n\tTvDVKBFcTDwhoEbxLZQZRRKWBy9AUCaCyy+AUJCWX3dQAKCRDZQZRRKWBy9FJ5AQCNy8SX8DpHbLa\n\tcy58vgDwyIpB89mok9eWGGejY9mqpRwEAhHzs+/n5xlVlM3bqy1yHnAzJqVwqBE1D0jG0a9V6VQI=","Content-Type":"multipart/signed; micalg=\"pgp-sha512\";\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"=-SojVx5oJMe+e/6sQFhKC\"","User-Agent":"Evolution 3.56.2 (3.56.2-1.fc42) ","MIME-Version":"1.0","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>"}}]