interlace: Drop framerate from query caps of sinkpad

Query caps should return caps which represent the element can accept,
not resulting format.

Fixing negotiation error with
gst-launch-1.0 videotestsrc ! video/x-raw,framerate=25/1 ! interlace field-pattern=0 ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2282>
This commit is contained in:
Seungha Yang 2021-05-25 19:47:28 +09:00 committed by GStreamer Marge Bot
parent da33921f8d
commit 1ac30ad53f

View file

@ -980,18 +980,25 @@ gst_interlace_getcaps (GstPad * pad, GstInterlace * interlace, GstCaps * filter)
icaps = gst_caps_merge (icaps, alternate);
}
if (pattern == GST_INTERLACE_PATTERN_1_1) {
icaps =
gst_interlace_caps_double_framerate (icaps, (pad == interlace->srcpad),
FALSE);
} else if (pattern != GST_INTERLACE_PATTERN_2_2) {
GST_FIXME_OBJECT (interlace,
"Add calculations for telecine framerate conversions");
/* Drop framerate for sinkpad */
if (pad == interlace->sinkpad) {
for (i = 0; i < gst_caps_get_size (icaps); ++i) {
GstStructure *s = gst_caps_get_structure (icaps, i);
gst_structure_remove_field (s, "framerate");
}
} else {
if (pattern == GST_INTERLACE_PATTERN_1_1) {
icaps = gst_interlace_caps_double_framerate (icaps, TRUE, FALSE);
} else if (pattern != GST_INTERLACE_PATTERN_2_2) {
GST_FIXME_OBJECT (interlace,
"Add calculations for telecine framerate conversions");
for (i = 0; i < gst_caps_get_size (icaps); ++i) {
GstStructure *s = gst_caps_get_structure (icaps, i);
gst_structure_remove_field (s, "framerate");
}
}
}
if (clean_filter)