[{"id":28518,"web_url":"https://patchwork.libcamera.org/comment/28518/","msgid":"<20240122110033.GB26784@pendragon.ideasonboard.com>","date":"2024-01-22T11:00:33","subject":"Re: [libcamera-devel] [PATCH v2 2/2] test: gstreamer: Use env\n\tinstead of registry edit","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicolas,\n\nThank you for the patch.\n\nOn Fri, Jan 19, 2024 at 03:08:48PM -0500, Nicolas Dufresne via libcamera-devel wrote:\n> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \n> Instead of editing the registry, use gst_env variable provided by the plugin and\n> already used as part of the devenv shell. This reduces the complexity of the\n> C++ test code.\n> \n> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nI like this :-)\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI'll run this through local and CI tests, and apply it if no issue is\nfound.\n\n> ---\n> New in V2\n> \n>  test/gstreamer/gstreamer_test.cpp | 17 -----------------\n>  test/gstreamer/meson.build        |  2 +-\n>  2 files changed, 1 insertion(+), 18 deletions(-)\n> \n> diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n> index 091f7bf7..e8119b85 100644\n> --- a/test/gstreamer/gstreamer_test.cpp\n> +++ b/test/gstreamer/gstreamer_test.cpp\n> @@ -51,23 +51,6 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t\treturn;\n>  \t}\n>  \n> -\t/*\n> -\t * Remove the system libcamera plugin, if any, and add the plugin from\n> -\t * the build directory.\n> -\t */\n> -\tGstRegistry *registry = gst_registry_get();\n> -\tg_autoptr(GstPlugin) plugin = gst_registry_lookup(registry, \"libgstlibcamera.so\");\n> -\tif (plugin)\n> -\t\tgst_registry_remove_plugin(registry, plugin);\n> -\n> -\tstd::string path = libcamera::utils::libcameraBuildPath() + \"src/gstreamer\";\n> -\tif (!gst_registry_scan_path(registry, path.c_str())) {\n> -\t\tg_printerr(\"Failed to add plugin to registry\\n\");\n> -\n> -\t\tstatus_ = TestFail;\n> -\t\treturn;\n> -\t}\n> -\n>  \t/*\n>  \t * Atleast one camera should be available with numStreams streams,\n>  \t * otherwise skip the test entirely.\n> diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build\n> index a5c003b6..f3ba5a23 100644\n> --- a/test/gstreamer/meson.build\n> +++ b/test/gstreamer/meson.build\n> @@ -17,5 +17,5 @@ foreach test : gstreamer_tests\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>  \n> -    test(test['name'], exe, suite : 'gstreamer', is_parallel : false)\n> +    test(test['name'], exe, suite : 'gstreamer', is_parallel : false, env : gst_env)\n>  endforeach","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 422ADC3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Jan 2024 11:00:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 94C0162948;\n\tMon, 22 Jan 2024 12:00:31 +0100 (CET)","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 5AA9162948\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jan 2024 12:00:29 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 27E78BEB;\n\tMon, 22 Jan 2024 11:59:16 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NTv072P4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1705921156;\n\tbh=A3SFEPiyQc/ci43rh+VpEUdNK587GveTXO4/eGd+Myw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NTv072P43DqTSG7owIFaCxoeilX4OQG5CGYbdUxbTbj2eDMuG9ZXR9Bw2f+OYTpbR\n\tWx80jP4yxXW3hn2TIUIzxGQZprZ6b9eMdJy0UsUw/MSJpvPT4fVLFDOwb7QCxEIBD1\n\tHC3ZMr0bkHkcwrgI35P14W6uxY61Qx3vFRruhKkA=","Date":"Mon, 22 Jan 2024 13:00:33 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] test: gstreamer: Use env\n\tinstead of registry edit","Message-ID":"<20240122110033.GB26784@pendragon.ideasonboard.com>","References":"<20240119200848.358298-1-nicolas@ndufresne.ca>\n\t<20240119200848.358298-2-nicolas@ndufresne.ca>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240119200848.358298-2-nicolas@ndufresne.ca>","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>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28539,"web_url":"https://patchwork.libcamera.org/comment/28539/","msgid":"<170593901668.1011926.5650561813652524039@ping.linuxembedded.co.uk>","date":"2024-01-22T15:56:56","subject":"Re: [libcamera-devel] [PATCH v2 2/2] test: gstreamer: Use env\n\tinstead of registry edit","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-01-22 11:00:33)\n> Hi Nicolas,\n> \n> Thank you for the patch.\n> \n> On Fri, Jan 19, 2024 at 03:08:48PM -0500, Nicolas Dufresne via libcamera-devel wrote:\n> > From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > \n> > Instead of editing the registry, use gst_env variable provided by the plugin and\n> > already used as part of the devenv shell. This reduces the complexity of the\n> > C++ test code.\n> > \n> > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \n> I like this :-)\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> I'll run this through local and CI tests, and apply it if no issue is\n> found.\n\nIndeed, sounds pretty good - and we can use this as a more standard way\nto handle things.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> \n> > ---\n> > New in V2\n> > \n> >  test/gstreamer/gstreamer_test.cpp | 17 -----------------\n> >  test/gstreamer/meson.build        |  2 +-\n> >  2 files changed, 1 insertion(+), 18 deletions(-)\n> > \n> > diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n> > index 091f7bf7..e8119b85 100644\n> > --- a/test/gstreamer/gstreamer_test.cpp\n> > +++ b/test/gstreamer/gstreamer_test.cpp\n> > @@ -51,23 +51,6 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n> >               return;\n> >       }\n> >  \n> > -     /*\n> > -      * Remove the system libcamera plugin, if any, and add the plugin from\n> > -      * the build directory.\n> > -      */\n> > -     GstRegistry *registry = gst_registry_get();\n> > -     g_autoptr(GstPlugin) plugin = gst_registry_lookup(registry, \"libgstlibcamera.so\");\n> > -     if (plugin)\n> > -             gst_registry_remove_plugin(registry, plugin);\n> > -\n> > -     std::string path = libcamera::utils::libcameraBuildPath() + \"src/gstreamer\";\n> > -     if (!gst_registry_scan_path(registry, path.c_str())) {\n> > -             g_printerr(\"Failed to add plugin to registry\\n\");\n> > -\n> > -             status_ = TestFail;\n> > -             return;\n> > -     }\n> > -\n> >       /*\n> >        * Atleast one camera should be available with numStreams streams,\n> >        * otherwise skip the test entirely.\n> > diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build\n> > index a5c003b6..f3ba5a23 100644\n> > --- a/test/gstreamer/meson.build\n> > +++ b/test/gstreamer/meson.build\n> > @@ -17,5 +17,5 @@ foreach test : gstreamer_tests\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >  \n> > -    test(test['name'], exe, suite : 'gstreamer', is_parallel : false)\n> > +    test(test['name'], exe, suite : 'gstreamer', is_parallel : false, env : gst_env)\n> >  endforeach\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 EE16ABDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Jan 2024 15:57:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A945362916;\n\tMon, 22 Jan 2024 16:57:00 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 394DF61D30\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jan 2024 16:56:59 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 48EBF221;\n\tMon, 22 Jan 2024 16:55:46 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mjwuqsdS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1705938946;\n\tbh=IPGUnLNHeROMoV++La9j16LJnsvyiUfO4cNCVaTjkHY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=mjwuqsdSfVpORt0jZsCgDIFfwnxYNZbRCv8uEX9nnzFzitaCOLTMP7ArzrLVUvO0p\n\t2fxj3DdNIRV63Xhcs3yiXVtwvLPaVep/awrWlF/5NF5/MWmmsJB8hm1lvIVnZkbHsf\n\tpd34pR/kqEK05MYRaKRaZKBXOxX0vG9dmCD6/lzU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240122110033.GB26784@pendragon.ideasonboard.com>","References":"<20240119200848.358298-1-nicolas@ndufresne.ca>\n\t<20240119200848.358298-2-nicolas@ndufresne.ca>\n\t<20240122110033.GB26784@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] test: gstreamer: Use env\n\tinstead of registry edit","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tNicolas Dufresne <nicolas@ndufresne.ca>","Date":"Mon, 22 Jan 2024 15:56:56 +0000","Message-ID":"<170593901668.1011926.5650561813652524039@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]