helpers: use $(INSTALL) to ... install the helper.
[platform/upstream/gstreamer.git] / gst / gstobject.c
index 0250003..198a7db 100644 (file)
@@ -312,7 +312,7 @@ gst_object_ref_sink (gpointer object)
  * gst_object_replace:
  * @oldobj: (inout) (transfer full) (nullable): pointer to a place of
  *     a #GstObject to replace
- * @newobj: (transfer none): a new #GstObject
+ * @newobj: (transfer none) (allow-none): a new #GstObject
  *
  * Atomically modifies a pointer to point to a new object.
  * The reference count of @oldobj is decreased and the reference count of
@@ -588,7 +588,7 @@ had_parent:
 /**
  * gst_object_set_name:
  * @object: a #GstObject
- * @name:   new name of object
+ * @name: (allow-none): new name of object
  *
  * Sets the name of @object, or gives @object a guaranteed unique
  * name (if @name is %NULL).
@@ -779,6 +779,34 @@ gst_object_unparent (GstObject * object)
 }
 
 /**
+ * gst_object_has_parent:
+ * @object: a #GstObject to check
+ * @parent: a #GstObject to check as parent
+ *
+ * Check if @parent is the parent of @object.
+ * E.g. a #GstElement can check if it owns a given #GstPad.
+ *
+ * Returns: %FALSE if either @object or @parent is %NULL. %TRUE if @parent is
+ *          the parent of @object. Otherwise %FALSE.
+ *
+ * MT safe. Grabs and releases @object's locks.
+ * Since: 1.6
+ */
+gboolean
+gst_object_has_parent (GstObject * object, GstObject * parent)
+{
+  gboolean result = FALSE;
+
+  if (G_LIKELY (GST_IS_OBJECT (object) && GST_IS_OBJECT (parent))) {
+    GST_OBJECT_LOCK (object);
+    result = GST_OBJECT_PARENT (object) == parent;
+    GST_OBJECT_UNLOCK (object);
+  }
+
+  return result;
+}
+
+/**
  * gst_object_has_ancestor:
  * @object: a #GstObject to check
  * @ancestor: a #GstObject to check as ancestor