diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2012-09-11 18:53:43 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2012-09-11 18:53:43 -0400 |
commit | 977f84d2721b8346c85c3684831c7a30ffece496 (patch) | |
tree | d8d5e5dc5344d19c05534c131b868e4e362f34ec | |
parent | 60739b828d32826f8134fa149ab199927231511d (diff) |
autoconvert: Look at all possibilities for accept-caps even if there is a selected subelement
If the accept-caps succeeds with a different subelement, then the subsequent
caps event will change the current subelement.
-rw-r--r-- | gst/autoconvert/gstautoconvert.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index 8ba5963c7..5b11042a6 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -1039,28 +1039,37 @@ gst_auto_convert_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) gst_object_unref (sub_sinkpad); gst_object_unref (subelement); - } else { - if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { - GstCaps *caps; - GstCaps *accept_caps; - - gst_query_parse_accept_caps (query, &accept_caps); - caps = gst_auto_convert_getcaps (autoconvert, accept_caps, GST_PAD_SINK); - gst_query_set_accept_caps_result (query, - gst_caps_can_intersect (caps, accept_caps)); - gst_caps_unref (caps); + if (ret && GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { + gboolean res; + gst_query_parse_accept_caps_result (query, &res); - return TRUE; + if (!res) + goto ignore_acceptcaps_failure; } + return ret; + } + +ignore_acceptcaps_failure: + + if (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS) { + GstCaps *caps; + GstCaps *accept_caps; - GST_WARNING_OBJECT (autoconvert, "Got query %s while no element was" - " selected, letting through", - gst_query_type_get_name (GST_QUERY_TYPE (query))); - ret = gst_pad_peer_query (autoconvert->srcpad, query); + gst_query_parse_accept_caps (query, &accept_caps); + + caps = gst_auto_convert_getcaps (autoconvert, accept_caps, GST_PAD_SINK); + gst_query_set_accept_caps_result (query, + gst_caps_can_intersect (caps, accept_caps)); + gst_caps_unref (caps); + + return TRUE; } - return ret; + GST_WARNING_OBJECT (autoconvert, "Got query %s while no element was" + " selected, letting through", + gst_query_type_get_name (GST_QUERY_TYPE (query))); + return gst_pad_peer_query (autoconvert->srcpad, query); } /** |