basetextoverlay: always intersect with the filter caps

Avoids returning values that upstream can't produce

https://bugzilla.gnome.org/show_bug.cgi?id=733916
This commit is contained in:
Thiago Santos 2014-08-07 17:35:05 -03:00
parent c9904fb639
commit c20e044ef0

View file

@ -1187,16 +1187,8 @@ gst_base_text_overlay_get_videosink_caps (GstPad * pad,
GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peer_caps); GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peer_caps);
if (gst_caps_is_any (peer_caps)) { if (gst_caps_is_any (peer_caps)) {
/* if peer returns ANY caps, return filtered src pad template caps */ /* if peer returns ANY caps, return filtered src pad template caps */
caps = gst_caps_copy (gst_pad_get_pad_template_caps (srcpad)); caps = gst_caps_copy (gst_pad_get_pad_template_caps (srcpad));
if (filter) {
GstCaps *intersection = gst_caps_intersect_full (filter, caps,
GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (caps);
caps = intersection;
}
} else { } else {
/* duplicate caps which contains the composition into one version with /* duplicate caps which contains the composition into one version with
@ -1212,14 +1204,13 @@ gst_base_text_overlay_get_videosink_caps (GstPad * pad,
} else { } else {
/* no peer, our padtemplate is enough then */ /* no peer, our padtemplate is enough then */
caps = gst_pad_get_pad_template_caps (pad); caps = gst_pad_get_pad_template_caps (pad);
if (filter) { }
GstCaps *intersection;
intersection = if (filter) {
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); GstCaps *intersection = gst_caps_intersect_full (filter, caps,
gst_caps_unref (caps); GST_CAPS_INTERSECT_FIRST);
caps = intersection; gst_caps_unref (caps);
} caps = intersection;
} }
GST_DEBUG_OBJECT (overlay, "returning %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (overlay, "returning %" GST_PTR_FORMAT, caps);