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
This commit is contained in:
Thiago Santos 2014-07-14 18:23:43 -03:00
parent 6d05df01b0
commit 4ca6694e09

View file

@ -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,
};