GstCaps *newcaps;
GstStructure *newstruct;
- GST_DEBUG_OBJECT (caps, "transforming caps (from)");
+ GST_DEBUG_OBJECT (base, "transforming caps from %" GST_PTR_FORMAT, caps);
structure = gst_caps_get_structure (caps, 0);
gst_structure_set_value (newstruct, "framerate",
gst_structure_get_value (structure, "framerate"));
- GST_DEBUG_OBJECT (newcaps, "transforming caps (into)");
+ if (filter != NULL) {
+ GstCaps *icaps;
+
+ GST_DEBUG_OBJECT (base, " filter %" GST_PTR_FORMAT, filter);
+
+ icaps = gst_caps_intersect_full (filter, newcaps, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (newcaps);
+ newcaps = icaps;
+ }
+
+ GST_DEBUG_OBJECT (base, " into %" GST_PTR_FORMAT, newcaps);
return newcaps;
}