Commit 71921dd9 authored by Joshua N. Pritikin's avatar Joshua N. Pritikin
Browse files

Use a helper function to swap prop entries such they are properly ordered by...

Use a helper function to swap prop entries such they are properly ordered by flexibility.  This is important now that...

Original commit message from CVS:
Use a helper function to swap prop entries such they are properly ordered
by flexibility.  This is important now that framerate is specified as a
list of floats AND as a float range.
parent 5d3c7842
......@@ -2133,25 +2133,38 @@ end:
return compatible;
}
static gint
_props_entry_flexibility (GstPropsEntry *entry)
{
gint rank;
switch (entry->propstype) {
default:
rank = 0;
break;
case GST_PROPS_INT_RANGE_TYPE:
rank = 1;
break;
case GST_PROPS_FLOAT_RANGE_TYPE:
rank = 2;
break;
case GST_PROPS_LIST_TYPE:
rank = 3;
break;
}
return rank;
}
static GstPropsEntry*
gst_props_entry_intersect (GstPropsEntry *entry1, GstPropsEntry *entry2)
{
GstPropsEntry *result = NULL;
/* try to move the ranges and lists first */
switch (entry2->propstype) {
case GST_PROPS_INT_RANGE_TYPE:
case GST_PROPS_FLOAT_RANGE_TYPE:
case GST_PROPS_LIST_TYPE:
{
/* Swap more flexible types into entry1 */
if (_props_entry_flexibility (entry1) < _props_entry_flexibility (entry2)) {
GstPropsEntry *temp;
temp = entry1;
entry1 = entry2;
entry2 = temp;
}
default:
break;
}
switch (entry1->propstype) {
......@@ -2349,6 +2362,15 @@ gst_props_entry_intersect (GstPropsEntry *entry1, GstPropsEntry *entry2)
break;
}
/* make caps debugging extremely verbose
GST_CAT_DEBUG (GST_CAT_CAPS, "intersecting %s: %s x %s => %s",
g_quark_to_string (entry1->propid),
gst_props_entry_to_string (entry1),
gst_props_entry_to_string (entry2),
result? gst_props_entry_to_string (result) : "fail");
*/
return result;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment