* the floating flag while leaving the reference count unchanged. If the object
* is not floating, then this call adds a new normal reference increasing the
* reference count by one.
+ *
+ * For more background on "floating references" please see the #GObject
+ * documentation.
*/
gpointer
gst_object_ref_sink (gpointer object)
}
/**
+ * gst_clear_object: (skip)
+ * @object_ptr: a pointer to a #GstObject reference
+ *
+ * Clears a reference to a #GstObject.
+ *
+ * @object_ptr must not be %NULL.
+ *
+ * If the reference is %NULL then this function does nothing.
+ * Otherwise, the reference count of the object is decreased using
+ * gst_object_unref() and the pointer is set to %NULL.
+ *
+ * A macro is also included that allows this function to be used without
+ * pointer casts.
+ *
+ * Since: 1.16
+ **/
+#undef gst_clear_object
+void
+gst_clear_object (GstObject ** object_ptr)
+{
+ g_clear_pointer (object_ptr, gst_object_unref);
+}
+
+/**
* gst_object_replace:
* @oldobj: (inout) (transfer full) (nullable): pointer to a place of
* a #GstObject to replace
/**
* gst_object_set_parent:
- * @object: a #GstObject
+ * @object: (transfer floating): a #GstObject
* @parent: new parent of object
*
* Sets the parent of @object to @parent. The object's reference count will
{
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object,
"set parent failed, object already had a parent");
+ gst_object_ref_sink (object);
+ gst_object_unref (object);
GST_OBJECT_UNLOCK (object);
return FALSE;
}
/**
* gst_object_add_control_binding:
* @object: the controller object
- * @binding: (transfer full): the #GstControlBinding that should be used
+ * @binding: (transfer floating): the #GstControlBinding that should be used
*
* Attach the #GstControlBinding to the object. If there already was a
* #GstControlBinding for this property it will be replaced.
*
- * The @object will take ownership of the @binding.
+ * The object's reference count will be incremented, and any floating
+ * reference will be removed (see gst_object_ref_sink())
*
* Returns: %FALSE if the given @binding has not been setup for this object or
* has been setup for a non suitable property, %TRUE otherwise.
}
/**
- * gst_object_get_value_array:
+ * gst_object_get_value_array: (skip)
* @object: the object that has controlled properties
* @property_name: the name of the property to get
* @timestamp: the time that should be processed
* @timestamp: the time that should be processed
* @interval: the time spacing between subsequent values
* @n_values: the number of values
- * @values: array to put control-values in
+ * @values: (array length=n_values): array to put control-values in
*
* Gets a number of #GValues for the given controlled property starting at the
* requested time. The array @values need to hold enough space for @n_values of
*
* Obtain the control-rate for this @object. Audio processing #GstElement
* objects will use this rate to sub-divide their processing loop and call
- * gst_object_sync_values() inbetween. The length of the processing segment
+ * gst_object_sync_values() in between. The length of the processing segment
* should be up to @control-rate nanoseconds.
*
* If the @object is not under property control, this will return
*
* Change the control-rate for this @object. Audio processing #GstElement
* objects will use this rate to sub-divide their processing loop and call
- * gst_object_sync_values() inbetween. The length of the processing segment
+ * gst_object_sync_values() in between. The length of the processing segment
* should be up to @control-rate nanoseconds.
*
* The control-rate should not change if the element is in %GST_STATE_PAUSED or