playbin2/3: autoplug/caps: don't expand caps to ANY

Retrieving the pad template caps from a ghost pad returns ANY which when
merged with any other caps will return ANY.  ANY is not very specific
and may cause suboptimal code paths in e.g. decoders that assume the
lowest common denominator when presented with ANY caps.

Fixes negotiating dma-buf with vaapidecodebin between glupload in the
video sink element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1144>
This commit is contained in:
Matthew Waters 2021-09-24 15:02:27 +10:00
parent 0a781424e6
commit 42597181e2
2 changed files with 3 additions and 5 deletions

View file

@ -5137,11 +5137,8 @@ done:
}
}
gst_caps_unref (target_caps);
target_caps = tmp;
result = gst_caps_merge (result, tmp);
}
result = gst_caps_merge (result, target_caps);
gst_object_unref (target);
}
}

View file

@ -4309,7 +4309,8 @@ done:
if (target) {
GstCaps *target_caps = gst_pad_get_pad_template_caps (target);
GST_PLAY_BIN3_FILTER_CAPS (filter, target_caps);
result = gst_caps_merge (result, target_caps);
if (!gst_caps_is_any (target_caps))
result = gst_caps_merge (result, target_caps);
gst_object_unref (target);
}
}