diff --git a/tests/examples/app/appsink-src.c b/tests/examples/app/appsink-src.c index a92dfb51f6..d102d6ae57 100644 --- a/tests/examples/app/appsink-src.c +++ b/tests/examples/app/appsink-src.c @@ -4,7 +4,6 @@ #include #include -#include /* 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 */ diff --git a/tests/examples/app/appsrc_ex.c b/tests/examples/app/appsrc_ex.c index c7aa4b6c87..26bb484943 100644 --- a/tests/examples/app/appsrc_ex.c +++ b/tests/examples/app/appsrc_ex.c @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -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); -}