From patchwork Wed Jun 4 13:07:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 23467 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 C4BE8C3325 for ; Wed, 4 Jun 2025 13:08:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8A4868DC5; Wed, 4 Jun 2025 15:08:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S1JXnwc3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B66B968DC5 for ; Wed, 4 Jun 2025 15:07:59 +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 9D3E978C; Wed, 4 Jun 2025 15:07:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749042476; bh=SkeLm18ckEG3XsrwVUnJoIMS/uEPea6GyYTPfXM4I3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S1JXnwc39gAv3FDhycoBYg7zb7E+MDr8PhYr31wmodqV8wuvsqwpzaSJeqiI/UnW6 GQ3ifcg5ZMC6oALn71UqYESi21IrXt1NPbOZ/e0fD/bqKBT/4wJE01VfLenJIsOQpE S/U+nJzZavEHiQnxaIKZnnKBxRLTao/EnR+Cu7eU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Hou Qi , Nicolas Dufresne Subject: [PATCH v2 6/7] gstreamer: Drop incorrect unref on caps Date: Wed, 4 Jun 2025 16:07:40 +0300 Message-ID: <20250604130741.9228-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250604130741.9228-1-laurent.pinchart@ideasonboard.com> References: <20250604130741.9228-1-laurent.pinchart@ideasonboard.com> 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" The caps object passeed to the gst_libcamera_create_video_pool() function is managed as a g_autoptr() in the caller. The function doesn't acquire any new reference, so it shouldn't call gst_caps_unref(). Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Nicolas Dufresne --- I believe this is right (or I wouldn't send it), but a confirmation that nothing in gst_libcamera_create_video_pool() acquires a reference to the caps would be appreciated. --- src/gstreamer/gstlibcamerasrc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 0be64dd836ca..eec8163e88e7 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -580,7 +580,6 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad, } if (!gst_buffer_pool_set_active(pool, true)) { - gst_caps_unref(caps); GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS, ("Failed to active buffer pool"), ("gst_libcamera_src_negotiate() failed."));