From patchwork Tue Jul 22 10:39:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaslo Ziska X-Patchwork-Id: 23897 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 8EBE6BDCC1 for ; Tue, 22 Jul 2025 10:57:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 49D5369030; Tue, 22 Jul 2025 12:57:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ziska.de header.i=@ziska.de header.b="e1Ot8+CO"; dkim=permerror (0-bit key) header.d=ziska.de header.i=@ziska.de header.b="rDUkujN6"; dkim-atps=neutral Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B1A6C69026 for ; Tue, 22 Jul 2025 12:57:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1753181830; cv=none; d=strato.com; s=strato-dkim-0002; b=FlwsHxZ/FF7drB4/KprwKqCiWKp5G3FqMdFDRlIN+bpO2cLIy/1+gr5PsxmxRMWBy0 Pxss0UHuegZhoXdCoVuyqL4ci+1Hriunt8G6ZPEMq0cxT0fAf9GAJivWfKEZLMbl4bBC AR3KZn+xGyYU4TAoUNyukKlTdIDD1nv5wy2zwWtGXcZg1UVHKDwOvmx4CrnHkD9G9m2P iy3rvO00OQYWwt0bOxFS1Hw1IPlvI7hMp8SqBFoTO6xYox0i9bDHUN6jr3h/SQrEDvRA SmlGqySK+KX/0gTID/2qS6MPF1ZPJ0JHlggItMFHFJ18eIwHvzQ/2xLwCcnphhJVZZfz /jzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1753181830; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=T/QnA1pSf04NxY4A339dZ0QQFP9oyrj5O75WrrTvLtA=; b=QIl4uPUJk/u5M7nbuAZk2ZQXeKgHpuy1L3kmLfDF8e9fRMsOlocSa08+p2UtEdHqVZ Ze2ylXp+GnqSlKMfdGwMJCBcDy/+4CKtR6M4URDjb6C+Nnxgp8FYrQDFWmc6oGJx294v WFHLA59iWMvZ84aht1jDBIClUdx5MRlL2LSH1UlEn26jfxeTZUGXoRBhCUqUk/PpWZvA zqPBNKiwiOSu6SHRUUjqrottI8smAlHApWAvLRqjNZ2J0V5xXm75akZaX3MjWuZM4F6A TR/XbcXR84UABAfVD3JWY3hDyblvqhArtBkJrzFInmO7pXWlDHeKmB7bpel+YLQSm/Ua F0ug== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1753181830; s=strato-dkim-0002; d=ziska.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=T/QnA1pSf04NxY4A339dZ0QQFP9oyrj5O75WrrTvLtA=; b=e1Ot8+CObhrSSf+isnfyzGxKKoo6PKVU1fALATGkFRHrudfhZG836tKGyITKVSzU5T ZHZSm7QVcEfBkTdwEUN/k8Y+mq1H9EI6Z5w9xGjSD3CmPM/n0kSSk0gfalqs10+ZrIck ntYS1p01TL7re6CbSy5Tbx2O1GMu10K97yO05NGQl7JAKF703YiSCilxv1A63r3PiggL mrZnRWjuDFv9y8DD+UPgc+gqaLLCiBGxH4zV9Ut31GEAPM6C2Uq2ckex07JU5D7ffOdV NvZJmE+R9f9TS0jLLL+g7FlDPuKPYe2kTILPMFdzV9rqePFLIDjosaO682OYljrbkefQ ixCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1753181830; s=strato-dkim-0003; d=ziska.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=T/QnA1pSf04NxY4A339dZ0QQFP9oyrj5O75WrrTvLtA=; b=rDUkujN6siMkl/R6IhAu4WD/EPyfzMNCc6fZ14RiKp4SGwcX2o66tIYavNKp2oNFH3 SrKe+fZtQO/XnE6s7fCw== X-RZG-AUTH: ":Jm0XeU+IYfb0x77LHmrjN5Wlb7TBwusDqIM6Hizy8VdfzvKi4yoFC9cF0Yq5V/JaauwvHLbqWsUkNwDmHGDXQ5TkbZSP" Received: from archlinux.fritz.box by smtp.strato.de (RZmta 52.1.2 AUTH) with ESMTPSA id z685ee16MAvAHgW (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 22 Jul 2025 12:57:10 +0200 (CEST) From: Jaslo Ziska To: libcamera-devel@lists.libcamera.org Cc: Jaslo Ziska Subject: [PATCH v2 1/3] gstreamer: Fix reconfiguration condition check Date: Tue, 22 Jul 2025 12:39:28 +0200 Message-ID: <20250722105627.11961-2-jaslo@ziska.de> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250722105627.11961-1-jaslo@ziska.de> References: <20250722105627.11961-1-jaslo@ziska.de> 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" gst_pad_peer_query_accept_caps() might only check if the caps are acceptable with the peer element, but not recursively with all downstream elements. If the reconfigure flag was set because the pipeline downstream changed, gst_pad_peer_query_accept_caps() might still return true, even though downstream can't handle the current caps, which causes a not-negotiated error. This commit fixes this issue by emitting a query event which recursively checks with all downstream elements. Because at this point we are only interested in whether the current caps are still acceptable, use the currently used caps as a filter and then check if the query returned empty caps. Signed-off-by: Jaslo Ziska Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- src/gstreamer/gstlibcamerasrc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 3aca4eed..7f4a39ec 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -730,7 +730,8 @@ gst_libcamera_src_task_run(gpointer user_data) if (gst_pad_check_reconfigure(srcpad)) { /* Check if the caps even need changing. */ g_autoptr(GstCaps) caps = gst_pad_get_current_caps(srcpad); - if (!gst_pad_peer_query_accept_caps(srcpad, caps)) { + g_autoptr(GstCaps) peercaps = gst_pad_peer_query_caps(srcpad, caps); + if (gst_caps_is_empty(peercaps)) { reconfigure = true; break; }