summaryrefslogtreecommitdiff
path: root/gst/interlace
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2013-07-22 17:30:31 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2013-07-22 17:32:50 +0100
commit580a94d18b4bd41266630ce60818af9ce63db5df (patch)
tree9df09649f7a1f517c69e293af1511b65b2a221d8 /gst/interlace
parent6a1896d805e05a10bbcafbaf95a1d4b231d573b4 (diff)
downloadgstreamer-plugins-bad-580a94d18b4bd41266630ce60818af9ce63db5df.tar.gz
interlace: fix negotiation if filter caps are passed to query_caps
Make videotestsrc ! interlace ! $anything work again. Problem was that upstream filter caps were passed which contained interlace-mode=progressive, which doesn't intersect too well with interlace's source pad template caps, leading to not-negotiated errors.
Diffstat (limited to 'gst/interlace')
-rw-r--r--gst/interlace/gstinterlace.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c
index 8917f6f10..c503abf15 100644
--- a/gst/interlace/gstinterlace.c
+++ b/gst/interlace/gstinterlace.c
@@ -501,14 +501,25 @@ gst_interlace_getcaps (GstPad * pad, GstInterlace * interlace, GstCaps * filter)
GstPad *otherpad;
GstCaps *othercaps, *tcaps;
GstCaps *icaps;
+ GstCaps *clean_filter = NULL;
const char *mode;
+ guint i;
otherpad =
(pad == interlace->srcpad) ? interlace->sinkpad : interlace->srcpad;
- tcaps = gst_pad_get_pad_template_caps (otherpad);
- othercaps = gst_pad_peer_query_caps (otherpad, filter);
+ if (filter != NULL) {
+ clean_filter = gst_caps_copy (filter);
+ for (i = 0; i < gst_caps_get_size (clean_filter); ++i) {
+ GstStructure *s;
+
+ s = gst_caps_get_structure (clean_filter, i);
+ gst_structure_remove_field (s, "interlace-mode");
+ }
+ }
+ tcaps = gst_pad_get_pad_template_caps (otherpad);
+ othercaps = gst_pad_peer_query_caps (otherpad, clean_filter);
if (othercaps) {
icaps = gst_caps_intersect (othercaps, tcaps);
gst_caps_unref (othercaps);
@@ -516,8 +527,8 @@ gst_interlace_getcaps (GstPad * pad, GstInterlace * interlace, GstCaps * filter)
icaps = tcaps;
}
- if (filter) {
- othercaps = gst_caps_intersect (icaps, filter);
+ if (clean_filter) {
+ othercaps = gst_caps_intersect (icaps, clean_filter);
gst_caps_unref (icaps);
icaps = othercaps;
}
@@ -533,6 +544,9 @@ gst_interlace_getcaps (GstPad * pad, GstInterlace * interlace, GstCaps * filter)
gst_caps_unref (tcaps);
+ if (clean_filter)
+ gst_caps_unref (clean_filter);
+
return icaps;
}