[0.11] gstreamer: caps: add empty_simple variants

Wim Taymans wtay at kemper.freedesktop.org
Thu Oct 27 08:10:26 PDT 2011


Module: gstreamer
Branch: 0.11
Commit: d9c8ab67a06caca46a84e0c17c009df704c0be2d
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=d9c8ab67a06caca46a84e0c17c009df704c0be2d

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Oct 27 17:09:04 2011 +0200

caps: add empty_simple variants

---

 gst/gstcaps.c |   24 ++++++++++++++++++++++++
 gst/gstcaps.h |    1 +
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/gst/gstcaps.c b/gst/gstcaps.c
index 88dead6..09c0f46 100644
--- a/gst/gstcaps.c
+++ b/gst/gstcaps.c
@@ -233,6 +233,30 @@ gst_caps_new_any (void)
 }
 
 /**
+ * gst_caps_new_empty_simple:
+ * @media_type: the media type of the structure
+ *
+ * Creates a new #GstCaps that contains one #GstStructure with name
+ * @media_type.
+ * Caller is responsible for unreffing the returned caps.
+ *
+ * Returns: (transfer full): the new #GstCaps
+ */
+GstCaps *
+gst_caps_new_empty_simple (const char *media_type)
+{
+  GstCaps *caps;
+  GstStructure *structure;
+
+  caps = gst_caps_new_empty ();
+  structure = gst_structure_empty_new (media_type);
+  if (structure)
+    gst_caps_append_structure_unchecked (caps, structure);
+
+  return caps;
+}
+
+/**
  * gst_caps_new_simple:
  * @media_type: the media type of the structure
  * @fieldname: first field to set
diff --git a/gst/gstcaps.h b/gst/gstcaps.h
index fb224f8..9101a87 100644
--- a/gst/gstcaps.h
+++ b/gst/gstcaps.h
@@ -340,6 +340,7 @@ GType             gst_caps_get_type                (void);
 
 GstCaps *         gst_caps_new_empty               (void);
 GstCaps *         gst_caps_new_any                 (void);
+GstCaps *         gst_caps_new_empty_simple        (const char    *media_type);
 GstCaps *         gst_caps_new_simple              (const char    *media_type,
                                                     const char    *fieldname,
                                                     ...) G_GNUC_NULL_TERMINATED;



More information about the gstreamer-commits mailing list