mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
Update for new plugin API. static and static2 now fail
Original commit message from CVS: Update for new plugin API. static and static2 now fail
This commit is contained in:
parent
4ccd25273f
commit
aa63f65fc8
14 changed files with 66 additions and 64 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 ());
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 ());
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue