}
/**
- * gst_object_has_ancestor:
+ * gst_object_has_as_ancestor:
* @object: a #GstObject to check
* @ancestor: a #GstObject to check as ancestor
*
* MT safe. Grabs and releases @object's locks.
*/
gboolean
-gst_object_has_ancestor (GstObject * object, GstObject * ancestor)
+gst_object_has_as_ancestor (GstObject * object, GstObject * ancestor)
{
GstObject *parent, *tmp;
}
/**
+ * gst_object_has_ancestor:
+ * @object: a #GstObject to check
+ * @ancestor: a #GstObject to check as ancestor
+ *
+ * Check if @object has an ancestor @ancestor somewhere up in
+ * the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
+ *
+ * Returns: %TRUE if @ancestor is an ancestor of @object.
+ *
+ * Deprecated: Use gst_object_has_as_ancestor() instead.
+ *
+ * MT safe. Grabs and releases @object's locks.
+ */
+/* FIXME 2.0: remove */
+#ifndef GST_REMOVE_DEPRECATED
+#ifdef GST_DISABLE_DEPRECATED
+gboolean gst_object_has_ancestor (GstObject * object, GstObject * ancestor);
+#endif
+gboolean
+gst_object_has_ancestor (GstObject * object, GstObject * ancestor)
+{
+ return gst_object_has_as_ancestor (object, ancestor);
+}
+#endif
+
+/**
* gst_object_check_uniqueness:
* @list: (transfer none) (element-type Gst.Object): a list of #GstObject to
* check through
GST_END_TEST;
-GST_START_TEST (test_fake_object_has_ancestor)
+GST_START_TEST (test_fake_object_has_as_ancestor)
{
GstObject *object1, *object2, *object3, *object4;
gboolean result;
/* An object isn't its own parent, but it is its own ancestor */
fail_if (gst_object_has_as_parent (object1, object1));
- fail_unless (gst_object_has_ancestor (object1, object1));
+ fail_unless (gst_object_has_as_ancestor (object1, object1));
fail_if (gst_object_has_as_parent (object4, object4));
- fail_unless (gst_object_has_ancestor (object4, object4));
+ fail_unless (gst_object_has_as_ancestor (object4, object4));
/* direct parents */
fail_unless (gst_object_has_as_parent (object1, object3));
- fail_unless (gst_object_has_ancestor (object1, object3));
+ fail_unless (gst_object_has_as_ancestor (object1, object3));
fail_unless (gst_object_has_as_parent (object2, object3));
- fail_unless (gst_object_has_ancestor (object2, object3));
+ fail_unless (gst_object_has_as_ancestor (object2, object3));
fail_unless (gst_object_has_as_parent (object3, object4));
- fail_unless (gst_object_has_ancestor (object3, object4));
+ fail_unless (gst_object_has_as_ancestor (object3, object4));
/* grandparents */
fail_if (gst_object_has_as_parent (object1, object4));
- fail_unless (gst_object_has_ancestor (object1, object4));
+ fail_unless (gst_object_has_as_ancestor (object1, object4));
fail_if (gst_object_has_as_parent (object2, object4));
- fail_unless (gst_object_has_ancestor (object2, object4));
+ fail_unless (gst_object_has_as_ancestor (object2, object4));
/* not ancestors */
fail_if (gst_object_has_as_parent (object1, object2));
- fail_if (gst_object_has_ancestor (object1, object2));
+ fail_if (gst_object_has_as_ancestor (object1, object2));
fail_if (gst_object_has_as_parent (object3, object1));
- fail_if (gst_object_has_ancestor (object3, object1));
+ fail_if (gst_object_has_as_ancestor (object3, object1));
fail_if (gst_object_has_as_parent (object4, object1));
- fail_if (gst_object_has_ancestor (object4, object1));
+ fail_if (gst_object_has_as_ancestor (object4, object1));
fail_if (gst_object_has_as_parent (object4, object3));
- fail_if (gst_object_has_ancestor (object4, object3));
+ fail_if (gst_object_has_as_ancestor (object4, object3));
/* unparent everything */
gst_object_unparent (object3);
tcase_add_test (tc_chain, test_fake_object_parentage);
tcase_add_test (tc_chain, test_fake_object_parentage_dispose);
- tcase_add_test (tc_chain, test_fake_object_has_ancestor);
+ tcase_add_test (tc_chain, test_fake_object_has_as_ancestor);
//tcase_add_checked_fixture (tc_chain, setup, teardown);
return s;