gboolean res;
gpointer data;
- data = gst_buffer_map (buf, NULL, NULL, GST_META_MAP_READ);
+ data = gst_buffer_map (buf, NULL, NULL, GST_MAP_READ);
res = memcmp (data, str, size) == 0;
+ GST_DEBUG ("%s <-> %s: %d", (gchar *) data, str, res);
gst_buffer_unmap (buf, data, size);
return res;
GstPadLinkReturn plr;
GstCaps *caps;
GstBufferList *list;
- GstBufferListIterator *it;
GstBuffer *buffer;
+ guint len;
/* setup */
sink = gst_pad_new ("sink", GST_PAD_SINK);
/* test */
/* adding to a buffer list will drop the ref to the buffer */
- it = gst_buffer_list_iterate (list);
- gst_buffer_list_iterator_add_group (it);
- gst_buffer_list_iterator_add (it, buffer_from_string ("List"));
- gst_buffer_list_iterator_add (it, buffer_from_string ("Group"));
- gst_buffer_list_iterator_add_group (it);
- gst_buffer_list_iterator_add (it, buffer_from_string ("Another"));
- gst_buffer_list_iterator_add (it, buffer_from_string ("List"));
- gst_buffer_list_iterator_add (it, buffer_from_string ("Group"));
- gst_buffer_list_iterator_free (it);
+ len = gst_buffer_list_len (list);
+
+ gst_buffer_list_add (list, buffer_from_string ("ListGroup"));
+ gst_buffer_list_add (list, buffer_from_string ("AnotherListGroup"));
+
fail_unless (gst_pad_push_list (src, list) == GST_FLOW_OK);
fail_unless_equals_int (g_list_length (buffers), 2);
buffer = GST_BUFFER (buffers->data);
ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 1);
- fail_unless (buffer_compare (buffer, "ListGroup", 9) == 0);
+ fail_unless (buffer_compare (buffer, "ListGroup", 9));
gst_buffer_unref (buffer);
buffers = g_list_delete_link (buffers, buffers);
buffer = GST_BUFFER (buffers->data);
ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 1);
- fail_unless (buffer_compare (buffer, "AnotherListGroup", 16) == 0);
+ fail_unless (buffer_compare (buffer, "AnotherListGroup", 16));
gst_buffer_unref (buffer);
buffers = g_list_delete_link (buffers, buffers);
fail_unless (buffers == NULL);
/* Should fail if src pad caps are incompatible with sink pad caps */
gst_pad_set_caps (src, caps);
- gst_buffer_set_caps (buffer, caps);
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_NOT_NEGOTIATED);
ASSERT_MINI_OBJECT_REFCOUNT (buffer, "buffer", 1);