gstreamer: Fix reconfiguration condition check

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 <jaslo@ziska.de>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <uajain@igalia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jaslo Ziska
2025-07-31 00:04:03 +03:00
committed by Laurent Pinchart
parent 56748884b6
commit 36bec972d3
+2 -1
View File
@@ -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;
}