set GstElement->elementfactory before creating any instances; doc updates for deep_notify
authorAndy Wingo <wingo@pobox.com>
Mon, 16 Jun 2003 15:08:34 +0000 (15:08 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 16 Jun 2003 15:08:34 +0000 (15:08 +0000)
Original commit message from CVS:
set GstElement->elementfactory before creating any instances; doc updates for deep_notify

gst/gstelementfactory.c
gst/gstobject.c

index 78f00fd..9f7f949 100644 (file)
@@ -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;
index 8b81395..5b24596 100644 (file)
@@ -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