Update for new plugin API. static and static2 now fail
authorDavid Schleef <ds@schleef.org>
Tue, 4 Nov 2003 05:48:16 +0000 (05:48 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 4 Nov 2003 05:48:16 +0000 (05:48 +0000)
Original commit message from CVS:
Update for new plugin API.  static and static2 now fail

14 files changed:
tests/old/testsuite/plugin/Makefile.am
tests/old/testsuite/plugin/dynamic.c
tests/old/testsuite/plugin/linked.c
tests/old/testsuite/plugin/loading.c
tests/old/testsuite/plugin/registry.c
tests/old/testsuite/plugin/static.c
tests/old/testsuite/plugin/static2.c
testsuite/plugin/Makefile.am
testsuite/plugin/dynamic.c
testsuite/plugin/linked.c
testsuite/plugin/loading.c
testsuite/plugin/registry.c
testsuite/plugin/static.c
testsuite/plugin/static2.c

index a8d1887..32d816a 100644 (file)
@@ -2,8 +2,8 @@ include ../Rules
 
 plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la
 
-tests_pass = static dynamic static2 linked loading registry
-tests_fail = 
+tests_pass = dynamic linked loading registry
+tests_fail = static static2
 
 
 libtestplugin_la_SOURCES = testplugin.c
index c94f5d5..07c376d 100644 (file)
@@ -6,22 +6,19 @@ main (int argc, char *argv[])
 {
   GstPlugin *plugin;
   GError *error = NULL;
-  gboolean loaded;
 
   gst_init (&argc, &argv);
 
-  plugin = gst_plugin_new (".libs/libtestplugin.so");
+  plugin = gst_plugin_load_file (".libs/libtestplugin.so", &error);
   g_assert (plugin != NULL);
-
-  loaded = gst_plugin_load_plugin (plugin, &error);
   if (error)
   {
     g_print ("ERROR loading plug-in: %s\n", error->message);
     g_free (error);
+    return 1;
   }
-  g_assert (loaded == TRUE);
 
-  g_print ("testplugin: %d, %s\n", loaded, plugin->name);
+  g_print ("testplugin: %s\n", gst_plugin_get_name(plugin));
 
   return 0;
 }
index 0174311..24e7d9e 100644 (file)
@@ -11,12 +11,12 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   plugin = gst_registry_pool_find_plugin ("testplugin2");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin2: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin2: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   return 0;
 }
index aad2ddb..0ed5a9c 100644 (file)
@@ -7,7 +7,6 @@ main (int argc, char *argv[])
   GstPlugin *plugin;
   gboolean loaded = FALSE;
   gint numplugins;
-  GError *error = NULL;
 
   gst_init (&argc, &argv);
 
@@ -23,12 +22,7 @@ main (int argc, char *argv[])
 
   g_print ("testplugin: %p  loaded: %s\n", plugin, (gst_plugin_is_loaded (plugin) ? "true": "false"));
   
-  loaded = gst_plugin_load_plugin (plugin, &error);
-  if (error)
-  {
-    g_print ("ERROR loading plug-in: %s\n", error->message);
-    g_free (error);
-  }
+  loaded = gst_plugin_load (gst_plugin_get_name(plugin));
   g_assert (loaded == TRUE);
 
   numplugins = g_list_length (gst_registry_pool_plugin_list ());
@@ -42,12 +36,7 @@ main (int argc, char *argv[])
 
   g_print ("%d features in plugin\n", g_list_length (gst_plugin_get_feature_list (plugin)));
 
-  loaded = gst_plugin_load_plugin (plugin, &error);
-  if (error)
-  {
-    g_print ("ERROR loading plug-in: %s\n", error->message);
-    g_free (error);
-  }
+  loaded = gst_plugin_load (gst_plugin_get_name(plugin));
   g_assert (loaded == TRUE);
 
   numplugins = g_list_length (gst_registry_pool_plugin_list ());
index 719a252..95fb56a 100644 (file)
@@ -11,7 +11,7 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %s\n", plugin->name);
+  g_print ("testplugin: %s\n", gst_plugin_get_name(plugin));
 
   return 0;
 }
index 0edb297..9aab9d1 100644 (file)
@@ -11,12 +11,12 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   plugin = gst_registry_pool_find_plugin ("testplugin2");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin2: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin2: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   return 0;
 }
index baea7b8..ec401b1 100644 (file)
@@ -1,10 +1,13 @@
 
 #define GST_PLUGIN_STATIC 
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <gst/gst.h>
 
 static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
 {
   return TRUE;
 }
@@ -13,11 +16,17 @@ GST_PLUGIN_DEFINE (
   GST_VERSION_MAJOR,
   GST_VERSION_MINOR,
   "testplugin",
-  plugin_init
+  "a plugin for testing",
+  plugin_init,
+  VERSION,
+  GST_LICENSE,
+  GST_COPYRIGHT,
+  GST_PACKAGE,
+  GST_ORIGIN
 );
 
 static gboolean
-plugin2_init (GModule *module, GstPlugin *plugin)
+plugin2_init (GstPlugin *plugin)
 {
   return TRUE;
 }
@@ -26,7 +35,13 @@ GST_PLUGIN_DEFINE (
   GST_VERSION_MAJOR,
   GST_VERSION_MINOR,
   "testplugin2",
-  plugin2_init
+  "a second plugin for testing",
+  plugin2_init,
+  VERSION,
+  GST_LICENSE,
+  GST_COPYRIGHT,
+  GST_PACKAGE,
+  GST_ORIGIN
 );
 
 int 
@@ -39,12 +54,12 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   plugin = gst_registry_pool_find_plugin ("testplugin2");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin2: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin2: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   return 0;
 }
index a8d1887..32d816a 100644 (file)
@@ -2,8 +2,8 @@ include ../Rules
 
 plugin_LTLIBRARIES = libtestplugin.la libtestplugin2.la
 
-tests_pass = static dynamic static2 linked loading registry
-tests_fail = 
+tests_pass = dynamic linked loading registry
+tests_fail = static static2
 
 
 libtestplugin_la_SOURCES = testplugin.c
index c94f5d5..07c376d 100644 (file)
@@ -6,22 +6,19 @@ main (int argc, char *argv[])
 {
   GstPlugin *plugin;
   GError *error = NULL;
-  gboolean loaded;
 
   gst_init (&argc, &argv);
 
-  plugin = gst_plugin_new (".libs/libtestplugin.so");
+  plugin = gst_plugin_load_file (".libs/libtestplugin.so", &error);
   g_assert (plugin != NULL);
-
-  loaded = gst_plugin_load_plugin (plugin, &error);
   if (error)
   {
     g_print ("ERROR loading plug-in: %s\n", error->message);
     g_free (error);
+    return 1;
   }
-  g_assert (loaded == TRUE);
 
-  g_print ("testplugin: %d, %s\n", loaded, plugin->name);
+  g_print ("testplugin: %s\n", gst_plugin_get_name(plugin));
 
   return 0;
 }
index 0174311..24e7d9e 100644 (file)
@@ -11,12 +11,12 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   plugin = gst_registry_pool_find_plugin ("testplugin2");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin2: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin2: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   return 0;
 }
index aad2ddb..0ed5a9c 100644 (file)
@@ -7,7 +7,6 @@ main (int argc, char *argv[])
   GstPlugin *plugin;
   gboolean loaded = FALSE;
   gint numplugins;
-  GError *error = NULL;
 
   gst_init (&argc, &argv);
 
@@ -23,12 +22,7 @@ main (int argc, char *argv[])
 
   g_print ("testplugin: %p  loaded: %s\n", plugin, (gst_plugin_is_loaded (plugin) ? "true": "false"));
   
-  loaded = gst_plugin_load_plugin (plugin, &error);
-  if (error)
-  {
-    g_print ("ERROR loading plug-in: %s\n", error->message);
-    g_free (error);
-  }
+  loaded = gst_plugin_load (gst_plugin_get_name(plugin));
   g_assert (loaded == TRUE);
 
   numplugins = g_list_length (gst_registry_pool_plugin_list ());
@@ -42,12 +36,7 @@ main (int argc, char *argv[])
 
   g_print ("%d features in plugin\n", g_list_length (gst_plugin_get_feature_list (plugin)));
 
-  loaded = gst_plugin_load_plugin (plugin, &error);
-  if (error)
-  {
-    g_print ("ERROR loading plug-in: %s\n", error->message);
-    g_free (error);
-  }
+  loaded = gst_plugin_load (gst_plugin_get_name(plugin));
   g_assert (loaded == TRUE);
 
   numplugins = g_list_length (gst_registry_pool_plugin_list ());
index 719a252..95fb56a 100644 (file)
@@ -11,7 +11,7 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %s\n", plugin->name);
+  g_print ("testplugin: %s\n", gst_plugin_get_name(plugin));
 
   return 0;
 }
index 0edb297..9aab9d1 100644 (file)
@@ -11,12 +11,12 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   plugin = gst_registry_pool_find_plugin ("testplugin2");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin2: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin2: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   return 0;
 }
index baea7b8..ec401b1 100644 (file)
@@ -1,10 +1,13 @@
 
 #define GST_PLUGIN_STATIC 
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <gst/gst.h>
 
 static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
 {
   return TRUE;
 }
@@ -13,11 +16,17 @@ GST_PLUGIN_DEFINE (
   GST_VERSION_MAJOR,
   GST_VERSION_MINOR,
   "testplugin",
-  plugin_init
+  "a plugin for testing",
+  plugin_init,
+  VERSION,
+  GST_LICENSE,
+  GST_COPYRIGHT,
+  GST_PACKAGE,
+  GST_ORIGIN
 );
 
 static gboolean
-plugin2_init (GModule *module, GstPlugin *plugin)
+plugin2_init (GstPlugin *plugin)
 {
   return TRUE;
 }
@@ -26,7 +35,13 @@ GST_PLUGIN_DEFINE (
   GST_VERSION_MAJOR,
   GST_VERSION_MINOR,
   "testplugin2",
-  plugin2_init
+  "a second plugin for testing",
+  plugin2_init,
+  VERSION,
+  GST_LICENSE,
+  GST_COPYRIGHT,
+  GST_PACKAGE,
+  GST_ORIGIN
 );
 
 int 
@@ -39,12 +54,12 @@ main (int argc, char *argv[])
   plugin = gst_registry_pool_find_plugin ("testplugin");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   plugin = gst_registry_pool_find_plugin ("testplugin2");
   g_assert (plugin != NULL);
 
-  g_print ("testplugin2: %p %s\n", plugin, plugin->name);
+  g_print ("testplugin2: %p %s\n", plugin, gst_plugin_get_name(plugin));
 
   return 0;
 }