[{"id":34418,"web_url":"https://patchwork.libcamera.org/comment/34418/","msgid":"<02e1be06aa5dcdfcb002d5cc0167ff57844c89bb.camel@collabora.com>","date":"2025-06-04T17:13:16","subject":"Re: [PATCH v2 6/7] gstreamer: Drop incorrect unref on caps","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le mercredi 04 juin 2025 à 16:07 +0300, Laurent Pinchart a écrit :\n> The caps object passeed to the gst_libcamera_create_video_pool()\n> function is managed as a g_autoptr() in the caller. The function doesn't\n> acquire any new reference, so it shouldn't call gst_caps_unref(). Fix\n> it.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n> I believe this is right (or I wouldn't send it), but a confirmation that\n> nothing in gst_libcamera_create_video_pool() acquires a reference to the\n> caps would be appreciated.\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 1 -\n>  1 file changed, 1 deletion(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 0be64dd836ca..eec8163e88e7 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -580,7 +580,6 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad,\n>  \t}\n>  \n>  \tif (!gst_buffer_pool_set_active(pool, true)) {\n> -\t\tgst_caps_unref(caps);\n>  \t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n>  \t\t\t\t  (\"Failed to active buffer pool\"),\n>  \t\t\t\t  (\"gst_libcamera_src_negotiate() failed.\"));","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 A2F86C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 Jun 2025 17:13:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 57AB068DC0;\n\tWed,  4 Jun 2025 19:13:21 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[IPv6:2a01:4f8:201:9162::2])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8023D68DA8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Jun 2025 19:13:19 +0200 (CEST)","from [IPv6:2606:6d00:10:5285::5ac] (unknown\n\t[IPv6:2606:6d00:10:5285::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\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bali.collaboradmins.com (Postfix) with ESMTPSA id 87D0317E056F;\n\tWed,  4 Jun 2025 19:13:18 +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=\"SIF4FYCl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1749057199;\n\tbh=gZ//0lW0ltOWPOAT2ASXQn8smY2Upslg8olIY/QKGKo=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=SIF4FYClKpPQHNPL5qwNlbbW5IeCeZxiV0s9Vg+UaQf78xmrmH485wgIkuDSyIci4\n\tDNnvTpb+yAhGy9lOqpAHTfSoprPRFVoOdiS0pk0lUwimWqFp1QK5hxTpsscLL5A6ID\n\tcYf5j3vwPlFZG+Zovlr9iQo85GsDvpPI5a3nZWo39tNh5K/CCZh92HVIScsfbH0vdv\n\trwVfNFMBr+A+se5RyYmQKNSA8OvsmOH0zr3wzcDWUN5U5eBOAvq4eTrBzEHTNihSwf\n\tR/inHSb5CLYbhq4pnr+92uzev2axDoizNVyq9VU8NBQhZyNWgFYpSHte5GAIueODB4\n\tpDGwcVE5H9TSw==","Message-ID":"<02e1be06aa5dcdfcb002d5cc0167ff57844c89bb.camel@collabora.com>","Subject":"Re: [PATCH v2 6/7] gstreamer: Drop incorrect unref on caps","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Cc":"Hou Qi <qi.hou@nxp.com>","Date":"Wed, 04 Jun 2025 13:13:16 -0400","In-Reply-To":"<20250604130741.9228-7-laurent.pinchart@ideasonboard.com>","References":"<20250604130741.9228-1-laurent.pinchart@ideasonboard.com>\n\t<20250604130741.9228-7-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>"}}]