decodebin3: Don't intercept queries if no parsebin present

If we don't use a parsebin, we forward the queries as-is from upstream. There is
no reconfiguration possible within identity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3754>
This commit is contained in:
Edward Hervey 2023-01-19 16:27:57 +01:00 committed by GStreamer Marge Bot
parent 1a30ed8113
commit 34ea792881

View file

@ -320,35 +320,39 @@ parse_chain_output_probe (GstPad * pad, GstPadProbeInfo * info,
break; break;
} }
} else if (GST_IS_QUERY (GST_PAD_PROBE_INFO_DATA (info))) { } else if (GST_IS_QUERY (GST_PAD_PROBE_INFO_DATA (info))) {
GstQuery *q = GST_PAD_PROBE_INFO_QUERY (info); if (input->input && input->input->identity) {
GST_DEBUG_OBJECT (pad, "Seeing query %s", GST_QUERY_TYPE_NAME (q)); GST_DEBUG_OBJECT (pad, "Letting query through");
/* If we have a parser, we want to reply to the caps query */ } else {
/* FIXME: Set a flag when the input stream is created for GstQuery *q = GST_PAD_PROBE_INFO_QUERY (info);
* streams where we shouldn't reply to these queries */ GST_DEBUG_OBJECT (pad, "Seeing query %" GST_PTR_FORMAT, q);
if (GST_QUERY_TYPE (q) == GST_QUERY_CAPS /* If we have a parser, we want to reply to the caps query */
&& (info->type & GST_PAD_PROBE_TYPE_PULL)) { /* FIXME: Set a flag when the input stream is created for
GstCaps *filter = NULL; * streams where we shouldn't reply to these queries */
GstCaps *allowed; if (GST_QUERY_TYPE (q) == GST_QUERY_CAPS
gst_query_parse_caps (q, &filter); && (info->type & GST_PAD_PROBE_TYPE_PULL)) {
allowed = get_parser_caps_filter (input->dbin, filter); GstCaps *filter = NULL;
GST_DEBUG_OBJECT (pad, GstCaps *allowed;
"Intercepting caps query, setting %" GST_PTR_FORMAT, allowed); gst_query_parse_caps (q, &filter);
gst_query_set_caps_result (q, allowed); allowed = get_parser_caps_filter (input->dbin, filter);
gst_caps_unref (allowed); GST_DEBUG_OBJECT (pad,
ret = GST_PAD_PROBE_HANDLED; "Intercepting caps query, setting %" GST_PTR_FORMAT, allowed);
} else if (GST_QUERY_TYPE (q) == GST_QUERY_ACCEPT_CAPS) { gst_query_set_caps_result (q, allowed);
GstCaps *prop = NULL; gst_caps_unref (allowed);
gst_query_parse_accept_caps (q, &prop); ret = GST_PAD_PROBE_HANDLED;
/* Fast check against target caps */ } else if (GST_QUERY_TYPE (q) == GST_QUERY_ACCEPT_CAPS) {
if (gst_caps_can_intersect (prop, input->dbin->caps)) { GstCaps *prop = NULL;
gst_query_set_accept_caps_result (q, TRUE); gst_query_parse_accept_caps (q, &prop);
} else { /* Fast check against target caps */
gboolean accepted = check_parser_caps_filter (input->dbin, prop); if (gst_caps_can_intersect (prop, input->dbin->caps)) {
/* check against caps filter */ gst_query_set_accept_caps_result (q, TRUE);
gst_query_set_accept_caps_result (q, accepted); } else {
GST_DEBUG_OBJECT (pad, "ACCEPT_CAPS query, returning %d", accepted); gboolean accepted = check_parser_caps_filter (input->dbin, prop);
/* check against caps filter */
gst_query_set_accept_caps_result (q, accepted);
GST_DEBUG_OBJECT (pad, "ACCEPT_CAPS query, returning %d", accepted);
}
ret = GST_PAD_PROBE_HANDLED;
} }
ret = GST_PAD_PROBE_HANDLED;
} }
} }