tests: fix some tests now that appbuffer is gone

This commit is contained in:
Wim Taymans 2011-02-24 12:19:27 +01:00
parent fc06cf80c9
commit 5e6339b055
2 changed files with 5 additions and 16 deletions

View file

@ -4,7 +4,6 @@
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>
#include <gst/app/gstappbuffer.h>
/* these are the caps we are going to pass through the appsink and appsrc */
const gchar *audio_caps =
@ -34,9 +33,9 @@ on_new_buffer_from_source (GstElement * elt, ProgramData * data)
* the retrieved buffer from appsink into appsrc just fine. */
size = GST_BUFFER_SIZE (buffer);
g_print ("Pushing a buffer of size %d\n", size);
raw_buffer = g_malloc0 (size);
app_buffer = gst_buffer_new_and_alloc (size);
raw_buffer = GST_BUFFER_DATA (app_buffer);
memcpy (raw_buffer, GST_BUFFER_DATA (buffer), size);
app_buffer = gst_app_buffer_new (raw_buffer, size, g_free, raw_buffer);
/* newer basesrc will set caps for use automatically but it does not really
* hurt to set it on the buffer again */

View file

@ -6,7 +6,6 @@
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappbuffer.h>
#include <gst/app/gstappsink.h>
#include <stdio.h>
@ -25,8 +24,6 @@ struct _App
App s_app;
static void dont_eat_my_chicken_wings (void *priv);
int
main (int argc, char *argv[])
{
@ -59,11 +56,11 @@ main (int argc, char *argv[])
GstBuffer *buf;
void *data;
data = malloc (100);
buf = gst_buffer_new_and_alloc (100);
data = GST_BUFFER_DATA (buf);
memset (data, i, 100);
buf = gst_app_buffer_new (data, 100, dont_eat_my_chicken_wings, data);
printf ("%d: creating buffer for pointer %p, %p\n", i, data, buf);
printf ("%d: pushing buffer for pointer %p, %p\n", i, data, buf);
gst_app_src_push_buffer (GST_APP_SRC (app->src), buf);
}
@ -86,10 +83,3 @@ main (int argc, char *argv[])
return 0;
}
static void
dont_eat_my_chicken_wings (void *priv)
{
printf ("freeing buffer for pointer %p\n", priv);
free (priv);
}