Commit bfeaaa4b authored by Wim Taymans's avatar Wim Taymans

capssetter: update to 1.0 transform_caps sematics

In 1.0, we pass the complete caps to transform_caps to allow for better
optimizations. Make this function actually work on non-simple caps
instead of just ignoring the configured filter caps.
parent 643d425f
......@@ -195,7 +195,7 @@ gst_caps_setter_transform_caps (GstBaseTransform * trans,
GstCaps *ret = NULL, *filter_caps = NULL;
GstStructure *structure, *merge;
const gchar *name;
gint i, j;
gint i, j, k;
GST_DEBUG_OBJECT (trans,
"receiving caps: %" GST_PTR_FORMAT ", with filter: %" GST_PTR_FORMAT,
......@@ -212,17 +212,14 @@ gst_caps_setter_transform_caps (GstBaseTransform * trans,
ret = gst_caps_copy (caps);
/* this function is always called with a simple caps */
if (!GST_CAPS_IS_SIMPLE (ret))
return ret;
structure = gst_caps_get_structure (ret, 0);
name = gst_structure_get_name (structure);
GST_OBJECT_LOCK (filter);
filter_caps = gst_caps_ref (filter->caps);
GST_OBJECT_UNLOCK (filter);
for (k = 0; k < gst_caps_get_size (ret); k++) {
structure = gst_caps_get_structure (ret, k);
name = gst_structure_get_name (structure);
for (i = 0; i < gst_caps_get_size (filter_caps); ++i) {
merge = gst_caps_get_structure (filter_caps, i);
if (gst_structure_has_name (merge, name) || !filter->join) {
......@@ -242,6 +239,7 @@ gst_caps_setter_transform_caps (GstBaseTransform * trans,
}
}
}
}
GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret);
......
Markdown is supported
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