From 42597181e2dba758f1e0b390042cec5bcf04e227 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 24 Sep 2021 15:02:27 +1000 Subject: [PATCH] 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: --- subprojects/gst-plugins-base/gst/playback/gstplaybin2.c | 5 +---- subprojects/gst-plugins-base/gst/playback/gstplaybin3.c | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-plugins-base/gst/playback/gstplaybin2.c b/subprojects/gst-plugins-base/gst/playback/gstplaybin2.c index 9d32c6e..bcbfc20 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstplaybin2.c +++ b/subprojects/gst-plugins-base/gst/playback/gstplaybin2.c @@ -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); } } diff --git a/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c b/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c index 70a19fe..e86eb62 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c @@ -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); } } -- 2.7.4