mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
Revert "gstvalue: Avoid expensive fallback on intersection"
This reverts commit cd751c2de3
.
Reverts https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/406
Fixes glviewconvert negotiation in e.g.:
gltestsrc ! glviewconvert output-mode-override=side-by-side ! glstereosplit name=s s.left ! queue ! fakesink s.right ! queue ! glimagesink
Problem here is that intersecting flagsets in gst_value_intersect will
always find a value comparison function but may fail a direct type
comparison due to flagsets supporting derived types. When flagset
derived types are intersected, an intersection will therefore always
fail.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/441>
This commit is contained in:
parent
684723d07c
commit
166c0fbc47
1 changed files with 4 additions and 21 deletions
|
@ -5783,28 +5783,17 @@ gst_value_list_equals_range (const GValue * list, const GValue * value)
|
||||||
|
|
||||||
/* "Pure" variant of gst_value_compare which is guaranteed to
|
/* "Pure" variant of gst_value_compare which is guaranteed to
|
||||||
* not have list arguments and therefore does basic comparisons
|
* not have list arguments and therefore does basic comparisons
|
||||||
*
|
|
||||||
* Handled will be set to TRUE if there is a valid compared function
|
|
||||||
* regardless of whether the two values are equal or not. This is
|
|
||||||
* useful to know whether this function returned !EQUAL because the
|
|
||||||
* values are compatible but didn't match or because there wasn't
|
|
||||||
* a valid comparision function.
|
|
||||||
*/
|
*/
|
||||||
static inline gint
|
static inline gint
|
||||||
_gst_value_compare_nolist (const GValue * value1, const GValue * value2,
|
_gst_value_compare_nolist (const GValue * value1, const GValue * value2)
|
||||||
gboolean * handled)
|
|
||||||
{
|
{
|
||||||
GstValueCompareFunc compare;
|
GstValueCompareFunc compare;
|
||||||
|
|
||||||
if (handled)
|
|
||||||
*handled = FALSE;
|
|
||||||
if (G_VALUE_TYPE (value1) != G_VALUE_TYPE (value2))
|
if (G_VALUE_TYPE (value1) != G_VALUE_TYPE (value2))
|
||||||
return GST_VALUE_UNORDERED;
|
return GST_VALUE_UNORDERED;
|
||||||
|
|
||||||
compare = gst_value_get_compare_func (value1);
|
compare = gst_value_get_compare_func (value1);
|
||||||
if (compare) {
|
if (compare) {
|
||||||
if (handled)
|
|
||||||
*handled = TRUE;
|
|
||||||
return compare (value1, value2);
|
return compare (value1, value2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5889,7 +5878,7 @@ gst_value_compare (const GValue * value1, const GValue * value2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And now handle the generic case */
|
/* And now handle the generic case */
|
||||||
return _gst_value_compare_nolist (value1, value2, NULL);
|
return _gst_value_compare_nolist (value1, value2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6108,7 +6097,6 @@ gst_value_intersect (GValue * dest, const GValue * value1,
|
||||||
GstValueIntersectInfo *intersect_info;
|
GstValueIntersectInfo *intersect_info;
|
||||||
guint i, len;
|
guint i, len;
|
||||||
GType type1, type2;
|
GType type1, type2;
|
||||||
gboolean handled;
|
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_VALUE (value1), FALSE);
|
g_return_val_if_fail (G_IS_VALUE (value1), FALSE);
|
||||||
g_return_val_if_fail (G_IS_VALUE (value2), FALSE);
|
g_return_val_if_fail (G_IS_VALUE (value2), FALSE);
|
||||||
|
@ -6122,7 +6110,7 @@ gst_value_intersect (GValue * dest, const GValue * value1,
|
||||||
if (type2 == GST_TYPE_LIST)
|
if (type2 == GST_TYPE_LIST)
|
||||||
return gst_value_intersect_list (dest, value2, value1);
|
return gst_value_intersect_list (dest, value2, value1);
|
||||||
|
|
||||||
if (_gst_value_compare_nolist (value1, value2, &handled) == GST_VALUE_EQUAL) {
|
if (_gst_value_compare_nolist (value1, value2) == GST_VALUE_EQUAL) {
|
||||||
if (dest)
|
if (dest)
|
||||||
gst_value_init_and_copy (dest, value1);
|
gst_value_init_and_copy (dest, value1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -6140,11 +6128,6 @@ gst_value_intersect (GValue * dest, const GValue * value1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there was a comparision that failed and it doesnt' have an
|
|
||||||
* intersect function then it definitely can't intersect */
|
|
||||||
if (handled)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
/* Failed to find a direct intersection, check if these are
|
/* Failed to find a direct intersection, check if these are
|
||||||
* GstFlagSet sub-types. */
|
* GstFlagSet sub-types. */
|
||||||
if (G_UNLIKELY (GST_VALUE_HOLDS_FLAG_SET (value1) &&
|
if (G_UNLIKELY (GST_VALUE_HOLDS_FLAG_SET (value1) &&
|
||||||
|
@ -6228,7 +6211,7 @@ gst_value_subtract (GValue * dest, const GValue * minuend,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_gst_value_compare_nolist (minuend, subtrahend, NULL) != GST_VALUE_EQUAL) {
|
if (_gst_value_compare_nolist (minuend, subtrahend) != GST_VALUE_EQUAL) {
|
||||||
if (dest)
|
if (dest)
|
||||||
gst_value_init_and_copy (dest, minuend);
|
gst_value_init_and_copy (dest, minuend);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue