mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
Small fixes for testsuite/plugin
Original commit message from CVS: Small fixes for testsuite/plugin
This commit is contained in:
parent
e0a3d5eaf8
commit
2314c02f42
4 changed files with 52 additions and 35 deletions
|
@ -102,6 +102,16 @@ gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin, GModule *modul
|
||||||
plugin->filename);
|
plugin->filename);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", plugin->filename);
|
||||||
|
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
GstPlugin*
|
||||||
|
gst_plugin_new (const gchar *filename)
|
||||||
|
{
|
||||||
|
GstPlugin *plugin = g_new0 (GstPlugin, 1);
|
||||||
|
plugin->filename = g_strdup (filename);
|
||||||
|
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,8 @@ _gst_plugin_static_init__ ##init (void) \
|
||||||
void _gst_plugin_initialize (void);
|
void _gst_plugin_initialize (void);
|
||||||
void _gst_plugin_register_static (GstPluginDesc *desc);
|
void _gst_plugin_register_static (GstPluginDesc *desc);
|
||||||
|
|
||||||
|
GstPlugin* gst_plugin_new (const gchar *filename);
|
||||||
|
|
||||||
const gchar* gst_plugin_get_name (GstPlugin *plugin);
|
const gchar* gst_plugin_get_name (GstPlugin *plugin);
|
||||||
void gst_plugin_set_name (GstPlugin *plugin, const gchar *name);
|
void gst_plugin_set_name (GstPlugin *plugin, const gchar *name);
|
||||||
const gchar* gst_plugin_get_longname (GstPlugin *plugin);
|
const gchar* gst_plugin_get_longname (GstPlugin *plugin);
|
||||||
|
|
|
@ -285,6 +285,37 @@ gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin)
|
||||||
registry->plugins = g_list_remove (registry->plugins, plugin);
|
registry->plugins = g_list_remove (registry->plugins, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstPluginFeature*
|
||||||
|
gst_plugin_list_find_feature (GList *plugins, const gchar *name, GType type)
|
||||||
|
{
|
||||||
|
GstPluginFeature *feature = NULL;
|
||||||
|
|
||||||
|
while (plugins) {
|
||||||
|
GstPlugin *plugin = (GstPlugin *) (plugins->data);
|
||||||
|
|
||||||
|
feature = gst_plugin_find_feature (plugin, name, type);
|
||||||
|
if (feature)
|
||||||
|
return feature;
|
||||||
|
|
||||||
|
plugins = g_list_next (plugins);
|
||||||
|
}
|
||||||
|
return feature;
|
||||||
|
}
|
||||||
|
|
||||||
|
static GstPlugin*
|
||||||
|
gst_plugin_list_find_plugin (GList *plugins, const gchar *name)
|
||||||
|
{
|
||||||
|
while (plugins) {
|
||||||
|
GstPlugin *plugin = (GstPlugin *) (plugins->data);
|
||||||
|
|
||||||
|
if (plugin->name && !strcmp (plugin->name, name))
|
||||||
|
return plugin;
|
||||||
|
|
||||||
|
plugins = g_list_next (plugins);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_registry_find_plugin:
|
* gst_registry_find_plugin:
|
||||||
* @registry: the registry to search
|
* @registry: the registry to search
|
||||||
|
@ -297,41 +328,10 @@ gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin)
|
||||||
GstPlugin*
|
GstPlugin*
|
||||||
gst_registry_find_plugin (GstRegistry *registry, const gchar *name)
|
gst_registry_find_plugin (GstRegistry *registry, const gchar *name)
|
||||||
{
|
{
|
||||||
GList *walk;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
|
||||||
walk = registry->plugins;
|
return gst_plugin_list_find_plugin (registry->plugins, name);
|
||||||
|
|
||||||
while (walk) {
|
|
||||||
GstPlugin *plugin = (GstPlugin *) (walk->data);
|
|
||||||
|
|
||||||
if (plugin->name && !strcmp (plugin->name, name))
|
|
||||||
return plugin;
|
|
||||||
|
|
||||||
walk = g_list_next (walk);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstPluginFeature*
|
|
||||||
gst_plugin_list_find_feature (GList *plugins, const gchar *name, GType type)
|
|
||||||
{
|
|
||||||
GstPluginFeature *feature = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
|
||||||
|
|
||||||
while (plugins) {
|
|
||||||
GstPlugin *plugin = (GstPlugin *) (plugins->data);
|
|
||||||
|
|
||||||
feature = gst_plugin_find_feature (plugin, name, type);
|
|
||||||
if (feature)
|
|
||||||
return feature;
|
|
||||||
|
|
||||||
plugins = g_list_next (plugins);
|
|
||||||
}
|
|
||||||
return feature;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -572,7 +572,13 @@ GstPlugin*
|
||||||
gst_registry_pool_find_plugin (const gchar *name)
|
gst_registry_pool_find_plugin (const gchar *name)
|
||||||
{
|
{
|
||||||
GstPlugin *result = NULL;
|
GstPlugin *result = NULL;
|
||||||
GList *walk = _gst_registry_pool;
|
GList *walk;
|
||||||
|
|
||||||
|
result = gst_plugin_list_find_plugin (_gst_registry_pool_plugins, name);
|
||||||
|
if (result)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
walk = _gst_registry_pool;
|
||||||
|
|
||||||
while (walk) {
|
while (walk) {
|
||||||
GstRegistry *registry = GST_REGISTRY (walk->data);
|
GstRegistry *registry = GST_REGISTRY (walk->data);
|
||||||
|
|
|
@ -1271,8 +1271,7 @@ gst_xml_registry_rebuild_recurse (GstXMLRegistry *registry, const gchar *directo
|
||||||
|
|
||||||
if ((temp = strstr (directory, ".so")) &&
|
if ((temp = strstr (directory, ".so")) &&
|
||||||
(!strcmp (temp, ".so"))) {
|
(!strcmp (temp, ".so"))) {
|
||||||
GstPlugin *plugin = g_new0 (GstPlugin, 1);
|
GstPlugin *plugin = gst_plugin_new (directory);
|
||||||
plugin->filename = g_strdup (directory);
|
|
||||||
|
|
||||||
loaded = gst_plugin_load_plugin (plugin);
|
loaded = gst_plugin_load_plugin (plugin);
|
||||||
if (!loaded) {
|
if (!loaded) {
|
||||||
|
|
Loading…
Reference in a new issue