[{"id":34524,"web_url":"https://patchwork.libcamera.org/comment/34524/","msgid":"<f60f9117d8d0f5a3c961ef84a6ccc01e1d06556a.camel@collabora.com>","date":"2025-06-17T13:25:58","subject":"Re: [PATCH] gstreamer: Use std::exchange() instead of\n\tg_steal_pointer()","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Hi,\n\nLe mardi 17 juin 2025 à 01:06 +0300, Laurent Pinchart a écrit :\n> g_steal_pointer) only preserves the type since glib 2.68, requiring\n> casts. Use std::exchange() instead.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index ebea34e47b4d..e56cee282c59 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -1085,7 +1085,7 @@ gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ,\n>  \n>  \tgst_child_proxy_child_added(GST_CHILD_PROXY(self), G_OBJECT(pad), GST_OBJECT_NAME(pad));\n>  \n> -\treturn reinterpret_cast<GstPad *>(g_steal_pointer(&pad));\n> +\treturn std::exchange(pad, nullptr);\n>  }\n>  \n>  static void\n> \n> base-commit: b3ff75d7589a263412ad63008b3c8518d40e6316","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 3488CBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Jun 2025 13:26:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F0B2B68DCD;\n\tTue, 17 Jun 2025 15:26:02 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[148.251.105.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BBA7C68DB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Jun 2025 15:26:00 +0200 (CEST)","from [IPv6:2606:6d00:17:b699::5ac] (unknown\n\t[IPv6:2606:6d00:17:b699::5ac])\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 bali.collaboradmins.com (Postfix) with ESMTPSA id A45D217E03A5;\n\tTue, 17 Jun 2025 15:25:59 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=collabora.com header.i=@collabora.com\n\theader.b=\"anW7Hd8E\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1750166760;\n\tbh=XBXJHsbEnVwDhjY5xsCOB+WKsnSC96VnkI6YnRbOX1w=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=anW7Hd8EeIR767CTA5oyUUHfuhQWfUm5xU+WYUBTYckgLhNp7bW+YG60DWC+CMCSB\n\twp+lUsqzFaZGRa5fWKbgrbM8eO1gB+cCmSjXCvUnsz9KvAECkI0zVrXnmDXuvBqRgL\n\tpwb+5C1bzBPZ5SzaCR77lj+YJlcBYtGMmtTCikspxm0KgSHu+oCR9qIT9QzzU0hipI\n\tqqYSSZlipndNJfHmRDx7A2ksLEiW/FS2tmKv6QZimh7E420i2ZOn6m6PPEKN+a4MCm\n\td1HZ+UZ24t4xq30IUOV7i5vJSDzhXNvn4DBZuRqoR7a5pXuQMVo5yVexkrQUy7gTQG\n\toNZyqya3NMc3A==","Message-ID":"<f60f9117d8d0f5a3c961ef84a6ccc01e1d06556a.camel@collabora.com>","Subject":"Re: [PATCH] gstreamer: Use std::exchange() instead of\n\tg_steal_pointer()","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Date":"Tue, 17 Jun 2025 09:25:58 -0400","In-Reply-To":"<20250616220607.31416-1-laurent.pinchart@ideasonboard.com>","References":"<20250616220607.31416-1-laurent.pinchart@ideasonboard.com>","Organization":"Collabora Canada","Content-Type":"text/plain; charset=\"UTF-8\"","User-Agent":"Evolution 3.56.2 (3.56.2-1.fc42) ","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>"}},{"id":34528,"web_url":"https://patchwork.libcamera.org/comment/34528/","msgid":"<e32f2e21-d1d0-4756-ab6c-31f4b456973f@ideasonboard.com>","date":"2025-06-17T14:23:02","subject":"Re: [PATCH] gstreamer: Use std::exchange() instead of\n\tg_steal_pointer()","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 06. 17. 0:06 keltezéssel, Laurent Pinchart írta:\n> g_steal_pointer) only preserves the type since glib 2.68, requiring\n> casts. Use std::exchange() instead.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n> ---\n>   src/gstreamer/gstlibcamerasrc.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index ebea34e47b4d..e56cee282c59 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -1085,7 +1085,7 @@ gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ,\n>   \n>   \tgst_child_proxy_child_added(GST_CHILD_PROXY(self), G_OBJECT(pad), GST_OBJECT_NAME(pad));\n>   \n> -\treturn reinterpret_cast<GstPad *>(g_steal_pointer(&pad));\n> +\treturn std::exchange(pad, nullptr);\n>   }\n>   \n>   static void\n> \n> base-commit: b3ff75d7589a263412ad63008b3c8518d40e6316","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 19263BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Jun 2025 14:23:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0C4DB68DD0;\n\tTue, 17 Jun 2025 16:23:08 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B46C68DC3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Jun 2025 16:23:06 +0200 (CEST)","from [192.168.33.11] (185.221.143.107.nat.pool.zt.hu\n\t[185.221.143.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 03A11496;\n\tTue, 17 Jun 2025 16:22: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=\"mT+eiWZq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750170174;\n\tbh=NHZBGW0HzRpG2VsDRkO01BsrYuMcP5OeQ7HlOChZ8Bs=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=mT+eiWZqY93PGm2aw6vp6SZQ71xkTFxmjVced9reRdBCzUyQvcGa7UAvIDxh3Ad5I\n\thAOVHP13+IhWeXsFUb7NBcL2L2WWV2BF9Sp1DgxVQ6LKgOmpcqf1+/cJ1H8xLuGhSx\n\tPjSSSi2y4yTHWN289Tade+JC2/NOK4b9+COWeBR8=","Message-ID":"<e32f2e21-d1d0-4756-ab6c-31f4b456973f@ideasonboard.com>","Date":"Tue, 17 Jun 2025 16:23:02 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] gstreamer: Use std::exchange() instead of\n\tg_steal_pointer()","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","References":"<20250616220607.31416-1-laurent.pinchart@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250616220607.31416-1-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]