gst_caps_structure_can_intersect_field, (gpointer) struct2);
}
+static gboolean
+gst_caps_structure_has_field (GQuark field_id, const GValue * value,
+ gpointer user_data)
+{
+ GstStructure *subset = user_data;
+
+ return gst_structure_id_get_value (subset, field_id) != NULL;
+}
+
static gboolean
gst_caps_structure_is_subset_field (GQuark field_id, const GValue * value,
gpointer user_data)
(gst_structure_n_fields (superset) > gst_structure_n_fields (subset)))
return FALSE;
+ /* The subset must have all fields that are in superset */
+ if (!gst_structure_foreach ((GstStructure *) superset,
+ gst_caps_structure_has_field, (gpointer) subset))
+ return FALSE;
+
return gst_structure_foreach ((GstStructure *) subset,
gst_caps_structure_is_subset_field, (gpointer) superset);
}
fail_if (gst_caps_is_subset (c2, c1));
gst_caps_unref (c1);
gst_caps_unref (c2);
+
+ c1 = gst_caps_from_string ("video/x-h264, parsed=(boolean)true");
+ c2 = gst_caps_from_string
+ ("video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal");
+ fail_if (gst_caps_is_subset (c2, c1));
+ fail_if (gst_caps_is_subset (c1, c2));
+ fail_if (gst_caps_is_equal (c1, c2));
+ gst_caps_unref (c1);
+ gst_caps_unref (c2);
}
GST_END_TEST;