miniobject: change to GST_DEFINE_MINI_OBJECT_TYPE
[platform/upstream/gstreamer.git] / gst / gstminiobject.h
index 74d959f..216ebb2 100644 (file)
@@ -52,10 +52,12 @@ typedef GstMiniObject * (*GstMiniObjectCopyFunction) (const GstMiniObject *obj);
  * Function prototype for when a miniobject has lost its last refcount.
  * Implementation of the mini object are allowed to revive the
  * passed object by doing a gst_mini_object_ref(). If the object is not
- * revived after the dispose function, the memory associated with the
- * object is freed.
+ * revived after the dispose function, the function should return %TRUE
+ * and the memory associated with the object is freed.
+ *
+ * Returns: %TRUE if the object should be cleaned up.
  */
-typedef void (*GstMiniObjectDisposeFunction) (GstMiniObject *obj);
+typedef gboolean (*GstMiniObjectDisposeFunction) (GstMiniObject *obj);
 /**
  * GstMiniObjectFreeFunction:
  * @obj: MiniObject to free
@@ -191,8 +193,6 @@ struct _GstMiniObject {
   } *weak_refs;
 };
 
-GType           gst_mini_object_register        (const gchar *name);
-
 void            gst_mini_object_init            (GstMiniObject *mini_object,
                                                  GType type, gsize size);
 
@@ -215,6 +215,10 @@ gboolean        gst_mini_object_replace         (GstMiniObject **olddata, GstMin
 gboolean        gst_mini_object_take            (GstMiniObject **olddata, GstMiniObject *newdata);
 GstMiniObject * gst_mini_object_steal           (GstMiniObject **olddata);
 
+#define GST_DEFINE_MINI_OBJECT_TYPE(TypeName,type_name) \
+   G_DEFINE_BOXED_TYPE(TypeName,type_name,              \
+       (GBoxedCopyFunc) gst_mini_object_ref,            \
+       (GBoxedFreeFunc)gst_mini_object_unref)
 
 G_END_DECLS