mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
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().
This commit is contained in:
parent
934ddcfcfe
commit
272142089e
3 changed files with 5 additions and 79 deletions
|
@ -345,6 +345,11 @@ The 0.11 porting guide
|
||||||
The compiler should warn about unused return values from these functions,
|
The compiler should warn about unused return values from these functions,
|
||||||
which may help find the places that need to be updated.
|
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
|
* GstSegment
|
||||||
abs_rate was removed from the public fields, it can be trivially calculated
|
abs_rate was removed from the public fields, it can be trivially calculated
|
||||||
from the rate field.
|
from the rate field.
|
||||||
|
|
|
@ -1492,83 +1492,6 @@ gst_caps_subtract (GstCaps * minuend, GstCaps * subtrahend)
|
||||||
return dest;
|
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 */
|
/* normalize/simplify operations */
|
||||||
|
|
||||||
typedef struct _NormalizeForeach
|
typedef struct _NormalizeForeach
|
||||||
|
|
|
@ -435,8 +435,6 @@ GstCaps * gst_caps_intersect_full (GstCaps *caps1,
|
||||||
GstCapsIntersectMode mode) G_GNUC_WARN_UNUSED_RESULT;
|
GstCapsIntersectMode mode) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
GstCaps * gst_caps_subtract (GstCaps *minuend,
|
GstCaps * gst_caps_subtract (GstCaps *minuend,
|
||||||
GstCaps *subtrahend) G_GNUC_WARN_UNUSED_RESULT;
|
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_normalize (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
GstCaps * gst_caps_simplify (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
GstCaps * gst_caps_simplify (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue