]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/blob - tests/old/testsuite/cleanup/cleanup1.c
don't mix tabs and spaces
[glsdk/gstreamer0-10.git] / tests / old / testsuite / cleanup / cleanup1.c
1 #include <gst/gst.h>
3 static GstElement *
4 create_pipeline (void)
5 {
6   GstElement *fakesrc, *fakesink;
7   GstElement *pipeline;
10   pipeline = gst_pipeline_new ("main_pipeline");
12   fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
13   fakesink = gst_element_factory_make ("fakesink", "fakesink");
15   gst_element_link (fakesrc, fakesink);
17   gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
19   g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
21   return pipeline;
22 }
24 gint
25 main (gint argc, gchar * argv[])
26 {
27   GstElement *pipeline;
28   gint i = 1000;
29   gint step = 100;
31   free (malloc (8));            /* -lefence */
33   gst_init (&argc, &argv);
35   g_mem_chunk_info ();
36   while (i--) {
37     if (i % step == 0)
38       fprintf (stderr, "%10d\r", i);
39     pipeline = create_pipeline ();
41     gst_element_set_state (pipeline, GST_STATE_PLAYING);
43     while (gst_bin_iterate (GST_BIN (pipeline)));
45     gst_element_set_state (pipeline, GST_STATE_NULL);
47     gst_element_set_state (pipeline, GST_STATE_PLAYING);
49     while (gst_bin_iterate (GST_BIN (pipeline)));
51     gst_element_set_state (pipeline, GST_STATE_NULL);
53     gst_object_unref (GST_OBJECT (pipeline));
55   }
56   fprintf (stderr, "\n");
57   g_mem_chunk_info ();
59   return 0;
60 }