if (plugin && plugin->desc.name) {
GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = plugin->desc.name;
+ GST_PLUGIN_FEATURE_CAST (factory)->plugin = plugin;
+ g_object_add_weak_pointer ((GObject *) plugin,
+ (gpointer *) & GST_PLUGIN_FEATURE_CAST (factory)->plugin);
} else {
GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = "NULL";
+ GST_PLUGIN_FEATURE_CAST (factory)->plugin = NULL;
}
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE_CAST (factory), rank);
GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE;
*/
static gboolean
gst_registry_chunks_load_feature (GstRegistry * registry, gchar ** in,
- gchar * end, const gchar * plugin_name)
+ gchar * end, GstPlugin * plugin)
{
GstRegistryChunkPluginFeature *pf = NULL;
GstPluginFeature *feature = NULL;
const gchar *const_str, *type_name;
+ const gchar *plugin_name;
gchar *str, *feature_name;
GType type;
guint i;
+ plugin_name = plugin->desc.name;
+
/* unpack plugin feature strings */
unpack_string_nocopy (*in, type_name, end, fail);
feature->rank = pf->rank;
feature->plugin_name = plugin_name;
+ feature->plugin = plugin;
+ g_object_add_weak_pointer ((GObject *) plugin,
+ (gpointer *) & feature->plugin);
gst_registry_add_feature (registry, feature);
- GST_DEBUG ("Added feature %s", feature->name);
+ GST_DEBUG ("Added feature %s, plugin %p %s", feature->name, plugin,
+ plugin_name);
return TRUE;
/* Load plugin features */
for (i = 0; i < n; i++) {
if (G_UNLIKELY (!gst_registry_chunks_load_feature (registry, in, end,
- plugin->desc.name))) {
+ plugin))) {
GST_ERROR ("Error while loading binary feature for plugin '%s'",
GST_STR_NULL (plugin->desc.name));
gst_registry_remove_plugin (registry, plugin);
factory->user_data_notify = data_notify;
if (plugin && plugin->desc.name) {
GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = plugin->desc.name; /* interned string */
+ GST_PLUGIN_FEATURE_CAST (factory)->plugin = plugin;
+ g_object_add_weak_pointer ((GObject *) plugin,
+ (gpointer *) & GST_PLUGIN_FEATURE_CAST (factory)->plugin);
} else {
GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = "NULL";
+ GST_PLUGIN_FEATURE_CAST (factory)->plugin = NULL;
}
GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE;