From 4ca6694e09fcdf8a919f287628474d00d5b3bd9b Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 14 Jul 2014 18:23:43 -0300 Subject: [PATCH] gstvalue: add GstTagList compare function When serializing GstStructures from events in GDP it will add a taglist as a GstStructure field, having the compare function allows comparison of GstStructures to check if the serialized/deserialized version matches the original one, among other cases. https://bugzilla.gnome.org/show_bug.cgi?id=733131 --- gst/gstvalue.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gst/gstvalue.c b/gst/gstvalue.c index 964431c82a..d50b4c465b 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -2159,6 +2159,16 @@ gst_value_deserialize_caps_features (GValue * dest, const gchar * s) /************** * GstTagList * **************/ +static gint +gst_value_compare_tag_list (const GValue * value1, const GValue * value2) +{ + GstTagList *taglist1 = GST_TAG_LIST (g_value_get_boxed (value1)); + GstTagList *taglist2 = GST_TAG_LIST (g_value_get_boxed (value2)); + + if (gst_tag_list_is_equal (taglist1, taglist2)) + return GST_VALUE_EQUAL; + return GST_VALUE_UNORDERED; +} static gboolean gst_value_deserialize_tag_list (GValue * dest, const gchar * s) @@ -6295,7 +6305,7 @@ _priv_gst_value_initialize (void) { static GstValueTable gst_value = { 0, - NULL, + gst_value_compare_tag_list, gst_value_serialize_tag_list, gst_value_deserialize_tag_list, };