mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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.
This commit is contained in:
parent
6a1896d805
commit
580a94d18b
1 changed files with 18 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue