X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstcaps.c;h=8f459de2ae6be3f6c934e3b7f05d5c7d78368da2;hb=66ce09288169dd15f2f28c6804dd4686c62e580b;hp=01f8934be15abb1a1c534100a2e6bc8fbfe2f7d4;hpb=942fc7f79e6de35db61f3a54840c72011ce1ce8b;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 01f8934..8f459de 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -933,6 +933,39 @@ gst_caps_set_features (GstCaps * caps, guint index, GstCapsFeatures * features) } /** + * gst_caps_set_features_simple: + * @caps: a #GstCaps + * @features: (allow-none) (transfer full): the #GstCapsFeatures to set + * + * Sets the #GstCapsFeatures @features for all the structures of @caps. + * + * Since: 1.16 + */ +void +gst_caps_set_features_simple (GstCaps * caps, GstCapsFeatures * features) +{ + guint i; + guint n; + + g_return_if_fail (caps != NULL); + g_return_if_fail (IS_WRITABLE (caps)); + + n = gst_caps_get_size (caps); + + for (i = 0; i < n; i++) { + GstCapsFeatures *f; + + /* Transfer ownership of @features to the last structure */ + if (features && i < n - 1) + f = gst_caps_features_copy (features); + else + f = features; + + gst_caps_set_features (caps, i, f); + } +} + +/** * gst_caps_copy_nth: * @caps: the #GstCaps to copy * @nth: the nth structure to copy @@ -941,6 +974,8 @@ gst_caps_set_features (GstCaps * caps, guint index, GstCapsFeatures * features) * contained in @caps. * * Returns: (transfer full): the new #GstCaps + * + * Since: 1.16 */ GstCaps * gst_caps_copy_nth (const GstCaps * caps, guint nth) @@ -1049,6 +1084,7 @@ gst_caps_set_simple_valist (GstCaps * caps, const char *field, va_list varargs) G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err); if (G_UNLIKELY (err)) { g_critical ("%s", err); + g_free (err); return; }