mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
autoconvert: Always give a valid reply to internal caps queries
Caps queries can always have a valid reply, either the filter or ANY. If the caps are ANY, then accept-caps always returns TRUE.
This commit is contained in:
parent
d65d8657e6
commit
8e75bea378
1 changed files with 25 additions and 1 deletions
|
@ -1243,7 +1243,31 @@ gst_auto_convert_internal_sink_query (GstPad * pad, GstObject * parent,
|
||||||
GST_AUTO_CONVERT (g_object_get_qdata (G_OBJECT (pad),
|
GST_AUTO_CONVERT (g_object_get_qdata (G_OBJECT (pad),
|
||||||
parent_quark));
|
parent_quark));
|
||||||
|
|
||||||
return gst_pad_peer_query (autoconvert->srcpad, query);
|
if (!gst_pad_peer_query (autoconvert->srcpad, query)) {
|
||||||
|
switch (GST_QUERY_TYPE (query)) {
|
||||||
|
case GST_QUERY_CAPS:
|
||||||
|
{
|
||||||
|
GstCaps *filter;
|
||||||
|
|
||||||
|
gst_query_parse_caps (query, &filter);
|
||||||
|
if (filter) {
|
||||||
|
gst_query_set_caps_result (query, filter);
|
||||||
|
} else {
|
||||||
|
filter = gst_caps_new_any ();
|
||||||
|
gst_query_set_caps_result (query, filter);
|
||||||
|
gst_caps_unref (filter);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
case GST_QUERY_ACCEPT_CAPS:
|
||||||
|
gst_query_set_accept_caps_result (query, TRUE);
|
||||||
|
return TRUE;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue