diff options
author | Matthew Waters <matthew@centricular.com> | 2021-09-24 15:02:27 +1000 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-10-31 15:14:40 +0000 |
commit | b42a19ac10f2bdd4a0117d38f8c65b0bc5bb40d2 (patch) | |
tree | 38c2b8a1a1d4bf2a92d4f1c16eec05d69961dcd6 | |
parent | 79824d59ca86f816b152773df6dbe9d9bd7c793d (diff) | |
download | gstreamer-plugins-base-b42a19ac10f2bdd4a0117d38f8c65b0bc5bb40d2.tar.gz |
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/gst-plugins-base/-/merge_requests/1284>
-rw-r--r-- | gst/playback/gstplaybin2.c | 5 | ||||
-rw-r--r-- | gst/playback/gstplaybin3.c | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 9a1aa29ea..8962a1948 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -5151,11 +5151,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); } } diff --git a/gst/playback/gstplaybin3.c b/gst/playback/gstplaybin3.c index e0e422f12..a023e5a1c 100644 --- a/gst/playback/gstplaybin3.c +++ b/gst/playback/gstplaybin3.c @@ -4322,7 +4322,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); } } |