gst_tag_get_flag
gst_tag_is_fixed
gst_tag_list_new
+gst_tag_list_new_full
+gst_tag_list_new_full_valist
gst_is_tag_list
gst_tag_list_is_empty
gst_tag_list_copy
}
/**
+ * gst_tag_list_new_full:
+ * @tag: tag
+ * @...: NULL-terminated list of values to set
+ *
+ * Creates a new taglist and appends the values for the given tags. It expects
+ * tag-value pairs like gst_tag_list_add(), and a NULL terminator after the
+ * last pair. The type of the values is implicit and is documented in the API
+ * reference, but can also be queried at runtime with gst_tag_get_type(). It
+ * is an error to pass a value of a type not matching the tag type into this
+ * function. The tag list will make copies of any arguments passed
+ * (e.g. strings, buffers).
+ *
+ * Returns: a new #GstTagList. Free with gst_tag_list_free() when no longer
+ * needed.
+ *
+ * Since: 0.10.24
+ */
+/* FIXME 0.11: rename gst_tag_list_new_full to _new and _new to _new_empty */
+GstTagList *
+gst_tag_list_new_full (const gchar * tag, ...)
+{
+ GstTagList *list;
+ va_list args;
+
+ g_return_val_if_fail (tag != NULL, NULL);
+
+ list = gst_tag_list_new ();
+ va_start (args, tag);
+ gst_tag_list_add_valist (list, GST_TAG_MERGE_APPEND, tag, args);
+ va_end (args);
+
+ return list;
+}
+
+/**
+ * gst_tag_list_new_full_valist:
+ * @var_args: tag / value pairs to set
+ *
+ * Just like gst_tag_list_new_full(), only that it takes a va_list argument.
+ * Useful mostly for language bindings.
+ *
+ * Returns: a new #GstTagList. Free with gst_tag_list_free() when no longer
+ * needed.
+ *
+ * Since: 0.10.24
+ */
+GstTagList *
+gst_tag_list_new_full_valist (va_list var_args)
+{
+ GstTagList *list;
+ const gchar *tag;
+
+ list = gst_tag_list_new ();
+
+ tag = va_arg (var_args, gchar *);
+ gst_tag_list_add_valist (list, GST_TAG_MERGE_APPEND, tag, var_args);
+
+ return list;
+}
+
+/**
* gst_tag_list_is_empty:
* @list: A #GstTagList.
*
/* tag lists */
GstTagList * gst_tag_list_new (void);
+GstTagList * gst_tag_list_new_full (const gchar * tag, ...);
+GstTagList * gst_tag_list_new_full_valist (va_list var_args);
+
gboolean gst_is_tag_list (gconstpointer p);
GstTagList * gst_tag_list_copy (const GstTagList * list);
gboolean gst_tag_list_is_empty (const GstTagList * list);
GST_END_TEST;
+GST_START_TEST (test_new_full)
+{
+ GstTagList *tags;
+ gchar *artist, *title;
+ gdouble track_gain;
+ guint track_num;
+
+ tags = gst_tag_list_new_full (GST_TAG_ARTIST, "Arty Ist",
+ GST_TAG_TRACK_NUMBER, 9, GST_TAG_TRACK_GAIN, 4.242, GST_TAG_TITLE,
+ "Title!", NULL);
+
+ fail_unless (gst_tag_list_get_string (tags, GST_TAG_ARTIST, &artist));
+ fail_unless_equals_string (artist, "Arty Ist");
+ fail_unless (gst_tag_list_get_string (tags, GST_TAG_TITLE, &title));
+ fail_unless_equals_string (title, "Title!");
+ fail_unless (gst_tag_list_get_uint (tags, GST_TAG_TRACK_NUMBER, &track_num));
+ fail_unless_equals_int (track_num, 9);
+ fail_unless (gst_tag_list_get_double (tags, GST_TAG_TRACK_GAIN, &track_gain));
+ fail_unless_equals_float (track_gain, 4.242);
+ fail_unless (tags != NULL);
+
+ gst_tag_list_free (tags);
+ g_free (artist);
+ g_free (title);
+}
+
+GST_END_TEST;
+
static Suite *
gst_tag_suite (void)
{
tcase_add_test (tc_chain, test_set_non_utf8_string);
tcase_add_test (tc_chain, test_buffer_tags);
tcase_add_test (tc_chain, test_empty_tags);
+ tcase_add_test (tc_chain, test_new_full);
return s;
}
gst_tag_list_is_empty
gst_tag_list_merge
gst_tag_list_new
+ gst_tag_list_new_full
+ gst_tag_list_new_full_valist
gst_tag_list_remove_tag
gst_tag_merge_mode_get_type
gst_tag_merge_strings_with_comma