return TRUE;
}
+/**
+ * gst_caps_fixate:
+ * @caps: a #GstCaps to fixate
+ *
+ * Modifies the given @caps inplace into a representation with only fixed
+ * values. First the caps will be truncated and then the first structure will be
+ * fixated with gst_structure_fixate(). @caps should be writable.
+ */
+void
+gst_caps_fixate (GstCaps * caps)
+{
+ GstStructure *s;
+
+ g_return_if_fail (GST_IS_CAPS (caps));
+ g_return_if_fail (IS_WRITABLE (caps));
+
+ /* default fixation */
+ gst_caps_truncate (caps);
+ s = gst_caps_get_structure (caps, 0);
+ gst_structure_fixate (s);
+}
+
/* utility */
/**
GstCaps * gst_caps_normalize (const GstCaps *caps);
gboolean gst_caps_do_simplify (GstCaps *caps);
+void gst_caps_fixate (GstCaps *caps);
+
/* utility */
gchar * gst_caps_to_string (const GstCaps *caps);
GstCaps * gst_caps_from_string (const gchar *string);
static void
gst_pad_default_fixate (GstPad * pad, GstCaps * caps)
{
- GstStructure *s;
-
/* default fixation */
- gst_caps_truncate (caps);
- s = gst_caps_get_structure (caps, 0);
- gst_structure_fixate (s);
+ gst_caps_fixate (caps);
}
/**
void
gst_structure_fixate (GstStructure * structure)
{
+ g_return_if_fail (GST_IS_STRUCTURE (structure));
+
gst_structure_foreach (structure, default_fixate, structure);
}