summaryrefslogtreecommitdiff
path: root/gst/gststructure.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-05-29 18:22:42 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-05-29 19:28:10 +0100
commitc8acbbfde087516135b58b6be34235390ee06e19 (patch)
tree07d4c02def8fe4c13fc119d22114aae8e0c7a93f /gst/gststructure.c
parentbc7c7e983668f5379cc192935367def6831965d7 (diff)
structure: add gst_structure_id_new() convenience function
Add convenience wrapper for gst_structure_id_empty_new() plus gst_structure_id_set() and use it in a few places. API: gst_structure_id_new()
Diffstat (limited to 'gst/gststructure.c')
-rw-r--r--gst/gststructure.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gst/gststructure.c b/gst/gststructure.c
index 13ffd220c..3ac555523 100644
--- a/gst/gststructure.c
+++ b/gst/gststructure.c
@@ -608,6 +608,41 @@ gst_structure_id_set_valist (GstStructure * structure,
}
}
+/**
+ * gst_structure_id_new:
+ * @name_quark: name of new structure
+ * @field_quark: the GQuark for the name of the field to set
+ * @...: variable arguments
+ *
+ * Creates a new #GstStructure with the given name as a GQuark, followed by
+ * fieldname quark, GType, argument(s) "triplets" in the same format as
+ * gst_structure_id_set(). Basically a convenience wrapper around
+ * gst_structure_id_empty_new() and gst_structure_id_set().
+ *
+ * The last variable argument must be NULL (or 0).
+ *
+ * Returns: a new #GstStructure
+ *
+ * Since: 0.10.24
+ */
+GstStructure *
+gst_structure_id_new (GQuark name_quark, GQuark field_quark, ...)
+{
+ GstStructure *s;
+ va_list varargs;
+
+ g_return_val_if_fail (name_quark != 0, NULL);
+ g_return_val_if_fail (field_quark != 0, NULL);
+
+ s = gst_structure_id_empty_new (name_quark);
+
+ va_start (varargs, field_quark);
+ gst_structure_id_set_valist (s, field_quark, varargs);
+ va_end (varargs);
+
+ return s;
+}
+
/* If the structure currently contains a field with the same name, it is
* replaced with the provided field. Otherwise, the field is added to the
* structure. The field's value is not deeply copied.