mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
set GstElement->elementfactory before creating any instances; doc updates for deep_notify
Original commit message from CVS: set GstElement->elementfactory before creating any instances; doc updates for deep_notify
This commit is contained in:
parent
ced6786dd9
commit
4d278e135a
2 changed files with 12 additions and 10 deletions
|
@ -222,12 +222,8 @@ gst_element_factory_create (GstElementFactory *factory,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* create an instance of the element */
|
||||
element = GST_ELEMENT (g_object_new (factory->type, NULL));
|
||||
g_assert (element != NULL);
|
||||
|
||||
/* attempt to set the elemenfactory class pointer if necessary */
|
||||
oclass = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
|
||||
/* attempt to set the elementfactory class pointer if necessary */
|
||||
oclass = GST_ELEMENT_CLASS (g_type_class_ref (factory->type));
|
||||
if (oclass->elementfactory == NULL) {
|
||||
GST_DEBUG (GST_CAT_ELEMENT_FACTORY, "class %s", GST_PLUGIN_FEATURE_NAME (factory));
|
||||
oclass->elementfactory = factory;
|
||||
|
@ -239,6 +235,12 @@ gst_element_factory_create (GstElementFactory *factory,
|
|||
oclass->numpadtemplates += factory->numpadtemplates;
|
||||
}
|
||||
|
||||
/* create an instance of the element */
|
||||
element = GST_ELEMENT (g_object_new (factory->type, NULL));
|
||||
g_assert (element != NULL);
|
||||
|
||||
g_type_class_unref (oclass);
|
||||
|
||||
gst_object_set_name (GST_OBJECT (element), name);
|
||||
|
||||
return element;
|
||||
|
|
|
@ -157,7 +157,7 @@ gst_object_class_init (GstObjectClass *klass)
|
|||
|
||||
klass->signal_object = g_object_new (gst_signal_object_get_type (), NULL);
|
||||
|
||||
/* see the comments at gst_element_dispatch_properties_changed */
|
||||
/* see the comments at gst_object_dispatch_properties_changed */
|
||||
gobject_class->dispatch_properties_changed
|
||||
= GST_DEBUG_FUNCPTR (gst_object_dispatch_properties_changed);
|
||||
|
||||
|
@ -325,9 +325,9 @@ gst_object_finalize (GObject *object)
|
|||
parent_class->finalize (object);
|
||||
}
|
||||
|
||||
/* Changing a GObject property of an element will result in "deep_notify"
|
||||
* signals being emitted by the element itself, as well as in each parent
|
||||
* element. This is so that an application can connect a listener to the
|
||||
/* Changing a GObject property of a GstObject will result in "deep_notify"
|
||||
* signals being emitted by the object itself, as well as in each parent
|
||||
* object. This is so that an application can connect a listener to the
|
||||
* top-level bin to catch property-change notifications for all contained
|
||||
* elements. */
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue