return dest;
}
-/* union operation */
-
-#if 0
-static GstStructure *
-gst_caps_structure_union (const GstStructure * struct1,
- const GstStructure * struct2)
-{
- int i;
- GstStructure *dest;
- const GstStructureField *field1;
- const GstStructureField *field2;
- int ret;
-
- /* FIXME this doesn't actually work */
-
- if (struct1->name != struct2->name)
- return NULL;
-
- dest = gst_structure_new_id_empty (struct1->name);
-
- for (i = 0; i < struct1->fields->len; i++) {
- GValue dest_value = { 0 };
-
- field1 = GST_STRUCTURE_FIELD (struct1, i);
- field2 = gst_structure_id_get_field (struct2, field1->name);
-
- if (field2 == NULL) {
- continue;
- } else {
- if (gst_value_union (&dest_value, &field1->value, &field2->value)) {
- gst_structure_set_value (dest, g_quark_to_string (field1->name),
- &dest_value);
- } else {
- ret = gst_value_compare (&field1->value, &field2->value);
- }
- }
- }
-
- return dest;
-}
-#endif
-
-/**
- * gst_caps_union:
- * @caps1: a #GstCaps to union
- * @caps2: a #GstCaps to union
- *
- * Creates a new #GstCaps that contains all the formats that are in
- * either @caps1 and @caps2.
- *
- * Returns: the new #GstCaps
- */
-GstCaps *
-gst_caps_union (GstCaps * caps1, GstCaps * caps2)
-{
- GstCaps *dest1;
-
- /* NULL pointers are no correct GstCaps */
- g_return_val_if_fail (caps1 != NULL, NULL);
- g_return_val_if_fail (caps2 != NULL, NULL);
-
- if (CAPS_IS_EMPTY (caps1))
- return gst_caps_ref (caps2);
-
- if (CAPS_IS_EMPTY (caps2))
- return gst_caps_ref (caps1);
-
- if (CAPS_IS_ANY (caps1) || CAPS_IS_ANY (caps2))
- return gst_caps_ref (caps1);
-
- dest1 = _gst_caps_copy (caps1);
- gst_caps_append (dest1, gst_caps_ref (caps2));
-
- dest1 = gst_caps_simplify (dest1);
- return dest1;
-}
-
/* normalize/simplify operations */
typedef struct _NormalizeForeach
GstCapsIntersectMode mode) G_GNUC_WARN_UNUSED_RESULT;
GstCaps * gst_caps_subtract (GstCaps *minuend,
GstCaps *subtrahend) G_GNUC_WARN_UNUSED_RESULT;
-GstCaps * gst_caps_union (GstCaps *caps1,
- GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
GstCaps * gst_caps_normalize (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
GstCaps * gst_caps_simplify (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;