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;
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;
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);
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