diff options
author | David Schleef <ds@schleef.org> | 2005-09-18 06:59:25 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2005-09-18 06:59:25 +0000 |
commit | cb798ac570e4a4f86001d5d26af550eb09f4c329 (patch) | |
tree | a8391cb1600dcf4deeb6ce811ff16cd1757612ea /gst/gstpluginfeature.c | |
parent | 687441277937689ccb2bbcd7520428b62754a5ea (diff) |
check/Makefile.am: Fix environment variables.
Original commit message from CVS:
* check/Makefile.am: Fix environment variables.
* check/gst/gstplugin.c: Fix for API changes.
* tools/gst-inspect.c: Fix for API changes.
* tools/gst-xmlinspect.c: Fix for API changes.
* gst/gstelementfactory.c:
* gst/gstplugin.c:
* gst/gstplugin.h:
* gst/gstpluginfeature.c:
* gst/gstpluginfeature.h:
* gst/gstregistry.c:
* gst/gstregistry.h:
* gst/gstregistryxml.c:
* gst/gsttypefind.c:
* gst/gsttypefindfactory.c:
* gst/indexers/gstfileindex.c:
* gst/indexers/gstmemindex.c:
* gst/schedulers/Makefile.am:
Change registry to keep track of both plugins and features,
removing the feature tracking from plugins themselves.
Diffstat (limited to 'gst/gstpluginfeature.c')
-rw-r--r-- | gst/gstpluginfeature.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gst/gstpluginfeature.c b/gst/gstpluginfeature.c index a51f567578..795a5adcdb 100644 --- a/gst/gstpluginfeature.c +++ b/gst/gstpluginfeature.c @@ -31,15 +31,18 @@ static void gst_plugin_feature_class_init (GstPluginFeatureClass * klass); static void gst_plugin_feature_init (GstPluginFeature * feature); +static void gst_plugin_feature_finalize (GstPluginFeature * feature); /* static guint gst_plugin_feature_signals[LAST_SIGNAL] = { 0 }; */ -G_DEFINE_ABSTRACT_TYPE (GstPluginFeature, gst_plugin_feature, G_TYPE_OBJECT); +G_DEFINE_ABSTRACT_TYPE (GstPluginFeature, gst_plugin_feature, GST_TYPE_OBJECT); static void gst_plugin_feature_class_init (GstPluginFeatureClass * klass) { + G_OBJECT_CLASS (klass)->finalize = + (GObjectFinalizeFunc) gst_plugin_feature_finalize; } static void @@ -48,6 +51,12 @@ gst_plugin_feature_init (GstPluginFeature * feature) } +static void +gst_plugin_feature_finalize (GstPluginFeature * feature) +{ + GST_DEBUG ("finalizing feature %p", feature); +} + /** * gst_plugin_feature_load: * @feature: the plugin feature to check @@ -66,24 +75,27 @@ gst_plugin_feature_load (GstPluginFeature * feature) g_return_val_if_fail (feature != NULL, FALSE); g_return_val_if_fail (GST_IS_PLUGIN_FEATURE (feature), FALSE); - plugin = gst_plugin_load (feature->plugin); + if (feature->loaded) + return feature; + + plugin = gst_plugin_load_by_name (feature->plugin_name); if (!plugin) { g_critical ("Failed to load plugin containing feature '%s'.", GST_PLUGIN_FEATURE_NAME (feature)); return NULL; } - if (plugin == feature->plugin) { - return feature; - } + gst_object_unref (plugin); - real_feature = gst_plugin_find_feature_by_name (plugin, feature->name); + real_feature = + gst_registry_lookup_feature (gst_registry_get_default (), feature->name); if (real_feature == NULL) { g_critical ("Loaded plugin containing feature '%s', but feature disappeared.", feature->name); } - //gst_object_unref (feature->plugin); + gst_object_unref (feature); + return real_feature; } @@ -117,6 +129,7 @@ gst_plugin_feature_set_name (GstPluginFeature * feature, const gchar * name) } else { feature->name = g_strdup (name); } + gst_object_set_name (GST_OBJECT (feature), feature->name); } /** @@ -171,14 +184,12 @@ gst_plugin_feature_get_rank (GstPluginFeature * feature) void gst_plugin_feature_list_free (GList * list) { -#if 0 GList *g; for (g = list; g; g = g->next) { GstPluginFeature *feature = GST_PLUGIN_FEATURE (g->data); - //gst_object_unref (feature->plugin); + gst_object_unref (feature); } -#endif g_list_free (list); } |