dvbsuboverlay: always intersect with the filter in getcaps

Avoids returning unsupported caps to peers

https://bugzilla.gnome.org/show_bug.cgi?id=733916
This commit is contained in:
Thiago Santos 2014-08-11 11:33:28 -03:00
parent 44e84025d7
commit 627b6ac461

View file

@ -550,12 +550,6 @@ gst_dvbsub_overlay_get_videosink_caps (GstDVBSubOverlay * render, GstPad * pad,
/* if peer returns ANY caps, return filtered src pad template caps */ /* if peer returns ANY caps, return filtered src pad template caps */
caps = gst_pad_get_pad_template_caps (srcpad); caps = 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 {
@ -572,6 +566,8 @@ gst_dvbsub_overlay_get_videosink_caps (GstDVBSubOverlay * render, 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) { if (filter) {
GstCaps *intersection; GstCaps *intersection;
@ -580,7 +576,6 @@ gst_dvbsub_overlay_get_videosink_caps (GstDVBSubOverlay * render, GstPad * pad,
gst_caps_unref (caps); gst_caps_unref (caps);
caps = intersection; caps = intersection;
} }
}
GST_DEBUG_OBJECT (render, "returning %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (render, "returning %" GST_PTR_FORMAT, caps);
@ -618,13 +613,6 @@ gst_dvbsub_overlay_get_src_caps (GstDVBSubOverlay * render, GstPad * pad,
/* if peer returns ANY caps, return filtered sink pad template caps */ /* if peer returns ANY caps, return filtered sink pad template caps */
caps = gst_pad_get_pad_template_caps (sinkpad); caps = gst_pad_get_pad_template_caps (sinkpad);
if (filter) {
GstCaps *intersection = gst_caps_intersect_full (filter, caps,
GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (caps);
caps = intersection;
}
} else { } else {
/* return upstream caps + composition feature + upstream caps /* return upstream caps + composition feature + upstream caps
@ -640,15 +628,14 @@ gst_dvbsub_overlay_get_src_caps (GstDVBSubOverlay * render, 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_INTERSECT_FIRST);
gst_caps_unref (caps); gst_caps_unref (caps);
caps = intersection; caps = intersection;
} }
}
GST_DEBUG_OBJECT (render, "returning %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (render, "returning %" GST_PTR_FORMAT, caps);