mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
Merge branch 'master' into 0.11
Conflicts: plugins/elements/gstoutputselector.c
This commit is contained in:
commit
272b3263aa
3 changed files with 20 additions and 37 deletions
|
@ -3130,48 +3130,11 @@ gst_caps_structure_is_subset_field (GQuark field_id, const GValue * value,
|
|||
GstStructure *superset = user_data;
|
||||
GValue subtraction = { 0, };
|
||||
const GValue *other;
|
||||
GType ltype;
|
||||
|
||||
if (!(other = gst_structure_id_get_value (superset, field_id)))
|
||||
/* field is missing in the superset => is subset */
|
||||
return TRUE;
|
||||
|
||||
/* Special case: lists and scalar values
|
||||
* "{ 1 }" and "1" subsets of each other
|
||||
* but not strictly equal */
|
||||
ltype = gst_value_list_get_type ();
|
||||
if (G_VALUE_HOLDS (other, ltype) && !G_VALUE_HOLDS (value, ltype)) {
|
||||
const GValue *elt;
|
||||
gint i, n;
|
||||
gboolean all_equal = TRUE;
|
||||
|
||||
n = gst_value_list_get_size (other);
|
||||
for (i = 0; i < n; i++) {
|
||||
elt = gst_value_list_get_value (other, 0);
|
||||
if (gst_value_compare (elt, value) != GST_VALUE_EQUAL) {
|
||||
all_equal = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (all_equal)
|
||||
return TRUE;
|
||||
} else if (G_VALUE_HOLDS (value, ltype) && !G_VALUE_HOLDS (other, ltype)) {
|
||||
const GValue *elt;
|
||||
gint i, n;
|
||||
gboolean all_equal = TRUE;
|
||||
|
||||
n = gst_value_list_get_size (value);
|
||||
for (i = 0; i < n; i++) {
|
||||
elt = gst_value_list_get_value (value, 0);
|
||||
if (gst_value_compare (elt, other) != GST_VALUE_EQUAL) {
|
||||
all_equal = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (all_equal)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* equal values are subset */
|
||||
if (gst_value_compare (other, value) == GST_VALUE_EQUAL)
|
||||
return TRUE;
|
||||
|
|
|
@ -3420,10 +3420,28 @@ gint
|
|||
gst_value_compare (const GValue * value1, const GValue * value2)
|
||||
{
|
||||
GstValueCompareFunc compare;
|
||||
GType ltype;
|
||||
|
||||
g_return_val_if_fail (G_IS_VALUE (value1), GST_VALUE_LESS_THAN);
|
||||
g_return_val_if_fail (G_IS_VALUE (value2), GST_VALUE_GREATER_THAN);
|
||||
|
||||
/* Special case: lists and scalar values
|
||||
* "{ 1 }" and "1" are equal */
|
||||
ltype = gst_value_list_get_type ();
|
||||
if (G_VALUE_HOLDS (value1, ltype) && !G_VALUE_HOLDS (value2, ltype)
|
||||
&& gst_value_list_get_size (value1) == 1) {
|
||||
const GValue *elt;
|
||||
|
||||
elt = gst_value_list_get_value (value1, 0);
|
||||
return gst_value_compare (elt, value2);
|
||||
} else if (G_VALUE_HOLDS (value2, ltype) && !G_VALUE_HOLDS (value1, ltype)
|
||||
&& gst_value_list_get_size (value2) == 1) {
|
||||
const GValue *elt;
|
||||
|
||||
elt = gst_value_list_get_value (value2, 0);
|
||||
return gst_value_compare (elt, value1);
|
||||
}
|
||||
|
||||
if (G_VALUE_TYPE (value1) != G_VALUE_TYPE (value2))
|
||||
return GST_VALUE_UNORDERED;
|
||||
|
||||
|
|
|
@ -67,7 +67,9 @@ GstCheckABIStruct list[] = {
|
|||
{"GstTypeFindFactoryClass", sizeof (GstTypeFindFactoryClass), 152},
|
||||
{"GstURIHandlerInterface", sizeof (GstURIHandlerInterface), 44},
|
||||
{"GstValueTable", sizeof (GstValueTable), 32},
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED) && !defined(GST_REMOVE_DEPRECATED)
|
||||
{"GstXML", sizeof (GstXML), 64},
|
||||
{"GstXMLClass", sizeof (GstXMLClass), 144},
|
||||
#endif
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue