From 631c8f5ca585952854ac8b033599379077038354 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 25 May 2002 17:45:51 +0000 Subject: [PATCH] re-enable thread test, although it does not work but passes right now warn for bizarre behavior in plugin loading Original commit message from CVS: re-enable thread test, although it does not work but passes right now warn for bizarre behavior in plugin loading --- configure.ac | 1 + gst/registries/gstxmlregistry.c | 18 ++++++++++-------- tests/old/testsuite/Makefile.am | 5 ++--- tests/old/testsuite/threads/thread.c | 28 +++++++++++----------------- testsuite/Makefile.am | 5 ++--- testsuite/threads/thread.c | 28 +++++++++++----------------- 6 files changed, 37 insertions(+), 48 deletions(-) diff --git a/configure.ac b/configure.ac index 2509113fdb..8615616a17 100644 --- a/configure.ac +++ b/configure.ac @@ -437,6 +437,7 @@ testsuite/dynparams/Makefile testsuite/elements/Makefile testsuite/plugin/Makefile testsuite/refcounting/Makefile +testsuite/threads/Makefile examples/Makefile examples/autoplug/Makefile examples/helloworld/Makefile diff --git a/gst/registries/gstxmlregistry.c b/gst/registries/gstxmlregistry.c index bcf21601df..64aef49849 100644 --- a/gst/registries/gstxmlregistry.c +++ b/gst/registries/gstxmlregistry.c @@ -1482,15 +1482,17 @@ gst_xml_registry_rebuild (GstRegistry *registry) walk = plugins; while (walk) { - /* should return FALSE */ - gst_plugin_load_plugin (GST_PLUGIN (walk->data), &error); - GST_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s\n", - ((GstPlugin*)walk->data)->filename, error->message); + if (gst_plugin_load_plugin (GST_PLUGIN (walk->data), &error)) { + g_warning ("Bizarre behavior: plugin %s actually loaded", ((GstPlugin*)walk->data)->filename); + } else { + GST_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s", + ((GstPlugin*)walk->data)->filename, error->message); - g_free (((GstPlugin*)walk->data)->filename); - g_free (walk->data); - g_error_free (error); - error = NULL; + g_free (((GstPlugin*)walk->data)->filename); + g_free (walk->data); + g_error_free (error); + error = NULL; + } walk = g_list_next (walk); } diff --git a/tests/old/testsuite/Makefile.am b/tests/old/testsuite/Makefile.am index 1740ddd60a..906cfc2292 100644 --- a/tests/old/testsuite/Makefile.am +++ b/tests/old/testsuite/Makefile.am @@ -1,4 +1,4 @@ -# FIXME : refcounting threads bytestream +# FIXME : threads bytestream SUBDIRS = caps cleanup plugin elements clock refcounting ## dynparams GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) @@ -14,8 +14,7 @@ check_PROGRAMS = $(testprogs) LIBS = $(GST_LIBS) CFLAGS = $(GST_CFLAGS) -# FIXME : refcounting threadds DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements \ - plugin refcounting + plugin refcounting threads EXTRA_DIST = gst-inspect-check diff --git a/tests/old/testsuite/threads/thread.c b/tests/old/testsuite/threads/thread.c index 530dca2b56..efa0281e6e 100644 --- a/tests/old/testsuite/threads/thread.c +++ b/tests/old/testsuite/threads/thread.c @@ -15,21 +15,18 @@ usage (void) static void construct_pipeline (GstElement *pipeline) { - GstElement *src, *sink, *queue, *thread; + GstElement *src, *sink, *queue, *identity, *thread; - src = gst_element_factory_make ("fakesrc", "src"); - sink = gst_element_factory_make ("fakesink", "sink"); - queue = gst_element_factory_make ("queue", "queue"); - thread = gst_element_factory_make ("thread", "thread"); + src = gst_element_factory_make ("fakesrc", NULL); + sink = gst_element_factory_make ("fakesink", NULL); + identity = gst_element_factory_make ("identity", NULL); + queue = gst_element_factory_make ("queue", NULL); + thread = gst_element_factory_make ("thread", NULL); - gst_element_connect (src, "src", queue, "sink"); - gst_element_connect (queue, "src", sink, "sink"); + gst_element_connect_many (src, queue, identity, sink, NULL); - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), queue); - gst_bin_add (GST_BIN (pipeline), thread); - - gst_bin_add (GST_BIN (thread), sink); + gst_bin_add_many (GST_BIN (pipeline), src, queue, thread, NULL); + gst_bin_add_many (GST_BIN (thread), identity, sink, NULL); g_object_set (G_OBJECT (src), "num_buffers", 5, NULL); } @@ -75,10 +72,7 @@ main (gint argc, gchar *argv[]) gst_element_set_state (pipeline, GST_STATE_PAUSED); g_print ("PLAYING\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("PAUSED\n"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - g_print ("PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + /* element likely hits EOS and does a state transition to PAUSED */ g_print ("READY\n"); gst_element_set_state (pipeline, GST_STATE_READY); g_print ("NULL\n"); @@ -112,7 +106,7 @@ main (gint argc, gchar *argv[]) sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); - g_signal_connect (G_OBJECT (sink), "handoff", change_state, pipeline); + g_signal_connect (G_OBJECT (sink), "handoff", G_CALLBACK (change_state), pipeline); gst_element_set_state (pipeline, GST_STATE_PLAYING); g_print ("running3 ...\n"); while (gst_bin_iterate (GST_BIN (pipeline))); diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 1740ddd60a..906cfc2292 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -1,4 +1,4 @@ -# FIXME : refcounting threads bytestream +# FIXME : threads bytestream SUBDIRS = caps cleanup plugin elements clock refcounting ## dynparams GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) @@ -14,8 +14,7 @@ check_PROGRAMS = $(testprogs) LIBS = $(GST_LIBS) CFLAGS = $(GST_CFLAGS) -# FIXME : refcounting threadds DIST_SUBDIRS = bytestream caps cleanup clock dynparams elements \ - plugin refcounting + plugin refcounting threads EXTRA_DIST = gst-inspect-check diff --git a/testsuite/threads/thread.c b/testsuite/threads/thread.c index 530dca2b56..efa0281e6e 100644 --- a/testsuite/threads/thread.c +++ b/testsuite/threads/thread.c @@ -15,21 +15,18 @@ usage (void) static void construct_pipeline (GstElement *pipeline) { - GstElement *src, *sink, *queue, *thread; + GstElement *src, *sink, *queue, *identity, *thread; - src = gst_element_factory_make ("fakesrc", "src"); - sink = gst_element_factory_make ("fakesink", "sink"); - queue = gst_element_factory_make ("queue", "queue"); - thread = gst_element_factory_make ("thread", "thread"); + src = gst_element_factory_make ("fakesrc", NULL); + sink = gst_element_factory_make ("fakesink", NULL); + identity = gst_element_factory_make ("identity", NULL); + queue = gst_element_factory_make ("queue", NULL); + thread = gst_element_factory_make ("thread", NULL); - gst_element_connect (src, "src", queue, "sink"); - gst_element_connect (queue, "src", sink, "sink"); + gst_element_connect_many (src, queue, identity, sink, NULL); - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), queue); - gst_bin_add (GST_BIN (pipeline), thread); - - gst_bin_add (GST_BIN (thread), sink); + gst_bin_add_many (GST_BIN (pipeline), src, queue, thread, NULL); + gst_bin_add_many (GST_BIN (thread), identity, sink, NULL); g_object_set (G_OBJECT (src), "num_buffers", 5, NULL); } @@ -75,10 +72,7 @@ main (gint argc, gchar *argv[]) gst_element_set_state (pipeline, GST_STATE_PAUSED); g_print ("PLAYING\n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("PAUSED\n"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - g_print ("PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + /* element likely hits EOS and does a state transition to PAUSED */ g_print ("READY\n"); gst_element_set_state (pipeline, GST_STATE_READY); g_print ("NULL\n"); @@ -112,7 +106,7 @@ main (gint argc, gchar *argv[]) sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); - g_signal_connect (G_OBJECT (sink), "handoff", change_state, pipeline); + g_signal_connect (G_OBJECT (sink), "handoff", G_CALLBACK (change_state), pipeline); gst_element_set_state (pipeline, GST_STATE_PLAYING); g_print ("running3 ...\n"); while (gst_bin_iterate (GST_BIN (pipeline)));