caps: Handle ANY caps features properly in more places
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 6 Apr 2013 19:49:25 +0000 (21:49 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 6 Apr 2013 19:49:25 +0000 (21:49 +0200)
gst/gstcaps.c
tools/gst-inspect.c

index ee1806b5bdf428db94ac46d55926fd84fbc42350..12c49ebe5d0b777039579f1d63ee36ee341d3719 100644 (file)
@@ -102,7 +102,7 @@ typedef struct _GstCapsImpl
 #define CAPS_IS_EMPTY_SIMPLE(caps)                                     \
   ((GST_CAPS_ARRAY (caps) == NULL) || (GST_CAPS_LEN (caps) == 0))
 
-#define gst_caps_features_copy_conditional(f) ((f && !gst_caps_features_is_equal (f, GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY)) ? gst_caps_features_copy (f) : NULL)
+#define gst_caps_features_copy_conditional(f) ((f && (gst_caps_features_is_any (f) || !gst_caps_features_is_equal (f, GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY))) ? gst_caps_features_copy (f) : NULL)
 
 /* quick way to get a caps structure at an index without doing a type or array
  * length check */
@@ -2171,9 +2171,9 @@ gst_caps_to_string (const GstCaps * caps)
     features = gst_caps_get_features_unchecked (caps, i);
 
     g_string_append (s, gst_structure_get_name (structure));
-    if (features
-        && !gst_caps_features_is_equal (features,
-            GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY)) {
+    if (features && (gst_caps_features_is_any (features)
+            || !gst_caps_features_is_equal (features,
+                GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY))) {
       g_string_append_c (s, '(');
       priv_gst_caps_features_append_to_gstring (features, s);
       g_string_append_c (s, ')');
index 750fded49a38306af60fe868ffe994fe48394a41..ccde78533521dc58053fdf800df9c363e2df1873 100644 (file)
@@ -83,9 +83,9 @@ print_caps (const GstCaps * caps, const gchar * pfx)
     GstStructure *structure = gst_caps_get_structure (caps, i);
     GstCapsFeatures *features = gst_caps_get_features (caps, i);
 
-    if (features
-        && !gst_caps_features_is_equal (features,
-            GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY)) {
+    if (features && (gst_caps_features_is_any (features) ||
+            !gst_caps_features_is_equal (features,
+                GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY))) {
       gchar *features_string = gst_caps_features_to_string (features);
 
       n_print ("%s%s(%s)\n", pfx, gst_structure_get_name (structure),