destroyed gst_*_destroy in the examples - use gst_object_unref instead - includes some tries to bufixes, most of the ...

Original commit message from CVS:
destroyed gst_*_destroy in the examples - use gst_object_unref instead - includes some tries to bufixes, most of the tests still fail
This commit is contained in:
Benjamin Otte 2003-04-15 18:17:24 +00:00
parent 50fa7dc2cd
commit e0cb191ed4
16 changed files with 84 additions and 84 deletions

View file

@ -147,7 +147,6 @@ main (int argc, char *argv[])
g_print ("Removing first sink\n");
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gst_pad_unlink (tee_src1, gst_element_get_pad (sink1, "sink"));
gst_pad_destroy (tee_src1);
gst_bin_remove (GST_BIN (pipeline), sink1);
/* only second fakesink linked, iterate */
@ -166,4 +165,3 @@ main (int argc, char *argv[])
g_print ("Done !\n");
return 0;
}

View file

@ -72,7 +72,7 @@ add_remove_test2 (void)
g_assert (!GST_OBJECT_FLOATING (element));
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
@ -92,7 +92,7 @@ add_remove_test3 (void)
gst_bin_add (GST_BIN (bin), element);
g_assert (!GST_OBJECT_FLOATING (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (bin), "test1") == NULL);
gst_object_unref (GST_OBJECT (bin));
@ -116,9 +116,9 @@ add_remove_test4 (void)
gst_bin_add (GST_BIN (bin), bin2);
g_assert (!GST_OBJECT_FLOATING (bin2));
gst_object_destroy (GST_OBJECT (bin2));
gst_object_unref (GST_OBJECT (bin2));
g_assert (gst_bin_get_by_name (GST_BIN (bin), "testbin") == NULL);
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (bin), "test1") == NULL);
gst_object_unref (GST_OBJECT (bin));
@ -170,14 +170,14 @@ main (int argc, gchar *argv[])
bin = gst_bin_new ("somebin");
g_assert (!GST_OBJECT_DESTROYED (bin));
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
g_assert (GST_OBJECT_DESTROYED (bin));
gst_object_unref (GST_OBJECT (bin));
g_print ("create/destroy/unref new bin %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
g_print ("create/destroy/unref %d bin %ld\n", iters, vmsize()-usage1);
@ -198,7 +198,7 @@ main (int argc, gchar *argv[])
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
g_print ("craete/ref/destroy/unref/unref new bin %ld\n", vmsize()-usage1);
@ -206,7 +206,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
@ -216,7 +216,7 @@ main (int argc, gchar *argv[])
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_element_set_name (bin, "testing123");
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_element_set_name (bin, "testing123");
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));

View file

@ -50,14 +50,14 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesrc", NULL);
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
g_print ("create/destroy/unref new element %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
g_print ("create/destroy/unref %d element %ld\n", iters, vmsize()-usage1);
@ -78,7 +78,7 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_print ("craete/ref/destroy/unref/unref new element %ld\n", vmsize()-usage1);
@ -86,7 +86,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
@ -96,7 +96,7 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_element_set_name (element, "testing123");
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_element_set_name (element, "testing123");
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));

View file

@ -57,7 +57,7 @@ main (int argc, gchar *argv[])
gst_element_link_pads (element, "sink", element2, "src");
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element, "sink")));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
g_assert (!GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
gst_object_unref (GST_OBJECT (element2));
@ -92,7 +92,7 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesink", NULL);;
pad = gst_element_get_pad (element, "sink");
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
g_assert (gst_element_get_pad (element, "sink") == NULL);
gst_object_unref (GST_OBJECT (element));
@ -102,7 +102,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters/2; i++) {
element = gst_element_factory_make ("fakesink", NULL);;
pad = gst_element_get_pad (element, "sink");
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
g_print ("pad destroy/removal loop %d %ld\n", iters/2, vmsize()-usage1);
@ -110,7 +110,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters/2; i++) {
element = gst_element_factory_make ("fakesink", NULL);;
pad = gst_element_get_pad (element, "sink");
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
g_assert (gst_element_get_pad (element, "sink") == NULL);
gst_object_unref (GST_OBJECT (element));
}

View file

@ -49,14 +49,14 @@ main (int argc, gchar *argv[])
object = gst_object_new ();
g_assert (!GST_OBJECT_DESTROYED (object));
gst_object_destroy (object);
gst_object_unref (object);
g_assert (GST_OBJECT_DESTROYED (object));
gst_object_unref (object);
g_print ("create/destroy/unref new object %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
object = gst_object_new ();
gst_object_destroy (object);
gst_object_unref (object);
gst_object_unref (object);
}
g_print ("destroy/unref %d object %ld\n", iters, vmsize()-usage1);
@ -77,7 +77,7 @@ main (int argc, gchar *argv[])
object = gst_object_new ();
gst_object_ref (object);
gst_object_destroy (object);
gst_object_unref (object);
gst_object_unref (object);
gst_object_unref (object);
g_print ("create/ref/destroy/unref/unref new object %ld\n", vmsize()-usage1);
@ -85,7 +85,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
object = gst_object_new ();
gst_object_ref (object);
gst_object_destroy (object);
gst_object_unref (object);
gst_object_unref (object);
gst_object_unref (object);
}
@ -95,7 +95,7 @@ main (int argc, gchar *argv[])
object = gst_object_new ();
gst_object_ref (object);
gst_object_set_name (object, "testing123");
gst_object_destroy (object);
gst_object_unref (object);
gst_object_set_name (object, "testing123");
gst_object_unref (object);
gst_object_unref (object);
@ -133,7 +133,7 @@ main (int argc, gchar *argv[])
g_assert (!GST_OBJECT_FLOATING (object));
g_assert (gst_object_get_parent (object) == object2);
gst_object_destroy (object);
gst_object_unref (object);
g_assert (GST_OBJECT_DESTROYED (object));
g_assert (!GST_OBJECT_FLOATING (object));
g_assert (gst_object_get_parent (object) == NULL);

View file

@ -50,14 +50,14 @@ main (int argc, gchar *argv[])
pad = gst_pad_new ("padname", GST_PAD_SINK);
g_assert (!GST_OBJECT_DESTROYED (pad));
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
g_assert (GST_OBJECT_DESTROYED (pad));
gst_object_unref (GST_OBJECT (pad));
g_print ("create/destroy/unref pad %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize()-usage1);
@ -78,7 +78,7 @@ main (int argc, gchar *argv[])
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize()-usage1);
@ -86,7 +86,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
@ -96,7 +96,7 @@ main (int argc, gchar *argv[])
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_pad_set_name (pad, "testing123");
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_pad_set_name (pad, "testing123");
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));

View file

@ -76,7 +76,7 @@ add_remove_test2 (void)
g_assert (!GST_OBJECT_FLOATING (element));
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
@ -96,7 +96,7 @@ add_remove_test3 (void)
gst_bin_add (GST_BIN (thread), element);
g_assert (!GST_OBJECT_FLOATING (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (thread), "test1") == NULL);
gst_object_unref (GST_OBJECT (thread));
@ -120,9 +120,9 @@ add_remove_test4 (void)
gst_bin_add (GST_BIN (thread), thread2);
g_assert (!GST_OBJECT_FLOATING (thread2));
gst_object_destroy (GST_OBJECT (thread2));
gst_object_unref (GST_OBJECT (thread2));
g_assert (gst_bin_get_by_name (GST_BIN (thread), "testthread") == NULL);
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (thread), "test1") == NULL);
gst_object_unref (GST_OBJECT (thread));
@ -174,14 +174,14 @@ main (int argc, gchar *argv[])
thread = gst_thread_new ("somethread");
g_assert (!GST_OBJECT_DESTROYED (thread));
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
g_assert (GST_OBJECT_DESTROYED (thread));
gst_object_unref (GST_OBJECT (thread));
g_print ("create/destroy/unref new thread %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
thread = gst_thread_new ("somethread");
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
}
g_print ("create/destroy/unref %d thread %ld\n", iters, vmsize()-usage1);
@ -202,7 +202,7 @@ main (int argc, gchar *argv[])
thread = gst_thread_new ("somethread");
gst_object_ref (GST_OBJECT (thread));
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
g_print ("craete/ref/destroy/unref/unref new thread %ld\n", vmsize()-usage1);
@ -210,7 +210,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
thread = gst_thread_new ("somethread");
gst_object_ref (GST_OBJECT (thread));
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
}
@ -220,7 +220,7 @@ main (int argc, gchar *argv[])
thread = gst_thread_new ("somethread");
gst_object_ref (GST_OBJECT (thread));
gst_element_set_name (thread, "testing123");
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_element_set_name (thread, "testing123");
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));

View file

@ -38,7 +38,10 @@ state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data)
gst_element_state_get_name (state));
if (state == GST_STATE_PLAYING) running = TRUE;
/* if we move from PLAYING to PAUSED, we're done */
if (state == GST_STATE_PAUSED && running) gst_main_quit ();
if (state == GST_STATE_PAUSED && running) {
running = FALSE;
gst_main_quit ();
}
}
int
@ -76,4 +79,3 @@ main (gint argc, gchar *argv[])
return 0;
}

View file

@ -147,7 +147,6 @@ main (int argc, char *argv[])
g_print ("Removing first sink\n");
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gst_pad_unlink (tee_src1, gst_element_get_pad (sink1, "sink"));
gst_pad_destroy (tee_src1);
gst_bin_remove (GST_BIN (pipeline), sink1);
/* only second fakesink linked, iterate */
@ -166,4 +165,3 @@ main (int argc, char *argv[])
g_print ("Done !\n");
return 0;
}

View file

@ -72,7 +72,7 @@ add_remove_test2 (void)
g_assert (!GST_OBJECT_FLOATING (element));
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
@ -92,7 +92,7 @@ add_remove_test3 (void)
gst_bin_add (GST_BIN (bin), element);
g_assert (!GST_OBJECT_FLOATING (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (bin), "test1") == NULL);
gst_object_unref (GST_OBJECT (bin));
@ -116,9 +116,9 @@ add_remove_test4 (void)
gst_bin_add (GST_BIN (bin), bin2);
g_assert (!GST_OBJECT_FLOATING (bin2));
gst_object_destroy (GST_OBJECT (bin2));
gst_object_unref (GST_OBJECT (bin2));
g_assert (gst_bin_get_by_name (GST_BIN (bin), "testbin") == NULL);
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (bin), "test1") == NULL);
gst_object_unref (GST_OBJECT (bin));
@ -170,14 +170,14 @@ main (int argc, gchar *argv[])
bin = gst_bin_new ("somebin");
g_assert (!GST_OBJECT_DESTROYED (bin));
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
g_assert (GST_OBJECT_DESTROYED (bin));
gst_object_unref (GST_OBJECT (bin));
g_print ("create/destroy/unref new bin %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
g_print ("create/destroy/unref %d bin %ld\n", iters, vmsize()-usage1);
@ -198,7 +198,7 @@ main (int argc, gchar *argv[])
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
g_print ("craete/ref/destroy/unref/unref new bin %ld\n", vmsize()-usage1);
@ -206,7 +206,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
}
@ -216,7 +216,7 @@ main (int argc, gchar *argv[])
bin = gst_bin_new ("somebin");
gst_object_ref (GST_OBJECT (bin));
gst_element_set_name (bin, "testing123");
gst_object_destroy (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));
gst_element_set_name (bin, "testing123");
gst_object_unref (GST_OBJECT (bin));
gst_object_unref (GST_OBJECT (bin));

View file

@ -50,14 +50,14 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesrc", NULL);
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
g_print ("create/destroy/unref new element %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
g_print ("create/destroy/unref %d element %ld\n", iters, vmsize()-usage1);
@ -78,7 +78,7 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_print ("craete/ref/destroy/unref/unref new element %ld\n", vmsize()-usage1);
@ -86,7 +86,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
@ -96,7 +96,7 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesrc", NULL);
gst_object_ref (GST_OBJECT (element));
gst_element_set_name (element, "testing123");
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_element_set_name (element, "testing123");
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));

View file

@ -57,7 +57,7 @@ main (int argc, gchar *argv[])
gst_element_link_pads (element, "sink", element2, "src");
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
g_assert (GST_PAD_IS_LINKED (gst_element_get_pad (element, "sink")));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
g_assert (!GST_PAD_IS_LINKED (gst_element_get_pad (element2, "src")));
gst_object_unref (GST_OBJECT (element2));
@ -92,7 +92,7 @@ main (int argc, gchar *argv[])
element = gst_element_factory_make ("fakesink", NULL);;
pad = gst_element_get_pad (element, "sink");
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
g_assert (gst_element_get_pad (element, "sink") == NULL);
gst_object_unref (GST_OBJECT (element));
@ -102,7 +102,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters/2; i++) {
element = gst_element_factory_make ("fakesink", NULL);;
pad = gst_element_get_pad (element, "sink");
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
}
g_print ("pad destroy/removal loop %d %ld\n", iters/2, vmsize()-usage1);
@ -110,7 +110,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters/2; i++) {
element = gst_element_factory_make ("fakesink", NULL);;
pad = gst_element_get_pad (element, "sink");
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
g_assert (gst_element_get_pad (element, "sink") == NULL);
gst_object_unref (GST_OBJECT (element));
}

View file

@ -49,14 +49,14 @@ main (int argc, gchar *argv[])
object = gst_object_new ();
g_assert (!GST_OBJECT_DESTROYED (object));
gst_object_destroy (object);
gst_object_unref (object);
g_assert (GST_OBJECT_DESTROYED (object));
gst_object_unref (object);
g_print ("create/destroy/unref new object %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
object = gst_object_new ();
gst_object_destroy (object);
gst_object_unref (object);
gst_object_unref (object);
}
g_print ("destroy/unref %d object %ld\n", iters, vmsize()-usage1);
@ -77,7 +77,7 @@ main (int argc, gchar *argv[])
object = gst_object_new ();
gst_object_ref (object);
gst_object_destroy (object);
gst_object_unref (object);
gst_object_unref (object);
gst_object_unref (object);
g_print ("create/ref/destroy/unref/unref new object %ld\n", vmsize()-usage1);
@ -85,7 +85,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
object = gst_object_new ();
gst_object_ref (object);
gst_object_destroy (object);
gst_object_unref (object);
gst_object_unref (object);
gst_object_unref (object);
}
@ -95,7 +95,7 @@ main (int argc, gchar *argv[])
object = gst_object_new ();
gst_object_ref (object);
gst_object_set_name (object, "testing123");
gst_object_destroy (object);
gst_object_unref (object);
gst_object_set_name (object, "testing123");
gst_object_unref (object);
gst_object_unref (object);
@ -133,7 +133,7 @@ main (int argc, gchar *argv[])
g_assert (!GST_OBJECT_FLOATING (object));
g_assert (gst_object_get_parent (object) == object2);
gst_object_destroy (object);
gst_object_unref (object);
g_assert (GST_OBJECT_DESTROYED (object));
g_assert (!GST_OBJECT_FLOATING (object));
g_assert (gst_object_get_parent (object) == NULL);

View file

@ -50,14 +50,14 @@ main (int argc, gchar *argv[])
pad = gst_pad_new ("padname", GST_PAD_SINK);
g_assert (!GST_OBJECT_DESTROYED (pad));
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
g_assert (GST_OBJECT_DESTROYED (pad));
gst_object_unref (GST_OBJECT (pad));
g_print ("create/destroy/unref pad %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize()-usage1);
@ -78,7 +78,7 @@ main (int argc, gchar *argv[])
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize()-usage1);
@ -86,7 +86,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
}
@ -96,7 +96,7 @@ main (int argc, gchar *argv[])
pad = gst_pad_new ("padname", GST_PAD_SINK);
gst_object_ref (GST_OBJECT (pad));
gst_pad_set_name (pad, "testing123");
gst_object_destroy (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));
gst_pad_set_name (pad, "testing123");
gst_object_unref (GST_OBJECT (pad));
gst_object_unref (GST_OBJECT (pad));

View file

@ -76,7 +76,7 @@ add_remove_test2 (void)
g_assert (!GST_OBJECT_FLOATING (element));
g_assert (!GST_OBJECT_DESTROYED (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (GST_OBJECT_DESTROYED (element));
gst_object_unref (GST_OBJECT (element));
@ -96,7 +96,7 @@ add_remove_test3 (void)
gst_bin_add (GST_BIN (thread), element);
g_assert (!GST_OBJECT_FLOATING (element));
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (thread), "test1") == NULL);
gst_object_unref (GST_OBJECT (thread));
@ -120,9 +120,9 @@ add_remove_test4 (void)
gst_bin_add (GST_BIN (thread), thread2);
g_assert (!GST_OBJECT_FLOATING (thread2));
gst_object_destroy (GST_OBJECT (thread2));
gst_object_unref (GST_OBJECT (thread2));
g_assert (gst_bin_get_by_name (GST_BIN (thread), "testthread") == NULL);
gst_object_destroy (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (element));
g_assert (gst_bin_get_by_name (GST_BIN (thread), "test1") == NULL);
gst_object_unref (GST_OBJECT (thread));
@ -174,14 +174,14 @@ main (int argc, gchar *argv[])
thread = gst_thread_new ("somethread");
g_assert (!GST_OBJECT_DESTROYED (thread));
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
g_assert (GST_OBJECT_DESTROYED (thread));
gst_object_unref (GST_OBJECT (thread));
g_print ("create/destroy/unref new thread %ld\n", vmsize()-usage1);
for (i=0; i<iters;i++) {
thread = gst_thread_new ("somethread");
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
}
g_print ("create/destroy/unref %d thread %ld\n", iters, vmsize()-usage1);
@ -202,7 +202,7 @@ main (int argc, gchar *argv[])
thread = gst_thread_new ("somethread");
gst_object_ref (GST_OBJECT (thread));
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
g_print ("craete/ref/destroy/unref/unref new thread %ld\n", vmsize()-usage1);
@ -210,7 +210,7 @@ main (int argc, gchar *argv[])
for (i=0; i<iters;i++) {
thread = gst_thread_new ("somethread");
gst_object_ref (GST_OBJECT (thread));
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
}
@ -220,7 +220,7 @@ main (int argc, gchar *argv[])
thread = gst_thread_new ("somethread");
gst_object_ref (GST_OBJECT (thread));
gst_element_set_name (thread, "testing123");
gst_object_destroy (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));
gst_element_set_name (thread, "testing123");
gst_object_unref (GST_OBJECT (thread));
gst_object_unref (GST_OBJECT (thread));

View file

@ -38,7 +38,10 @@ state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data)
gst_element_state_get_name (state));
if (state == GST_STATE_PLAYING) running = TRUE;
/* if we move from PLAYING to PAUSED, we're done */
if (state == GST_STATE_PAUSED && running) gst_main_quit ();
if (state == GST_STATE_PAUSED && running) {
running = FALSE;
gst_main_quit ();
}
}
int
@ -76,4 +79,3 @@ main (gint argc, gchar *argv[])
return 0;
}