diff --git a/gst/gststructure.c b/gst/gststructure.c index 4ab57881eb..56b66bcca5 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -1681,6 +1681,8 @@ gst_structure_get_abbrs (gint * n_abbrs) {"datetime", GST_TYPE_DATE_TIME} , {"bitmask", GST_TYPE_BITMASK} + , + {"taglist", GST_TYPE_TAG_LIST} }; _num = G_N_ELEMENTS (dyn_abbrs); /* permanently allocate and copy the array now */ diff --git a/gst/gstvalue.c b/gst/gstvalue.c index ca229268a7..da46859d03 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -1958,6 +1958,43 @@ gst_value_deserialize_structure (GValue * dest, const gchar * s) return FALSE; } +/************** + * GstTagList * + **************/ + +static gboolean +gst_value_deserialize_tag_list (GValue * dest, const gchar * s) +{ + GstTagList *taglist; + + if (*s != '"') { + taglist = gst_tag_list_new_from_string (s); + } else { + gchar *str = gst_string_unwrap (s); + + if (G_UNLIKELY (!str)) + return FALSE; + + taglist = gst_tag_list_new_from_string (str); + g_free (str); + } + + if (G_LIKELY (taglist != NULL)) { + g_value_take_boxed (dest, taglist); + return TRUE; + } + return FALSE; +} + +static gchar * +gst_value_serialize_tag_list (const GValue * value) +{ + GstTagList *taglist = g_value_get_boxed (value); + + return gst_string_take_and_wrap (gst_tag_list_to_string (taglist)); +} + + /************* * GstBuffer * *************/ @@ -5806,6 +5843,17 @@ _priv_gst_value_initialize (void) gst_value.type = GST_TYPE_STRUCTURE; gst_value_register (&gst_value); } + { + static GstValueTable gst_value = { + 0, + NULL, + gst_value_serialize_tag_list, + gst_value_deserialize_tag_list, + }; + + gst_value.type = GST_TYPE_TAG_LIST; + gst_value_register (&gst_value); + } { static GstValueTable gst_value = { 0,