From patchwork Mon Jun 16 22:06:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 23579 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C7817BDE6B for ; Mon, 16 Jun 2025 22:06:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B900768DCB; Tue, 17 Jun 2025 00:06:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hhXybc0l"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F281461548 for ; Tue, 17 Jun 2025 00:06:23 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B94D8493; Tue, 17 Jun 2025 00:06:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1750111571; bh=UZgtLqmvp8D2hu5wajxw+h85VFTGZ7gc+FTpKt+g+gM=; h=From:To:Cc:Subject:Date:From; b=hhXybc0lIfYUYPGojiNaIIqYMVzMClRNoaLZWPgf1k2jDODst9kMQApEKkIE8gFOt lo+WC0j+wmUnMwBgqz7cViQK11fHffSx8YRX5HczWldBstJkIxEAzXl46xlIVZafH9 hGcrZ6vsO+ARSSKFDIrmbY+ryi7Osm/32p6TNpVA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Nicolas Dufresne , =?utf-8?q?Barnab?= =?utf-8?b?w6FzIFDFkWN6ZQ==?= Subject: [PATCH] gstreamer: Use std::exchange() instead of g_steal_pointer() Date: Tue, 17 Jun 2025 01:06:07 +0300 Message-ID: <20250616220607.31416-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" g_steal_pointer) only preserves the type since glib 2.68, requiring casts. Use std::exchange() instead. Signed-off-by: Laurent Pinchart Reviewed-by: Nicolas Dufresne Reviewed-by: Barnabás Pőcze --- src/gstreamer/gstlibcamerasrc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: b3ff75d7589a263412ad63008b3c8518d40e6316 diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index ebea34e47b4d..e56cee282c59 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -1085,7 +1085,7 @@ gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ, gst_child_proxy_child_added(GST_CHILD_PROXY(self), G_OBJECT(pad), GST_OBJECT_NAME(pad)); - return reinterpret_cast(g_steal_pointer(&pad)); + return std::exchange(pad, nullptr); } static void