structure: Add gst_structure_new_from_string()
authorSebastian Dröge <slomo@circular-chaos.org>
Fri, 14 Jun 2013 11:05:38 +0000 (13:05 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Fri, 14 Jun 2013 11:05:38 +0000 (13:05 +0200)
Convenience API for bindings, gst_structure_from_string() returns
a tuple (structure, end_ptr) in bindings and is unintuitive to use
because of that.

docs/gst/gstreamer-sections.txt
gst/gststructure.c
gst/gststructure.h
win32/common/libgstreamer.def

index b0ae703..49c31cf 100644 (file)
@@ -2474,6 +2474,7 @@ gst_structure_new_id_empty
 gst_structure_new
 gst_structure_new_valist
 gst_structure_new_id
+gst_structure_new_from_string
 gst_structure_copy
 gst_structure_free
 gst_structure_get_name
index 06d7f0d..f164d16 100644 (file)
@@ -2308,9 +2308,30 @@ priv_gst_structure_parse_fields (gchar * str, gchar ** end,
 }
 
 /**
+ * gst_structure_new_from_string:
+ * @string: a string representation of a #GstStructure
+ *
+ * Creates a #GstStructure from a string representation.
+ * If end is not NULL, a pointer to the place inside the given string
+ * where parsing ended will be returned.
+ *
+ * Free-function: gst_structure_free
+ *
+ * Returns: (transfer full): a new #GstStructure or NULL when the string could
+ *     not be parsed. Free with gst_structure_free() after use.
+ *
+ * Since: 1.2
+ */
+GstStructure *
+gst_structure_new_from_string (const gchar * string)
+{
+  return gst_structure_from_string (string, NULL);
+}
+
+/**
  * gst_structure_from_string:
  * @string: a string representation of a #GstStructure.
- * @end: (out) (allow-none) (transfer none): pointer to store the end of the string in.
+ * @end: (out) (allow-none) (transfer none) (skip): pointer to store the end of the string in.
  *
  * Creates a #GstStructure from a string representation.
  * If end is not NULL, a pointer to the place inside the given string
index 0e43912..f7cc61b 100644 (file)
@@ -101,6 +101,8 @@ GstStructure *        gst_structure_new_id               (GQuark name_quark,
                                                           GQuark field_quark,
                                                           ...) G_GNUC_MALLOC;
 
+GstStructure *        gst_structure_new_from_string      (const gchar * string);
+
 GstStructure *        gst_structure_copy                 (const GstStructure  * structure) G_GNUC_MALLOC;
 
 gboolean              gst_structure_set_parent_refcount  (GstStructure        * structure,
index 2ff2362..4f89ad1 100644 (file)
@@ -1102,6 +1102,7 @@ EXPORTS
        gst_structure_n_fields
        gst_structure_new
        gst_structure_new_empty
+       gst_structure_new_from_string
        gst_structure_new_id
        gst_structure_new_id_empty
        gst_structure_new_valist