2001-12-20 20:06:45 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
gint
|
|
|
|
main (gint argc, gchar *argv[])
|
|
|
|
{
|
|
|
|
GstElement *pipeline;
|
|
|
|
GstElement *fakesrc;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
free (malloc(8)); /* -lefence */
|
|
|
|
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
|
|
|
|
i = 10000;
|
|
|
|
|
|
|
|
pipeline = gst_pipeline_new ("main_pipeline");
|
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
|
2001-12-20 20:06:45 +00:00
|
|
|
g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
|
|
|
|
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
|
|
|
|
|
|
|
g_mem_chunk_info ();
|
|
|
|
while (i--) {
|
|
|
|
GstElement *bin;
|
|
|
|
GstElement *fakesink;
|
|
|
|
|
2002-11-29 13:59:30 +00:00
|
|
|
g_print ("+");
|
2001-12-20 20:06:45 +00:00
|
|
|
|
|
|
|
bin = gst_bin_new ("bin");
|
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
fakesink = gst_element_factory_make ("fakesink", "fakesink");
|
2001-12-20 20:06:45 +00:00
|
|
|
|
2003-01-10 04:54:20 +00:00
|
|
|
gst_element_link (fakesrc, fakesink);
|
2001-12-20 20:06:45 +00:00
|
|
|
|
|
|
|
gst_bin_add (GST_BIN (bin), fakesink);
|
|
|
|
gst_bin_add (GST_BIN (pipeline), bin);
|
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
|
|
|
|
|
|
|
while (gst_bin_iterate (GST_BIN (pipeline)));
|
|
|
|
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
|
|
|
|
2002-11-29 13:59:30 +00:00
|
|
|
g_print ("-");
|
2001-12-20 20:06:45 +00:00
|
|
|
gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin));
|
|
|
|
|
|
|
|
}
|
2002-11-29 13:59:30 +00:00
|
|
|
g_print ("\n");
|
2001-12-20 20:06:45 +00:00
|
|
|
g_mem_chunk_info ();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|