Add GST_CAPS_NONE and GST_CAPS_ANY
authorDavid Schleef <ds@schleef.org>
Tue, 19 Aug 2003 04:08:29 +0000 (04:08 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 19 Aug 2003 04:08:29 +0000 (04:08 +0000)
Original commit message from CVS:
Add GST_CAPS_NONE and GST_CAPS_ANY

gst/gstcaps.c
gst/gstcaps.h

index 9b3bc39..bce958c 100644 (file)
@@ -270,6 +270,31 @@ gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props)
 }
 
 /**
+ * gst_caps_get_any:
+ *
+ * Return a copy of the caps that represents any capability.
+ *
+ * Returns: the ANY capability
+ */
+GstCaps*
+gst_caps_get_any (void)
+{
+#if 0
+  static GstCaps *caps;
+
+  if (!caps){
+    caps = GST_CAPS_NEW ("gst_caps_any", "*", NULL);
+    gst_caps_ref(caps);
+    gst_caps_sink(caps);
+  }
+
+  return gst_caps_ref(caps);
+#else
+  return NULL;
+#endif
+}
+
+/**
  * gst_caps_replace:
  * @oldcaps: the caps to take replace
  * @newcaps: the caps to take replace 
index 13dbaf0..d781247 100644 (file)
@@ -57,6 +57,9 @@ typedef enum {
 #define GST_CAPS_IS_FLOATING(caps)     (GST_CAPS_FLAG_IS_SET ((caps), GST_CAPS_FLOATING))
 #define GST_CAPS_IS_CHAINED(caps)      (GST_CAPS_NEXT (caps) != NULL)
 
+#define GST_CAPS_NONE                  NULL
+#define GST_CAPS_ANY                   (gst_caps_get_any())
+
 struct _GstCaps {
   /* --- public --- */
   gchar        *name;                  /* the name of this caps */
@@ -124,6 +127,7 @@ void                _gst_caps_initialize                    (void);
 GType          gst_caps_get_type                       (void);
 GstCaps*       gst_caps_new                            (const gchar *name, const gchar *mime, GstProps *props);
 GstCaps*       gst_caps_new_id                         (const gchar *name, const guint16 id, GstProps *props);
+GstCaps*       gst_caps_get_any                        (void);
 /* replace pointer to caps, doing proper refcounting */
 void           gst_caps_replace                        (GstCaps **oldcaps, GstCaps *newcaps);
 void           gst_caps_replace_sink                   (GstCaps **oldcaps, GstCaps *newcaps);