From: David Schleef Date: Tue, 19 Aug 2003 04:08:29 +0000 (+0000) Subject: Add GST_CAPS_NONE and GST_CAPS_ANY X-Git-Tag: BRANCH-ERROR-ROOT~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a937894b486df869716759e709dbc47b7e8bad85;p=platform%2Fupstream%2Fgstreamer.git Add GST_CAPS_NONE and GST_CAPS_ANY Original commit message from CVS: Add GST_CAPS_NONE and GST_CAPS_ANY --- diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 9b3bc39..bce958c 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -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 diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 13dbaf0..d781247 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -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);