caps: Add a macro based variant of gst_caps_copy
authorThibault Saunier <tsaunier@igalia.com>
Tue, 17 Apr 2018 17:00:20 +0000 (14:00 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 17 Apr 2018 17:00:20 +0000 (14:00 -0300)
This way we do not hit the performance overhead of having the method
not inlined but still can use it from bindings.

gst/gstcaps.c
gst/gstcaps.h

index cd69575..8af0503 100644 (file)
@@ -2556,8 +2556,7 @@ gst_caps_filter_and_map_in_place (GstCaps * caps, GstCapsFilterMapFunc func,
  *
  * Returns: the new #GstCaps
  */
-GstCaps *
-gst_caps_copy (const GstCaps * caps)
+GstCaps *(gst_caps_copy) (const GstCaps * caps)
 {
   return GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)));
 }
index 1ab07b6..0d95300 100644 (file)
@@ -227,6 +227,8 @@ gst_caps_unref (GstCaps * caps)
 GST_API
 GstCaps * gst_caps_copy (const GstCaps * caps);
 
+#define gst_caps_copy(caps) GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)))
+
 /**
  * gst_caps_is_writable:
  * @caps: a #GstCaps