diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index b0ae703e18..49c31cf86c 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -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 diff --git a/gst/gststructure.c b/gst/gststructure.c index 06d7f0d5b2..f164d163df 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -2307,10 +2307,31 @@ priv_gst_structure_parse_fields (gchar * str, gchar ** end, return TRUE; } +/** + * 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 diff --git a/gst/gststructure.h b/gst/gststructure.h index 0e43912e3c..f7cc61b05a 100644 --- a/gst/gststructure.h +++ b/gst/gststructure.h @@ -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, diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 2ff23622bd..4f89ad16c2 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -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