bufferpool: Fix the buffer size reset code
[platform/upstream/gstreamer.git] / gst / gstminiobject.h
index eaa3acc..b931e76 100644 (file)
@@ -126,7 +126,7 @@ typedef void (*GstMiniObjectNotify) (gpointer user_data, GstMiniObject * obj);
  * READONLY mode. Only read locks can be performed on the object.
  * @GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED: the object is expected to stay alive
  * even after gst_deinit() has been called and so should be ignored by leak
- * detection tools. (Since 1.10)
+ * detection tools. (Since: 1.10)
  * @GST_MINI_OBJECT_FLAG_LAST: first flag that can be used by subclasses.
  *
  * Flags for the mini object
@@ -213,12 +213,12 @@ struct _GstMiniObject {
   GstMiniObjectFreeFunction free;
 
   /* < private > */
-  /* Used to keep track of weak ref notifies and qdata */
-  guint n_qdata;
-  gpointer qdata;
+  /* Used to keep track of parents, weak ref notifies and qdata */
+  guint priv_uint;
+  gpointer priv_pointer;
 };
 
-GST_EXPORT
+GST_API
 void            gst_mini_object_init (GstMiniObject *mini_object,
                                       guint flags, GType type,
                                       GstMiniObjectCopyFunction copy_func,
@@ -228,57 +228,66 @@ void            gst_mini_object_init (GstMiniObject *mini_object,
 
 /* refcounting */
 
-GST_EXPORT
+GST_API
 GstMiniObject * gst_mini_object_ref            (GstMiniObject *mini_object);
 
-GST_EXPORT
+GST_API
 void            gst_mini_object_unref          (GstMiniObject *mini_object);
 
-GST_EXPORT
+GST_API
+void        gst_clear_mini_object (GstMiniObject **object_ptr);
+#define     gst_clear_mini_object(object_ptr) g_clear_pointer ((object_ptr), gst_mini_object_unref)
+
+GST_API
 void            gst_mini_object_weak_ref        (GstMiniObject *object,
                                                 GstMiniObjectNotify notify,
                                                 gpointer data);
-GST_EXPORT
+GST_API
 void            gst_mini_object_weak_unref     (GstMiniObject *object,
                                                 GstMiniObjectNotify notify,
                                                 gpointer data);
 
 /* locking */
 
-GST_EXPORT
+GST_API
 gboolean        gst_mini_object_lock            (GstMiniObject *object, GstLockFlags flags);
 
-GST_EXPORT
+GST_API
 void            gst_mini_object_unlock          (GstMiniObject *object, GstLockFlags flags);
 
-GST_EXPORT
+GST_API
 gboolean        gst_mini_object_is_writable     (const GstMiniObject *mini_object);
 
-GST_EXPORT
+GST_API
 GstMiniObject * gst_mini_object_make_writable  (GstMiniObject *mini_object) G_GNUC_WARN_UNUSED_RESULT;
 
 /* copy */
 
-GST_EXPORT
+GST_API
 GstMiniObject * gst_mini_object_copy           (const GstMiniObject *mini_object) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 
 
-GST_EXPORT
+GST_API
 void            gst_mini_object_set_qdata       (GstMiniObject *object, GQuark quark,
                                                  gpointer data, GDestroyNotify destroy);
-GST_EXPORT
+GST_API
 gpointer        gst_mini_object_get_qdata       (GstMiniObject *object, GQuark quark);
 
-GST_EXPORT
+GST_API
 gpointer        gst_mini_object_steal_qdata     (GstMiniObject *object, GQuark quark);
 
-GST_EXPORT
+GST_API
+void            gst_mini_object_add_parent      (GstMiniObject *object, GstMiniObject *parent);
+GST_API
+void            gst_mini_object_remove_parent   (GstMiniObject *object, GstMiniObject *parent);
+
+GST_API
 gboolean        gst_mini_object_replace         (GstMiniObject **olddata, GstMiniObject *newdata);
 
-GST_EXPORT
+GST_API
 gboolean        gst_mini_object_take            (GstMiniObject **olddata, GstMiniObject *newdata);
 
-GST_EXPORT
+GST_API
 GstMiniObject * gst_mini_object_steal           (GstMiniObject **olddata) G_GNUC_WARN_UNUSED_RESULT;
 
 /**