gst-indent run on core
[platform/upstream/gstreamer.git] / tests / old / testsuite / cleanup / cleanup4.c
1 #include <gst/gst.h>
2
3 gint
4 main (gint argc, gchar * argv[])
5 {
6   GstElement *pipeline;
7   GstElement *fakesrc;
8   gint i;
9
10   free (malloc (8));            /* -lefence */
11
12   gst_init (&argc, &argv);
13
14   i = 1000;
15
16   pipeline = gst_pipeline_new ("main_pipeline");
17
18   fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
19   g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
20   gst_bin_add (GST_BIN (pipeline), fakesrc);
21
22   g_mem_chunk_info ();
23   while (i--) {
24     GstElement *bin;
25     GstElement *fakesink;
26
27     g_print ("+");
28
29     bin = gst_bin_new ("bin");
30
31     fakesink = gst_element_factory_make ("fakesink", "fakesink");
32
33     gst_element_link (fakesrc, fakesink);
34
35     gst_bin_add (GST_BIN (bin), fakesink);
36     gst_bin_add (GST_BIN (pipeline), bin);
37
38     gst_element_set_state (pipeline, GST_STATE_PLAYING);
39
40     while (gst_bin_iterate (GST_BIN (pipeline)));
41
42     gst_element_set_state (pipeline, GST_STATE_NULL);
43
44     g_print ("-");
45     gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin));
46
47   }
48   g_print ("\n");
49   g_mem_chunk_info ();
50
51   return 0;
52 }