+2004-04-23 Benjamin Otte <otte@gnome.org>
+
+ * gst/gstvalue.c: (gst_value_compare_buffer),
+ (_gst_value_initialize):
+ add comparison function for buffers
+
2004-04-22 Ronald Bultje <rbultje@ronald.bitfreak.net>
* docs/pwg/pwg.xml:
/*************************************/
/* GstBuffer */
+static int
+gst_value_compare_buffer (const GValue * value1, const GValue * value2)
+{
+ GstBuffer *buf1 = g_value_get_boxed (value1);
+ GstBuffer *buf2 = g_value_get_boxed (value2);
+
+ if (GST_BUFFER_SIZE (buf1) != GST_BUFFER_SIZE (buf2))
+ return GST_VALUE_UNORDERED;
+ if (GST_BUFFER_SIZE (buf1) == 0)
+ return GST_VALUE_EQUAL;
+ g_assert (GST_BUFFER_DATA (buf1));
+ g_assert (GST_BUFFER_DATA (buf2));
+ if (memcmp (GST_BUFFER_DATA (buf1), GST_BUFFER_DATA (buf2),
+ GST_BUFFER_SIZE (buf1)) == 0)
+ return GST_VALUE_EQUAL;
+
+ return GST_VALUE_UNORDERED;
+}
+
static char *
gst_value_serialize_buffer (const GValue * value)
{
#endif
static GstValueTable gst_value = {
0,
- NULL, /*gst_value_compare_buffer, */
+ gst_value_compare_buffer,
gst_value_serialize_buffer,
gst_value_deserialize_buffer,
};