From 272142089e415474e55ca85b47b7a8f14dbee3d2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 13 Mar 2012 10:04:36 +0100 Subject: [PATCH] caps: remove gst_caps_union() Remove gst_caps_union(), use gst_caps_merge(). This function was not used anymore and it is unclear what the difference is with _merge(). --- docs/random/porting-to-0.11.txt | 5 +++ gst/gstcaps.c | 77 ----------------------------------------- gst/gstcaps.h | 2 -- 3 files changed, 5 insertions(+), 79 deletions(-) diff --git a/docs/random/porting-to-0.11.txt b/docs/random/porting-to-0.11.txt index 77f2f27..0181bcd 100644 --- a/docs/random/porting-to-0.11.txt +++ b/docs/random/porting-to-0.11.txt @@ -345,6 +345,11 @@ The 0.11 porting guide The compiler should warn about unused return values from these functions, which may help find the places that need to be updated. + Removed functions: + + gst_caps_union() -> gst_caps_merge(): Be careful because _merge takes + ownership of the arguments. + * GstSegment abs_rate was removed from the public fields, it can be trivially calculated from the rate field. diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 767a2f4..93fd3dd 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -1492,83 +1492,6 @@ gst_caps_subtract (GstCaps * minuend, GstCaps * subtrahend) 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 diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 345cf7b..f229742 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -435,8 +435,6 @@ GstCaps * gst_caps_intersect_full (GstCaps *caps1, 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; -- 2.7.4