[{"id":27463,"web_url":"https://patchwork.libcamera.org/comment/27463/","msgid":"<b666f2b92c619e0262bbdcb2926fb6f3f3478a83.camel@collabora.com>","date":"2023-07-04T18:05:11","subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Hi,\n\nLe mardi 04 juillet 2023 à 17:53 +0200, Umang Jain a écrit :\n> Test the enumeration of the cameras through GstDeviceProvider against\n> the libcamera camera manager.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  test/gstreamer/gstreamer_test.cpp | 52 +++++++++++++++++++++++++++++++\n>  test/gstreamer/gstreamer_test.h   |  1 +\n>  2 files changed, 53 insertions(+)\n> \n> diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n> index 6ad0c15c..f94f3fd9 100644\n> --- a/test/gstreamer/gstreamer_test.cpp\n> +++ b/test/gstreamer/gstreamer_test.cpp\n> @@ -27,6 +27,18 @@ const char *__asan_default_options()\n>  }\n>  }\n>  \n> +static GstDeviceMonitor *\n> +libcamerasrc_get_device_provider()\n> +{\n> +\tGstDeviceMonitor *monitor = gst_device_monitor_new();\n> +\n> +\tgst_device_monitor_add_filter(monitor, \"Video/Source\", NULL);\n> +\n> +\tgst_device_monitor_start(monitor);\n> +\n> +\treturn monitor;\n> +}\n> +\n>  GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t: pipeline_(nullptr), libcameraSrc_(nullptr)\n>  {\n> @@ -78,6 +90,12 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t\treturn;\n>  \t}\n>  \n> +\tif (!checkCameraEnumeration()) {\n> +\t\tg_printerr(\"Failed to enumerate cameras on GstDeviceProvider\\n\");\n> +\t\tstatus_ = TestFail;\n> +\t\treturn;\n> +\t}\n> +\n>  \tstatus_ = TestPass;\n>  }\n>  \n> @@ -102,6 +120,40 @@ bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStream\n>  \treturn cameraFound;\n>  }\n>  \n> +bool GstreamerTest::checkCameraEnumeration()\n> +{\n> +\tGstDeviceMonitor *monitor;\n> +\tGList *devices, *l;\n> +\tstd::vector<const char *> cameraNames;\n> +\tstd::unique_ptr<libcamera::CameraManager> cm\n> +\t\t= std::make_unique<libcamera::CameraManager>();\n> +\n> +\tcm->start();\n> +\tfor (auto &camera : cm->cameras())\n> +\t\tcameraNames.push_back(strdup(camera->id().c_str()));\n> +\tcm->stop();\n> +\tcm.reset();\n> +\n> +\tmonitor = libcamerasrc_get_device_provider();\n> +\tdevices = gst_device_monitor_get_devices(monitor);\n> +\n> +\tfor (l = devices; l != NULL; l = g_list_next(l)) {\n> +\t\tbool matched = false;\n> +\t\tGstDevice *device = GST_DEVICE(l->data);\n> +\t\tfor (const gchar *name : cameraNames) {\n> +\t\t\tif (strcmp(name, gst_device_get_display_name(device)) == 0) {\n> +\t\t\t\tmatched = true;\n> +\t\t\t\tbreak;\n> +\t\t\t}\n\nJust to note that its a bug that gst_device_get_display_name() returns the\ncamera->id() (which was initially set to the human friendly name). In order to\navoid testing a bug, I'd probably go with:\n\n\t\t\tg_autofree gchar *gst_name;\n\t\t\tg_autoptr(GstElement) element = gst_device_create_element (device);\n\t\t\tg_object_get(element, \"camera-name\", &gst_name, NULL);\n\t\t\tif (strcmp(name, gst_name) == 0) {\t\t\t\tmatched = true;\n\t\t\t\tbreak;\n\t\t\t}\n\nFurther in the future, I'd be happy if camera-name, becomes read-only friendly\nname, and camera-id becomes the configurable property. The naming have not been\nported wiht the changes in libcamera.\n\nWith this change:\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\t\t\n> +\t\t}\n> +\n> +\t\tif (!matched)\n> +\t\t\treturn false;\n> +\t}\n> +\n> +\treturn true;\n> +}\n> +\n>  GstreamerTest::~GstreamerTest()\n>  {\n>  \tg_clear_object(&pipeline_);\n> diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h\n> index aa2261e2..3479c7c4 100644\n> --- a/test/gstreamer/gstreamer_test.h\n> +++ b/test/gstreamer/gstreamer_test.h\n> @@ -31,4 +31,5 @@ protected:\n>  \n>  private:\n>  \tbool checkMinCameraStreamsAndSetCameraName(unsigned int numStreams);\n> +\tbool checkCameraEnumeration();\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 12FA0BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Jul 2023 18:05:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B0C261E38;\n\tTue,  4 Jul 2023 20:05:22 +0200 (CEST)","from madras.collabora.co.uk (madras.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CD6260384\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jul 2023 20:05:21 +0200 (CEST)","from nicolas-tpx395.localdomain (unknown\n\t[IPv6:2606:6d00:10:88d9::7a9])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby madras.collabora.co.uk (Postfix) with ESMTPSA id 6A03866003B2;\n\tTue,  4 Jul 2023 19:05:20 +0100 (BST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688493922;\n\tbh=5qmw+rAyXv7nmtu5UDpOLr9F9o8NogSOdTmiZsHuQt0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=D+do3DMxTYv9zU5YTTslvEioPY1mBefl3pnFzV8zK/YV0K7R06T2e1Xlp1osVFnJ6\n\te2rhMXEtLmmE7ekMmaws1F2kxkxIgoklqQTewW3+/YeTSUfwkCPK6AKfXE/QZ3UYeg\n\ta9a5jVt7Xg4AIURI229/XXrEJ5lc8rWaDH+KwNciWi7jUqoJEhCb/x/VES3szLgV/h\n\t6RgoMSf9Cck6gI/ylJnjxksyplCiNV2jPuyGOB4hLz5WApQOFAffd4TkPsIU84Cl3O\n\t2xJm6HPEAH+eL8Zz6xTrE9vz2kKRdLgZ+e+E63iaUJH92BeQMMVK4cHlftu7AEqLQP\n\t5ahJtfqs1HeJA==","v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1688493920;\n\tbh=5qmw+rAyXv7nmtu5UDpOLr9F9o8NogSOdTmiZsHuQt0=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=BAw08i6mUjZjSh9UXOM1c/rhEdQsq/4fAya8z+EWUXUuR72YIA33j92z9HFvJQEof\n\t5e6y3VV+1TkZrRR4BpgdvBMgOmWWca+YCRTVkXH8kJ745iQ+DhHBpp4suts5fkVOOI\n\t86r7pDEAZElEFqZaiuvBwwVsNpKvoXVvhRC4gXfpTVsjdjs3CKscIpdXSoSOHOzCsO\n\tf8XBiOtTnZFC0IAmJ79z3ESTkMxbo18SZhiZ19HZi5d07Ky3bNSN1pbHqSLIPV5icK\n\t0wI6a5vh05cU+Dno1nD+PLT6LgKujA4GxPyR+Z5DzjaKFOaJ3dlm9tT3YbwMHa3e9Q\n\tn/m8SFywETvWA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"BAw08i6m\"; dkim-atps=neutral","Message-ID":"<b666f2b92c619e0262bbdcb2926fb6f3f3478a83.camel@collabora.com>","To":"Umang Jain <umang.jain@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 04 Jul 2023 14:05:11 -0400","In-Reply-To":"<20230704155329.28734-1-umang.jain@ideasonboard.com>","References":"<20230704155329.28734-1-umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.3 (3.48.3-1.fc38) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","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>","From":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"vedantparanjape160201@gmail.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27464,"web_url":"https://patchwork.libcamera.org/comment/27464/","msgid":"<712f2c4d-ad9b-91a3-eac7-e964c2122833@ideasonboard.com>","date":"2023-07-04T18:16:33","subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Nicolas\n\nOn 7/4/23 8:05 PM, Nicolas Dufresne wrote:\n> Hi,\n>\n> Le mardi 04 juillet 2023 à 17:53 +0200, Umang Jain a écrit :\n>> Test the enumeration of the cameras through GstDeviceProvider against\n>> the libcamera camera manager.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   test/gstreamer/gstreamer_test.cpp | 52 +++++++++++++++++++++++++++++++\n>>   test/gstreamer/gstreamer_test.h   |  1 +\n>>   2 files changed, 53 insertions(+)\n>>\n>> diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n>> index 6ad0c15c..f94f3fd9 100644\n>> --- a/test/gstreamer/gstreamer_test.cpp\n>> +++ b/test/gstreamer/gstreamer_test.cpp\n>> @@ -27,6 +27,18 @@ const char *__asan_default_options()\n>>   }\n>>   }\n>>   \n>> +static GstDeviceMonitor *\n>> +libcamerasrc_get_device_provider()\n>> +{\n>> +\tGstDeviceMonitor *monitor = gst_device_monitor_new();\n>> +\n>> +\tgst_device_monitor_add_filter(monitor, \"Video/Source\", NULL);\n>> +\n>> +\tgst_device_monitor_start(monitor);\n>> +\n>> +\treturn monitor;\n>> +}\n>> +\n>>   GstreamerTest::GstreamerTest(unsigned int numStreams)\n>>   \t: pipeline_(nullptr), libcameraSrc_(nullptr)\n>>   {\n>> @@ -78,6 +90,12 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n>>   \t\treturn;\n>>   \t}\n>>   \n>> +\tif (!checkCameraEnumeration()) {\n>> +\t\tg_printerr(\"Failed to enumerate cameras on GstDeviceProvider\\n\");\n>> +\t\tstatus_ = TestFail;\n>> +\t\treturn;\n>> +\t}\n>> +\n>>   \tstatus_ = TestPass;\n>>   }\n>>   \n>> @@ -102,6 +120,40 @@ bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStream\n>>   \treturn cameraFound;\n>>   }\n>>   \n>> +bool GstreamerTest::checkCameraEnumeration()\n>> +{\n>> +\tGstDeviceMonitor *monitor;\n>> +\tGList *devices, *l;\n>> +\tstd::vector<const char *> cameraNames;\n>> +\tstd::unique_ptr<libcamera::CameraManager> cm\n>> +\t\t= std::make_unique<libcamera::CameraManager>();\n>> +\n>> +\tcm->start();\n>> +\tfor (auto &camera : cm->cameras())\n>> +\t\tcameraNames.push_back(strdup(camera->id().c_str()));\n>> +\tcm->stop();\n>> +\tcm.reset();\n>> +\n>> +\tmonitor = libcamerasrc_get_device_provider();\n>> +\tdevices = gst_device_monitor_get_devices(monitor);\n>> +\n>> +\tfor (l = devices; l != NULL; l = g_list_next(l)) {\n>> +\t\tbool matched = false;\n>> +\t\tGstDevice *device = GST_DEVICE(l->data);\n>> +\t\tfor (const gchar *name : cameraNames) {\n>> +\t\t\tif (strcmp(name, gst_device_get_display_name(device)) == 0) {\n>> +\t\t\t\tmatched = true;\n>> +\t\t\t\tbreak;\n>> +\t\t\t}\n> Just to note that its a bug that gst_device_get_display_name() returns the\n> camera->id() (which was initially set to the human friendly name). In order to\n\nWe have discussed human friendly names in the past and we didn't find a \nconclusion since they are not static across reboots. So it's a problem \nin itself that we need to look into.\n\nFor cam utility, we parse it differently based on location and/or model [1]\n\n[1] \nhttps://git.libcamera.org/libcamera/libcamera.git/tree/src/apps/cam/main.cpp#n298\n\n> avoid testing a bug, I'd probably go with:\n>\n> \t\t\tg_autofree gchar *gst_name;\n> \t\t\tg_autoptr(GstElement) element = gst_device_create_element (device);\n> \t\t\tg_object_get(element, \"camera-name\", &gst_name, NULL);\n> \t\t\tif (strcmp(name, gst_name) == 0) {\t\t\t\tmatched = true;\n> \t\t\t\tbreak;\n> \t\t\t}\n>\n> Further in the future, I'd be happy if camera-name, becomes read-only friendly\n> name, and camera-id becomes the configurable property. The naming have not been\n> ported wiht the changes in libcamera.\n>\n> With this change:\n>\n> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \t\t\n>> +\t\t}\n>> +\n>> +\t\tif (!matched)\n>> +\t\t\treturn false;\n>> +\t}\n>> +\n>> +\treturn true;\n>> +}\n>> +\n>>   GstreamerTest::~GstreamerTest()\n>>   {\n>>   \tg_clear_object(&pipeline_);\n>> diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h\n>> index aa2261e2..3479c7c4 100644\n>> --- a/test/gstreamer/gstreamer_test.h\n>> +++ b/test/gstreamer/gstreamer_test.h\n>> @@ -31,4 +31,5 @@ protected:\n>>   \n>>   private:\n>>   \tbool checkMinCameraStreamsAndSetCameraName(unsigned int numStreams);\n>> +\tbool checkCameraEnumeration();\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 1BA58BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Jul 2023 18:16:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 85E32628BD;\n\tTue,  4 Jul 2023 20:16:39 +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 CF30F61E38\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jul 2023 20:16:37 +0200 (CEST)","from [192.168.0.136] (85-160-42-71.reb.o2.cz [85.160.42.71])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CCFF96DF;\n\tTue,  4 Jul 2023 20:15:52 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688494599;\n\tbh=FVcWsZeedMNkIZJjPhRrjiDONv0XPfsUptj761hqe/E=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Aeh6VzJzgEObm+hDddfXn4LAo2I2mWrfLp0PEkwbZbEOkhCkO+cVFLufZYd0GG0Wl\n\tA4S6Y0YHKJW1W2zvg9d6xPM5VsAeSSW6nhW2bpZNtzHj4yXBAFbhHWx8DzoIGIe2tt\n\tJveSmUqhtTivfMi+QgEfHzvmu1t2YoN/Rw8k4f/Nk0MDhTmh45pkBuXryG6TGnOEQh\n\thDw/IGqU5FwGFReOAI13SdUB4O5iJdXyrQb6AMV86pdb7rQsZALvcsBXkpRQiuSEmW\n\tFQnBDLdkWGOMcjGAQIC+6a5QA0XJTrRFDgOem3OCW67jXkp/59glJPAvOo3sXlwSQb\n\tkOttLCH6Ymapg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688494553;\n\tbh=FVcWsZeedMNkIZJjPhRrjiDONv0XPfsUptj761hqe/E=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=J4Jrb0aoi691TVMdSNcLSyxxFWu6OvFiAFVQpP56YCejLA6S2vpiTf8nSHwIODf4u\n\tBg/dDGVDYfipWpSt7+JdpmvqsuxvJf7zlkdF1ol5evTLmt9nOu4LXpU55Z+4VAF6Z9\n\tt3JIMxIF+WsvXhR0i1hny39OGKS+Xp/jIEtv1fEQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"J4Jrb0ao\"; dkim-atps=neutral","Message-ID":"<712f2c4d-ad9b-91a3-eac7-e964c2122833@ideasonboard.com>","Date":"Tue, 4 Jul 2023 20:16:33 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.7.1","To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20230704155329.28734-1-umang.jain@ideasonboard.com>\n\t<b666f2b92c619e0262bbdcb2926fb6f3f3478a83.camel@collabora.com>","Content-Language":"en-US","In-Reply-To":"<b666f2b92c619e0262bbdcb2926fb6f3f3478a83.camel@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"vedantparanjape160201@gmail.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27468,"web_url":"https://patchwork.libcamera.org/comment/27468/","msgid":"<YgaxBn71tb893EzX-SxNoBM9a14nJ_5yHEg-1w-tCpmuQIW6x4MlFEHj-nDIP3xRFwIDcs327v8cFM9MfcBmYfUppNdcWwx0YQSuxPaDbjU=@protonmail.com>","date":"2023-07-04T18:50:43","subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n\n2023. július 4., kedd 17:53 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org> írta:\n\n> Test the enumeration of the cameras through GstDeviceProvider against\n> the libcamera camera manager.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  test/gstreamer/gstreamer_test.cpp | 52 +++++++++++++++++++++++++++++++\n>  test/gstreamer/gstreamer_test.h   |  1 +\n>  2 files changed, 53 insertions(+)\n> \n> diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n> index 6ad0c15c..f94f3fd9 100644\n> --- a/test/gstreamer/gstreamer_test.cpp\n> +++ b/test/gstreamer/gstreamer_test.cpp\n> @@ -27,6 +27,18 @@ const char *__asan_default_options()\n>  }\n>  }\n> \n> +static GstDeviceMonitor *\n> +libcamerasrc_get_device_provider()\n> +{\n> +\tGstDeviceMonitor *monitor = gst_device_monitor_new();\n> +\n> +\tgst_device_monitor_add_filter(monitor, \"Video/Source\", NULL);\n> +\n> +\tgst_device_monitor_start(monitor);\n> +\n> +\treturn monitor;\n> +}\n> +\n>  GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t: pipeline_(nullptr), libcameraSrc_(nullptr)\n>  {\n> @@ -78,6 +90,12 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t\treturn;\n>  \t}\n> \n> +\tif (!checkCameraEnumeration()) {\n> +\t\tg_printerr(\"Failed to enumerate cameras on GstDeviceProvider\\n\");\n> +\t\tstatus_ = TestFail;\n> +\t\treturn;\n> +\t}\n> +\n>  \tstatus_ = TestPass;\n>  }\n> \n> @@ -102,6 +120,40 @@ bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStream\n>  \treturn cameraFound;\n>  }\n> \n> +bool GstreamerTest::checkCameraEnumeration()\n> +{\n> +\tGstDeviceMonitor *monitor;\n> +\tGList *devices, *l;\n> +\tstd::vector<const char *> cameraNames;\n> +\tstd::unique_ptr<libcamera::CameraManager> cm\n> +\t\t= std::make_unique<libcamera::CameraManager>();\n> +\n> +\tcm->start();\n> +\tfor (auto &camera : cm->cameras())\n> +\t\tcameraNames.push_back(strdup(camera->id().c_str()));\n> [...]\n\nAs far as I can tell these strings will be leaked. Why not use `std::string`?\n\n\nRegards,\nBarnabás Pőcze","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 A9328BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Jul 2023 18:50:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 14ED661E38;\n\tTue,  4 Jul 2023 20:50:53 +0200 (CEST)","from mail-40134.protonmail.ch (mail-40134.protonmail.ch\n\t[185.70.40.134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A47C860384\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jul 2023 20:50:51 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688496653;\n\tbh=9Q6fduk63E3WYoP3ZLjO3cDIrCaAlZgBUNHQTaLiOxo=;\n\th=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=RIjK352tMG1U/7dovS7ql4N2kZoe1JKC7oc/yjLKp0fDqQzgwnwaYunDwBKGk8u0i\n\tF9f9An7BrQbRAk+tHYxcdqJrcy+PkaMoWkWtBCuD6bC2ShaC1KiINJlEhp4lGaCqm2\n\tqQZbfcq9sRvxYx5+C7+DOy3D73tf3umThhoVY74eMKCxCVRlVqEhqnisnSQnn9rWaD\n\tRlS4iaSEotFr5l70nVHV4YUHenpkEYxwa7jWmCu9FXCMiM6VEwysgMtEMtDmHahsrh\n\tjdhmnKlWITO6cNeB5rDZe0s8P5T512tWgFB0dpuEnT0r+Rad0rkHyMwKsq//uwJ0LJ\n\tIA1azyt8tJX4A==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1688496651; x=1688755851;\n\tbh=akUPfOAc68qI9FfXZz0xmInrU+oj0I16IVEF2LbsjRA=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector;\n\tb=G9LltgcefTDotsK2/6N9MVv6YTznd8dHlnELkUeimxOOKGRF2X3oeAcBWEylOQl0w\n\tjad87eUUnUBp+ZjMPzXlSxFvuatjfPSDZjz5WZRI35OZFqoTgvZyv6nyQadpzkT2+g\n\t/NZESysEtb0+ZmoPNIiylLH8601z37+d4xvRLNfK1cB65U3CyoaoXq832ppMXy0bYc\n\tPCgO7j/kog8CXtM5QtcQQmFWcGT9bzH5jSTU8QqX7UPAVVV8N3v2GwWtevUIbFlVhg\n\tYUo+QM9zOqcibcNi18z13+eJjx/FzoRyTcdh0Cyr4TbWwpZfwSGPsoyyTg8wBYP+OA\n\tTdWhfArR8Yv7w=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=protonmail.com\n\theader.i=@protonmail.com\n\theader.b=\"G9Lltgce\"; dkim-atps=neutral","Date":"Tue, 04 Jul 2023 18:50:43 +0000","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<YgaxBn71tb893EzX-SxNoBM9a14nJ_5yHEg-1w-tCpmuQIW6x4MlFEHj-nDIP3xRFwIDcs327v8cFM9MfcBmYfUppNdcWwx0YQSuxPaDbjU=@protonmail.com>","In-Reply-To":"<20230704155329.28734-1-umang.jain@ideasonboard.com>","References":"<20230704155329.28734-1-umang.jain@ideasonboard.com>","Feedback-ID":"20568564:user:proton","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","Subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","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>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org, vedantparanjape160201@gmail.com,\n\tnicolas.dufresne@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27469,"web_url":"https://patchwork.libcamera.org/comment/27469/","msgid":"<48307ff8f0eaf05b442e680af56ad1fe5b3b9b4f.camel@collabora.com>","date":"2023-07-04T19:10:55","subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","submitter":{"id":168,"url":"https://patchwork.libcamera.org/api/people/168/","name":"Olivier Crête","email":"olivier.crete@collabora.com"},"content":"On Tue, 2023-07-04 at 17:53 +0200, Umang Jain via libcamera-devel\nwrote:\n> Test the enumeration of the cameras through GstDeviceProvider against\n> the libcamera camera manager.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  test/gstreamer/gstreamer_test.cpp | 52 +++++++++++++++++++++++++++++++\n>  test/gstreamer/gstreamer_test.h   |  1 +\n>  2 files changed, 53 insertions(+)\n> \n> diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n> index 6ad0c15c..f94f3fd9 100644\n> --- a/test/gstreamer/gstreamer_test.cpp\n> +++ b/test/gstreamer/gstreamer_test.cpp\n> @@ -27,6 +27,18 @@ const char *__asan_default_options()\n>  }\n>  }\n>  \n> +static GstDeviceMonitor *\n> +libcamerasrc_get_device_provider()\n> +{\n> +\tGstDeviceMonitor *monitor = gst_device_monitor_new();\n> +\n> +\tgst_device_monitor_add_filter(monitor, \"Video/Source\", NULL);\n> +\n> +\tgst_device_monitor_start(monitor);\n> +\n> +\treturn monitor;\n> +}\n\n\nYou may instead want to do something like to make sure your testing the\nprovider you actually want to test:\n\nGstDeviceProviderFactory *factory = gst_device_provider_factory_find\n(\"libcameraprovider\");\nGstDeviceProvider *provider = gst_device_provider_factory_get (fact);\ngst_object_unref(fact);\n\nGList *devices = gst_device_provider_get_devices(provider);\n\n// validate devices\n\ng_list_free_full (devices, gst_object_unref);\ngst_object_unref(provider);\n\nOlivier\n\n> +\n>  GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t: pipeline_(nullptr), libcameraSrc_(nullptr)\n>  {\n> @@ -78,6 +90,12 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n>  \t\treturn;\n>  \t}\n>  \n> +\tif (!checkCameraEnumeration()) {\n> +\t\tg_printerr(\"Failed to enumerate cameras on GstDeviceProvider\\n\");\n> +\t\tstatus_ = TestFail;\n> +\t\treturn;\n> +\t}\n> +\n>  \tstatus_ = TestPass;\n>  }\n>  \n> @@ -102,6 +120,40 @@ bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStream\n>  \treturn cameraFound;\n>  }\n>  \n> +bool GstreamerTest::checkCameraEnumeration()\n> +{\n> +\tGstDeviceMonitor *monitor;\n> +\tGList *devices, *l;\n> +\tstd::vector<const char *> cameraNames;\n> +\tstd::unique_ptr<libcamera::CameraManager> cm\n> +\t\t= std::make_unique<libcamera::CameraManager>();\n> +\n> +\tcm->start();\n> +\tfor (auto &camera : cm->cameras())\n> +\t\tcameraNames.push_back(strdup(camera->id().c_str()));\n> +\tcm->stop();\n> +\tcm.reset();\n> +\n> +\tmonitor = libcamerasrc_get_device_provider();\n> +\tdevices = gst_device_monitor_get_devices(monitor);\n> +\n> +\tfor (l = devices; l != NULL; l = g_list_next(l)) {\n> +\t\tbool matched = false;\n> +\t\tGstDevice *device = GST_DEVICE(l->data);\n> +\t\tfor (const gchar *name : cameraNames) {\n> +\t\t\tif (strcmp(name, gst_device_get_display_name(device)) == 0) {\n> +\t\t\t\tmatched = true;\n> +\t\t\t\tbreak;\n> +\t\t\t}\n> +\t\t}\n> +\n> +\t\tif (!matched)\n> +\t\t\treturn false;\n> +\t}\n> +\n> +\treturn true;\n> +}\n> +\n>  GstreamerTest::~GstreamerTest()\n>  {\n>  \tg_clear_object(&pipeline_);\n> diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h\n> index aa2261e2..3479c7c4 100644\n> --- a/test/gstreamer/gstreamer_test.h\n> +++ b/test/gstreamer/gstreamer_test.h\n> @@ -31,4 +31,5 @@ protected:\n>  \n>  private:\n>  \tbool checkMinCameraStreamsAndSetCameraName(unsigned int numStreams);\n> +\tbool checkCameraEnumeration();\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 325D4BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Jul 2023 19:11:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7F80561E38;\n\tTue,  4 Jul 2023 21:11:02 +0200 (CEST)","from madras.collabora.co.uk (madras.collabora.co.uk\n\t[46.235.227.172])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA35060384\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jul 2023 21:11:00 +0200 (CEST)","from [IPv6:2806:2f0:91a0:7b61:810b:b8f8:da68:2811] (unknown\n\t[IPv6:2806:2f0:91a0:7b61:810b:b8f8:da68:2811])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: tester)\n\tby madras.collabora.co.uk (Postfix) with ESMTPSA id 9072B66003AC;\n\tTue,  4 Jul 2023 20:10:59 +0100 (BST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688497862;\n\tbh=+YEmZpuE0o7HNYQeZu9UGGd1WtBcF6nvyYQAvJQ4eFY=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=LaZ9phM2pl9FV8FKgHcG54HNXhh9a5V1E8NxKmcjfrjY1GXSpsREH1oWydNgpQvJM\n\tsQGtnUp+/EBQtjqz9K94nuz2vS+HApPTc+ucIfCmGwE5bGGtM1SEO8ExbHN9nZrWRd\n\t4SAAQ5zoLPUUDvZvwZ1nIRqfiOedYSv9vG9eEMs9Tkz+9MChITmeA/1JLuIq6Mlya1\n\tAU5PgI+nxQ24dfuJsNXwt5V6G+fUeyoYpVWhPPKZgzbMtukU6A6s+DS1eT7RW1O4IG\n\tDyx+Rh20hH6Guf5KI+L0chedgY38tfWt3mvSarXIcVLr9VGtGXAY32HJt9bAr/Vuhi\n\twdUQB59sfbKAQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1688497860;\n\tbh=+YEmZpuE0o7HNYQeZu9UGGd1WtBcF6nvyYQAvJQ4eFY=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=SmfjZOck3QfrYfGldzsg8erzJn1aIHNkBuXzJh4No3N8g7XIJ9HhVNnh7Tuv+S3H8\n\t4/oirLaSs48tDp5CXysEn6ALMNgKvaRvc1T/vQ7e2Ob3gpVtJVQsCEOQk38Ydx8i86\n\t9kcWPGxqouJID1xHF2p1ymFGfABphH4srSd3MECO6u3LWlGq57dSOSzeszEtBvpXaq\n\tublvDuqJi4Nn5h39mS0/+oaUtQlmne/YhFiGDur0GN/q+qniR2oVjlYEMPWYiVTeBH\n\tx+74lMGw7/YQMXvhiMucz9i3+oEdn723zjnpTy5t+9QwmJ7cddhmOGtmo/fPAqBqET\n\thSHevJkbW/f9g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"SmfjZOck\"; dkim-atps=neutral","Message-ID":"<48307ff8f0eaf05b442e680af56ad1fe5b3b9b4f.camel@collabora.com>","To":"Umang Jain <umang.jain@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 04 Jul 2023 13:10:55 -0600","In-Reply-To":"<20230704155329.28734-1-umang.jain@ideasonboard.com>","References":"<20230704155329.28734-1-umang.jain@ideasonboard.com>","Organization":"Collabora","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.3 (3.48.3-1.fc38) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","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>","From":"=?utf-8?q?Olivier_Cr=C3=AAte_via_libcamera-devel?=\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Olivier =?iso-8859-1?q?Cr=EAte?= <olivier.crete@collabora.com>","Cc":"nicolas.dufresne@collabora.com, vedantparanjape160201@gmail.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27472,"web_url":"https://patchwork.libcamera.org/comment/27472/","msgid":"<73201d88-c7cd-4064-df76-87be3bbacadb@ideasonboard.com>","date":"2023-07-04T19:27:26","subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Barnabás,\n\nOn 7/4/23 8:50 PM, Barnabás Pőcze wrote:\n> Hi\n>\n>\n> 2023. július 4., kedd 17:53 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org> írta:\n>\n>> Test the enumeration of the cameras through GstDeviceProvider against\n>> the libcamera camera manager.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   test/gstreamer/gstreamer_test.cpp | 52 +++++++++++++++++++++++++++++++\n>>   test/gstreamer/gstreamer_test.h   |  1 +\n>>   2 files changed, 53 insertions(+)\n>>\n>> diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\n>> index 6ad0c15c..f94f3fd9 100644\n>> --- a/test/gstreamer/gstreamer_test.cpp\n>> +++ b/test/gstreamer/gstreamer_test.cpp\n>> @@ -27,6 +27,18 @@ const char *__asan_default_options()\n>>   }\n>>   }\n>>\n>> +static GstDeviceMonitor *\n>> +libcamerasrc_get_device_provider()\n>> +{\n>> +\tGstDeviceMonitor *monitor = gst_device_monitor_new();\n>> +\n>> +\tgst_device_monitor_add_filter(monitor, \"Video/Source\", NULL);\n>> +\n>> +\tgst_device_monitor_start(monitor);\n>> +\n>> +\treturn monitor;\n>> +}\n>> +\n>>   GstreamerTest::GstreamerTest(unsigned int numStreams)\n>>   \t: pipeline_(nullptr), libcameraSrc_(nullptr)\n>>   {\n>> @@ -78,6 +90,12 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)\n>>   \t\treturn;\n>>   \t}\n>>\n>> +\tif (!checkCameraEnumeration()) {\n>> +\t\tg_printerr(\"Failed to enumerate cameras on GstDeviceProvider\\n\");\n>> +\t\tstatus_ = TestFail;\n>> +\t\treturn;\n>> +\t}\n>> +\n>>   \tstatus_ = TestPass;\n>>   }\n>>\n>> @@ -102,6 +120,40 @@ bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStream\n>>   \treturn cameraFound;\n>>   }\n>>\n>> +bool GstreamerTest::checkCameraEnumeration()\n>> +{\n>> +\tGstDeviceMonitor *monitor;\n>> +\tGList *devices, *l;\n>> +\tstd::vector<const char *> cameraNames;\n>> +\tstd::unique_ptr<libcamera::CameraManager> cm\n>> +\t\t= std::make_unique<libcamera::CameraManager>();\n>> +\n>> +\tcm->start();\n>> +\tfor (auto &camera : cm->cameras())\n>> +\t\tcameraNames.push_back(strdup(camera->id().c_str()));\n>> [...]\n> As far as I can tell these strings will be leaked. Why not use `std::string`?\n\nik, yes these are leaked, thanks for noticing.\n>\n>\n> Regards,\n> Barnabás Pőcze","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 D8DCEBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Jul 2023 19:27:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2B4F7628C0;\n\tTue,  4 Jul 2023 21:27:31 +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 E3AAB60384\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jul 2023 21:27:29 +0200 (CEST)","from [192.168.0.136] (85-160-42-71.reb.o2.cz [85.160.42.71])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3730D8C1;\n\tTue,  4 Jul 2023 21:26:45 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1688498851;\n\tbh=SQDSo+RkUuiE6DZcBQDfUDoTwVO4h0DtY3a3neNEgrQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=rAR0e8YBBZCi24KuJvSuNWsSw+8/wnitMgNWsltLECXqABV0cTyFCZgJWnUmqpcGq\n\tQrF9GZUnp/2MLxLORdtM4m9kqzIKpNGfeAh8MY0dqvIc5nns2aTZBkY/obiCh46dbX\n\tZ1tz/Rd9zU4JVG6z/fKD/T+liuPVZMThgLdJWWWGcUNjJqDudWYWJVYYpzDhcrrdtT\n\tgpVZDWT2IyLvglz9HDBJBr057iTg5Ff3wgsXghdlBiVz36O5QDAhE7MN8Z4Ja4QQ0Q\n\t9N+Jyk5llDow7Bc9g7BRt4XBaZMZQW246YBSD8a+xKuBLWssuktBvnVEM+3w4PfDDW\n\t8dXYbHn5bX5gw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1688498805;\n\tbh=SQDSo+RkUuiE6DZcBQDfUDoTwVO4h0DtY3a3neNEgrQ=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=QPF+6CjhrcY1qEAXBEwDx53Wd9GaWUDdTxoJocoJ3btucPFQwdv8Cwfv5zCoLe9gY\n\tMoiGd0wA3DzUg4lsHz2Hzyqx2ChoNtwcEB8BEylq/qiUAMJ8HbEcXL5aS/nM494QM9\n\t417tzgpQXYQPNN8Q3zpc6JW/KzohcdPOObUnvdUU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QPF+6Cjh\"; dkim-atps=neutral","Message-ID":"<73201d88-c7cd-4064-df76-87be3bbacadb@ideasonboard.com>","Date":"Tue, 4 Jul 2023 21:27:26 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.7.1","Content-Language":"en-US","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","References":"<20230704155329.28734-1-umang.jain@ideasonboard.com>\n\t<YgaxBn71tb893EzX-SxNoBM9a14nJ_5yHEg-1w-tCpmuQIW6x4MlFEHj-nDIP3xRFwIDcs327v8cFM9MfcBmYfUppNdcWwx0YQSuxPaDbjU=@protonmail.com>","In-Reply-To":"<YgaxBn71tb893EzX-SxNoBM9a14nJ_5yHEg-1w-tCpmuQIW6x4MlFEHj-nDIP3xRFwIDcs327v8cFM9MfcBmYfUppNdcWwx0YQSuxPaDbjU=@protonmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] tests: gstreamer: Test cameras'\n\tenumeration from GstDeviceProvider","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, vedantparanjape160201@gmail.com,\n\tnicolas.dufresne@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]