summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-01-08 18:53:52 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-01-16 11:05:13 +0100
commitfccf83e69f108fd1bdc10b785761c54d3f413b36 (patch)
tree0160bba812a3b1930175307ab404ea2d641d010e
parent9713ab06cd081c520ab14641df1e974b5bbbe50c (diff)
playbin: Only append non-raw and sysmem pad template caps to the autoplug-query result
Otherwise a decoder supporting GL memory will think that all downstream can support GL memory because of seeing its own template caps. https://bugzilla.gnome.org/show_bug.cgi?id=758212
-rw-r--r--gst/playback/gstplaybin2.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c
index 02280611f..b4b74780f 100644
--- a/gst/playback/gstplaybin2.c
+++ b/gst/playback/gstplaybin2.c
@@ -4994,7 +4994,35 @@ done:
if (target) {
GstCaps *target_caps = gst_pad_get_pad_template_caps (target);
+
GST_PLAY_BIN_FILTER_CAPS (filter, target_caps);
+ if (!gst_caps_is_any (target_caps)) {
+ GstCaps *tmp;
+ GstCapsFeatures *features;
+ GstStructure *s;
+ guint i, n;
+
+ n = gst_caps_get_size (target_caps);
+ tmp = gst_caps_new_empty ();
+ for (i = 0; i < n; i++) {
+ features = gst_caps_get_features (target_caps, i);
+ s = gst_caps_get_structure (target_caps, i);
+
+ if (!gst_structure_has_name (s, "video/x-raw") &&
+ !gst_structure_has_name (s, "audio/x-raw")) {
+ gst_caps_append_structure_full (tmp,
+ gst_structure_copy (s), gst_caps_features_copy (features));
+ } else if (gst_caps_features_is_any (features)
+ || gst_caps_features_is_equal (features,
+ GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY)) {
+ gst_caps_append_structure (tmp, gst_structure_copy (s));
+ }
+ }
+ gst_caps_unref (target_caps);
+ target_caps = tmp;
+ }
+
+
result = gst_caps_merge (result, target_caps);
gst_object_unref (target);
}