caps: remove gst_caps_union()
[platform/upstream/gstreamer.git] / gst / gstcaps.h
index 5ba64be..f229742 100644 (file)
@@ -27,7 +27,7 @@
 
 G_BEGIN_DECLS
 
-extern GType _gst_caps_type;
+GST_EXPORT GType _gst_caps_type;
 
 #define GST_TYPE_CAPS             (_gst_caps_type)
 #define GST_IS_CAPS(obj)          (GST_IS_MINI_OBJECT_TYPE((obj), GST_TYPE_CAPS))
@@ -83,16 +83,18 @@ typedef enum {
  * GST_CAPS_ANY:
  *
  * Means that the element/pad can output 'anything'. Useful for elements
- * that output unknown media, such as filesrc.
+ * that output unknown media, such as filesrc. This macro returns a singleton and
+ * should not be unreffed.
  */
-#define GST_CAPS_ANY              gst_caps_new_any()
+#define GST_CAPS_ANY              _gst_caps_any
 /**
  * GST_CAPS_NONE:
  *
  * The opposite of %GST_CAPS_ANY: it means that the pad/element outputs an
- * undefined media type that can not be detected.
+ * undefined media type that can not be detected. This macro returns a singleton
+ * and should not be unreffed.
  */
-#define GST_CAPS_NONE             gst_caps_new_empty()
+#define GST_CAPS_NONE             _gst_caps_none
 
 /**
  * GST_STATIC_CAPS_ANY:
@@ -127,8 +129,7 @@ typedef enum {
  */
 #define GST_STATIC_CAPS(string) \
 { \
-  /* miniobject */ { { 0, 0, 0, 0, NULL, NULL, NULL, 0, NULL }, \
-  /* caps */ NULL }, \
+  /* caps */ NULL, \
   /* string */ string, \
   GST_PADDING_INIT \
 }
@@ -136,6 +137,8 @@ typedef enum {
 typedef struct _GstCaps GstCaps;
 typedef struct _GstStaticCaps GstStaticCaps;
 
+GST_EXPORT GstCaps * _gst_caps_any;
+GST_EXPORT GstCaps * _gst_caps_none;
 /**
  * GST_CAPS_FLAGS:
  * @caps: a #GstCaps.
@@ -341,9 +344,6 @@ gst_caps_take (GstCaps **old_caps, GstCaps *new_caps)
  */
 struct _GstCaps {
   GstMiniObject mini_object;
-
-  /*< private >*/
-  gpointer     priv;
 };
 
 /**
@@ -357,7 +357,7 @@ struct _GstCaps {
  */
 struct _GstStaticCaps {
   /*< public >*/
-  GstCaps caps;
+  GstCaps *caps;
   const char *string;
 
   /*< private >*/
@@ -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,17 @@ 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_normalize               (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
+GstCaps *         gst_caps_simplify                (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
+
+GstCaps *         gst_caps_fixate                  (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
 
 /* utility */
 gchar *           gst_caps_to_string               (const GstCaps *caps) G_GNUC_MALLOC;