mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 19:21:06 +00:00
gst/gst.c: declare gst initialized before eventually rebuilding the registry.
Original commit message from CVS: * gst/gst.c: (gst_init_check_with_popt_table), (init_post), (init_popt_callback): declare gst initialized before eventually rebuilding the registry. Fixes issues with plugins calling gst_init * gst/gstelementfactory.c: (gst_element_factory_cleanup), (gst_element_register), (gst_element_factory_unload_thyself): warn and fail properly when element details aren't initialized. Also unref the class when we don't need it anymore instead of never/only on failure
This commit is contained in:
parent
20e6e96160
commit
3bef22d727
3 changed files with 19 additions and 4 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2005-04-23 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
|
* gst/gst.c: (gst_init_check_with_popt_table), (init_post),
|
||||||
|
(init_popt_callback):
|
||||||
|
declare gst initialized before eventually rebuilding the registry.
|
||||||
|
Fixes issues with plugins calling gst_init
|
||||||
|
* gst/gstelementfactory.c: (gst_element_factory_cleanup),
|
||||||
|
(gst_element_register), (gst_element_factory_unload_thyself):
|
||||||
|
warn and fail properly when element details aren't initialized. Also
|
||||||
|
unref the class when we don't need it anymore instead of never/only
|
||||||
|
on failure
|
||||||
|
|
||||||
2005-04-22 Wouter Paesen <wouter@kangaroot.net>
|
2005-04-22 Wouter Paesen <wouter@kangaroot.net>
|
||||||
|
|
||||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
|
@ -344,7 +344,6 @@ gst_init_check_with_popt_table (int *argc, char **argv[],
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!init_post ())
|
if (!init_post ())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
gst_initialized = TRUE;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,6 +615,7 @@ init_post (void)
|
||||||
_gst_buffer_initialize ();
|
_gst_buffer_initialize ();
|
||||||
_gst_tag_initialize ();
|
_gst_tag_initialize ();
|
||||||
|
|
||||||
|
gst_initialized = TRUE;
|
||||||
#ifndef GST_DISABLE_REGISTRY
|
#ifndef GST_DISABLE_REGISTRY
|
||||||
if (!_gst_registry_fixed) {
|
if (!_gst_registry_fixed) {
|
||||||
/* don't override command-line options */
|
/* don't override command-line options */
|
||||||
|
@ -806,7 +806,6 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
|
||||||
case POPT_CALLBACK_REASON_POST:
|
case POPT_CALLBACK_REASON_POST:
|
||||||
if (!init_post ())
|
if (!init_post ())
|
||||||
_gst_initialization_failure = TRUE;
|
_gst_initialization_failure = TRUE;
|
||||||
gst_initialized = TRUE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,6 @@ gst_element_factory_cleanup (GstElementFactory * factory)
|
||||||
{
|
{
|
||||||
__gst_element_details_clear (&factory->details);
|
__gst_element_details_clear (&factory->details);
|
||||||
if (factory->type) {
|
if (factory->type) {
|
||||||
g_type_class_unref (g_type_class_peek (factory->type));
|
|
||||||
factory->type = 0;
|
factory->type = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,6 +230,10 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
|
||||||
|
|
||||||
klass = GST_ELEMENT_CLASS (g_type_class_ref (type));
|
klass = GST_ELEMENT_CLASS (g_type_class_ref (type));
|
||||||
factory->type = type;
|
factory->type = type;
|
||||||
|
if (!GST_IS_ELEMENT_DETAILS (&klass->details)) {
|
||||||
|
g_warning ("invalid element details in class %s", g_type_name (type));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
__gst_element_details_copy (&factory->details, &klass->details);
|
__gst_element_details_copy (&factory->details, &klass->details);
|
||||||
factory->padtemplates = g_list_copy (klass->padtemplates);
|
factory->padtemplates = g_list_copy (klass->padtemplates);
|
||||||
g_list_foreach (factory->padtemplates, (GFunc) gst_object_ref, NULL);
|
g_list_foreach (factory->padtemplates, (GFunc) gst_object_ref, NULL);
|
||||||
|
@ -260,10 +263,12 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
|
||||||
|
|
||||||
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
|
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
|
||||||
|
|
||||||
|
g_type_class_unref (klass);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
gst_element_factory_cleanup (factory);
|
gst_element_factory_cleanup (factory);
|
||||||
|
g_type_class_unref (klass);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,7 +627,6 @@ gst_element_factory_unload_thyself (GstPluginFeature * feature)
|
||||||
factory = GST_ELEMENT_FACTORY (feature);
|
factory = GST_ELEMENT_FACTORY (feature);
|
||||||
|
|
||||||
if (factory->type) {
|
if (factory->type) {
|
||||||
g_type_class_unref (g_type_class_peek (factory->type));
|
|
||||||
factory->type = 0;
|
factory->type = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue