summaryrefslogtreecommitdiff
path: root/gst/gstcaps.h
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-03-11 18:57:44 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-03-11 18:57:44 +0100
commit43abf99a8a064cbe74f110658937088b95d09437 (patch)
tree88cc7e3ffb943dc67003dab65010908182233c1b /gst/gstcaps.h
parent89d0316895b7b3ac023d94702ad36aa16e2e4b9e (diff)
caps: avoid using in-place oprations
Rework some caps operations so they don't rely on writable caps but instead take ownership of the input caps and do _make_writable() only when needed. Remove some const from caps functions, it does not make much sense for refcounted objects and does not allow us to return a refcount to the const input caps. Rework the base classes fixate vmethods to not operate on the caps in-place. All this saves us around 30% of caps and structure copy and new operations.
Diffstat (limited to 'gst/gstcaps.h')
-rw-r--r--gst/gstcaps.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/gst/gstcaps.h b/gst/gstcaps.h
index 46031823d..442083565 100644
--- a/gst/gstcaps.h
+++ b/gst/gstcaps.h
@@ -384,20 +384,20 @@ void gst_static_caps_cleanup (GstStaticCaps *static_caps);
/* manipulation */
void gst_caps_append (GstCaps *caps1,
GstCaps *caps2);
-void gst_caps_merge (GstCaps *caps1,
- GstCaps *caps2);
void gst_caps_append_structure (GstCaps *caps,
GstStructure *structure);
void gst_caps_remove_structure (GstCaps *caps, guint idx);
-void gst_caps_merge_structure (GstCaps *caps,
- GstStructure *structure);
+GstCaps * gst_caps_merge (GstCaps *caps1,
+ GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
+GstCaps * gst_caps_merge_structure (GstCaps *caps,
+ GstStructure *structure) G_GNUC_WARN_UNUSED_RESULT;
guint gst_caps_get_size (const GstCaps *caps);
GstStructure * gst_caps_get_structure (const GstCaps *caps,
guint index);
-GstStructure * gst_caps_steal_structure (GstCaps *caps,
+GstStructure * gst_caps_steal_structure (GstCaps *caps,
guint index) G_GNUC_WARN_UNUSED_RESULT;
GstCaps * gst_caps_copy_nth (const GstCaps *caps, guint nth) G_GNUC_WARN_UNUSED_RESULT;
-void gst_caps_truncate (GstCaps *caps);
+GstCaps * gst_caps_truncate (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
void gst_caps_set_value (GstCaps *caps,
const char *field,
const GValue *value);
@@ -428,19 +428,19 @@ gboolean gst_caps_is_strictly_equal (const GstCaps *caps1,
/* operations */
-GstCaps * gst_caps_intersect (const GstCaps *caps1,
- const GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
-GstCaps * gst_caps_intersect_full (const GstCaps *caps1,
- const GstCaps *caps2,
+GstCaps * gst_caps_intersect (GstCaps *caps1,
+ GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
+GstCaps * gst_caps_intersect_full (GstCaps *caps1,
+ GstCaps *caps2,
GstCapsIntersectMode mode) G_GNUC_WARN_UNUSED_RESULT;
-GstCaps * gst_caps_subtract (const GstCaps *minuend,
- const GstCaps *subtrahend) G_GNUC_WARN_UNUSED_RESULT;
-GstCaps * gst_caps_union (const GstCaps *caps1,
- const GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
-GstCaps * gst_caps_normalize (const GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
-gboolean gst_caps_do_simplify (GstCaps *caps);
-
-void gst_caps_fixate (GstCaps *caps);
+GstCaps * gst_caps_subtract (GstCaps *minuend,
+ GstCaps *subtrahend) G_GNUC_WARN_UNUSED_RESULT;
+GstCaps * gst_caps_union (GstCaps *caps1,
+ GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
+GstCaps * gst_caps_normalize (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
+gboolean gst_caps_do_simplify (GstCaps *caps);
+
+GstCaps * gst_caps_fixate (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
/* utility */
gchar * gst_caps_to_string (const GstCaps *caps) G_GNUC_MALLOC;