X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstcaps.c;h=9e6408d574ea34d19b1557bd9575d4de197b992e;hb=0c6f5b3e4c3dc55e684bca1e3fc9a2a9b74407b9;hp=8af0503ce3a416cdf8c1cb8f2353e20008ff0db1;hpb=b27ee943c2a44a5437a5343d21a9d2be918a1279;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 8af0503..9e6408d 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -175,8 +175,7 @@ _gst_caps_copy (const GstCaps * caps) GST_CAPS_FLAGS (newcaps) = GST_CAPS_FLAGS (caps); n = GST_CAPS_LEN (caps); - GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, caps, "doing copy %p -> %p", - caps, newcaps); + GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "doing copy %p -> %p", caps, newcaps); for (i = 0; i < n; i++) { structure = gst_caps_get_structure_unchecked (caps, i); @@ -216,6 +215,11 @@ _gst_caps_free (GstCaps * caps) #ifdef DEBUG_REFCOUNT GST_CAT_TRACE (GST_CAT_CAPS, "freeing caps %p", caps); #endif + +#ifdef USE_POISONING + memset (caps, 0xff, sizeof (GstCapsImpl)); +#endif + g_slice_free1 (sizeof (GstCapsImpl), caps); } @@ -928,6 +932,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 @@ -936,6 +973,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) @@ -1044,6 +1083,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; }