mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
gst/gstcaps.c: allow subtracting ANY and EMPTY from ANY caps
Original commit message from CVS: * gst/gstcaps.c: (gst_caps_subtract): allow subtracting ANY and EMPTY from ANY caps
This commit is contained in:
parent
ef64b87987
commit
d65cd5dc7d
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-04-22 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* gst/gstcaps.c: (gst_caps_subtract):
|
||||||
|
allow subtracting ANY and EMPTY from ANY caps
|
||||||
|
|
||||||
2004-04-22 Benjamin Otte <otte@gnome.org>
|
2004-04-22 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* gst/gstcaps.c: (gst_caps_append), (gst_caps_intersect),
|
* gst/gstcaps.c: (gst_caps_append), (gst_caps_intersect),
|
||||||
|
|
|
@ -952,8 +952,6 @@ gst_caps_subtract (const GstCaps * minuend, const GstCaps * subtrahend)
|
||||||
GstCaps *dest = NULL, *src;
|
GstCaps *dest = NULL, *src;
|
||||||
|
|
||||||
g_return_val_if_fail (minuend != NULL, NULL);
|
g_return_val_if_fail (minuend != NULL, NULL);
|
||||||
/* what would that be ? */
|
|
||||||
g_return_val_if_fail (!gst_caps_is_any (minuend), NULL);
|
|
||||||
g_return_val_if_fail (subtrahend != NULL, NULL);
|
g_return_val_if_fail (subtrahend != NULL, NULL);
|
||||||
|
|
||||||
if (gst_caps_is_empty (minuend) || gst_caps_is_any (subtrahend)) {
|
if (gst_caps_is_empty (minuend) || gst_caps_is_any (subtrahend)) {
|
||||||
|
@ -962,6 +960,13 @@ gst_caps_subtract (const GstCaps * minuend, const GstCaps * subtrahend)
|
||||||
if (gst_caps_is_empty (subtrahend))
|
if (gst_caps_is_empty (subtrahend))
|
||||||
return gst_caps_copy (minuend);
|
return gst_caps_copy (minuend);
|
||||||
|
|
||||||
|
/* FIXME: Do we want this here or above?
|
||||||
|
The reason we need this is that there is no definition about what
|
||||||
|
ANY means for specific types, so it's not possible to reduce ANY partially
|
||||||
|
You can only remove everything or nothing and that is done above.
|
||||||
|
Note: there's a test that checks this behaviour. */
|
||||||
|
g_return_val_if_fail (!gst_caps_is_any (minuend), NULL);
|
||||||
|
|
||||||
src = gst_caps_copy (minuend);
|
src = gst_caps_copy (minuend);
|
||||||
for (i = 0; i < subtrahend->structs->len; i++) {
|
for (i = 0; i < subtrahend->structs->len; i++) {
|
||||||
sub = gst_caps_get_structure (subtrahend, i);
|
sub = gst_caps_get_structure (subtrahend, i);
|
||||||
|
|
Loading…
Reference in a new issue