summaryrefslogtreecommitdiffstats
path: root/tests/examples/app/appsrc_ex.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-24 16:36:28 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-24 16:36:28 +0100
commit9d4c7e68abc7ed97dae8e54166be8462fe54cec1 (patch)
tree0a97a38d23508e8824d15423e4c4adabe838082a /tests/examples/app/appsrc_ex.c
parentf0ae68d9440e90711c7b547f03d7165357b9c4ac (diff)
downloadgst-plugins-bad-9d4c7e68abc7ed97dae8e54166be8462fe54cec1.tar.gz
gst-plugins-bad-9d4c7e68abc7ed97dae8e54166be8462fe54cec1.tar.bz2
gst-plugins-bad-9d4c7e68abc7ed97dae8e54166be8462fe54cec1.zip
Remove tests/examples/app as it was moved to -base a long time ago
Diffstat (limited to 'tests/examples/app/appsrc_ex.c')
-rw-r--r--tests/examples/app/appsrc_ex.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/tests/examples/app/appsrc_ex.c b/tests/examples/app/appsrc_ex.c
deleted file mode 100644
index bc629fb0..00000000
--- a/tests/examples/app/appsrc_ex.c
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gst/gst.h>
-#include <gst/app/gstappsrc.h>
-#include <gst/app/gstappbuffer.h>
-#include <gst/app/gstappsink.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-
-typedef struct _App App;
-struct _App
-{
- GstElement *pipe;
- GstElement *src;
- GstElement *id;
- GstElement *sink;
-};
-
-App s_app;
-
-static void dont_eat_my_chicken_wings (void *priv);
-
-int
-main (int argc, char *argv[])
-{
- App *app = &s_app;
- int i;
-
- gst_init (&argc, &argv);
-
- app->pipe = gst_pipeline_new (NULL);
- g_assert (app->pipe);
-
- app->src = gst_element_factory_make ("appsrc", NULL);
- g_assert (app->src);
- gst_bin_add (GST_BIN (app->pipe), app->src);
-
- app->id = gst_element_factory_make ("identity", NULL);
- g_assert (app->id);
- gst_bin_add (GST_BIN (app->pipe), app->id);
-
- app->sink = gst_element_factory_make ("appsink", NULL);
- g_assert (app->sink);
- gst_bin_add (GST_BIN (app->pipe), app->sink);
-
- gst_element_link (app->src, app->id);
- gst_element_link (app->id, app->sink);
-
- gst_element_set_state (app->pipe, GST_STATE_PLAYING);
-
- for (i = 0; i < 10; i++) {
- GstBuffer *buf;
- void *data;
-
- data = malloc (100);
- 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);
- gst_app_src_push_buffer (GST_APP_SRC (app->src), buf);
- }
-
- gst_app_src_end_of_stream (GST_APP_SRC (app->src));
-
- while (!gst_app_sink_is_eos (GST_APP_SINK (app->sink))) {
- GstBuffer *buf;
-
- buf = gst_app_sink_pull_buffer (GST_APP_SINK (app->sink));
- printf ("retrieved buffer %p\n", buf);
- gst_buffer_unref (buf);
- }
- gst_element_set_state (app->pipe, GST_STATE_NULL);
-
- return 0;
-}
-
-static void
-dont_eat_my_chicken_wings (void *priv)
-{
- printf ("freeing buffer for pointer %p\n", priv);
- free (priv);
-}