mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
gstobject: rename gst_object_has_parent to gst_object_has_as_parent
This avoid confusion with a potential punction that check if a gstobject has-a parent. API: gst_object_has_as_parent()
This commit is contained in:
parent
4f79c5e8da
commit
3492105a06
5 changed files with 28 additions and 28 deletions
|
@ -1707,7 +1707,7 @@ gst_object_set_name
|
|||
gst_object_get_name
|
||||
gst_object_set_parent
|
||||
gst_object_get_parent
|
||||
gst_object_has_parent
|
||||
gst_object_has_as_parent
|
||||
gst_object_unparent
|
||||
gst_object_default_deep_notify
|
||||
gst_object_default_error
|
||||
|
|
|
@ -779,7 +779,7 @@ gst_object_unparent (GstObject * object)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_object_has_parent:
|
||||
* gst_object_has_as_parent:
|
||||
* @object: a #GstObject to check
|
||||
* @parent: a #GstObject to check as parent
|
||||
*
|
||||
|
@ -793,7 +793,7 @@ gst_object_unparent (GstObject * object)
|
|||
* Since: 1.6
|
||||
*/
|
||||
gboolean
|
||||
gst_object_has_parent (GstObject * object, GstObject * parent)
|
||||
gst_object_has_as_parent (GstObject * object, GstObject * parent)
|
||||
{
|
||||
gboolean result = FALSE;
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ gchar* gst_object_get_name (GstObject *object);
|
|||
gboolean gst_object_set_parent (GstObject *object, GstObject *parent);
|
||||
GstObject* gst_object_get_parent (GstObject *object);
|
||||
void gst_object_unparent (GstObject *object);
|
||||
gboolean gst_object_has_parent (GstObject *object, GstObject *parent);
|
||||
gboolean gst_object_has_as_parent (GstObject *object, GstObject *parent);
|
||||
gboolean gst_object_has_ancestor (GstObject *object, GstObject *ancestor);
|
||||
|
||||
void gst_object_default_deep_notify (GObject *object, GstObject *orig,
|
||||
|
|
|
@ -361,9 +361,9 @@ GST_START_TEST (test_fake_object_parentage)
|
|||
fail_if (result, "GstFakeObject accepted itself as parent");
|
||||
|
||||
/* _has_parent always returns FALSE if there is no parent */
|
||||
fail_if (gst_object_has_parent (object1, NULL));
|
||||
fail_if (gst_object_has_parent (NULL, object1));
|
||||
fail_if (gst_object_has_parent (object1, object1));
|
||||
fail_if (gst_object_has_as_parent (object1, NULL));
|
||||
fail_if (gst_object_has_as_parent (NULL, object1));
|
||||
fail_if (gst_object_has_as_parent (object1, object1));
|
||||
|
||||
/* should still be floating */
|
||||
fail_unless (g_object_is_floating (object1),
|
||||
|
@ -378,7 +378,7 @@ GST_START_TEST (test_fake_object_parentage)
|
|||
fail_unless (g_object_is_floating (object1),
|
||||
"GstFakeObject instance is not floating");
|
||||
|
||||
result = gst_object_has_parent (object1, object2);
|
||||
result = gst_object_has_as_parent (object1, object2);
|
||||
fail_if (result, "GstFakeObject has a parent");
|
||||
|
||||
/* try to set other object as parent */
|
||||
|
@ -393,16 +393,16 @@ GST_START_TEST (test_fake_object_parentage)
|
|||
"GstFakeObject instance is not floating");
|
||||
|
||||
/* check the parent */
|
||||
fail_unless (gst_object_has_parent (object1, object2));
|
||||
fail_unless (gst_object_has_as_parent (object1, object2));
|
||||
|
||||
/* any other combination is invalid */
|
||||
fail_if (gst_object_has_parent (object2, object1));
|
||||
fail_if (gst_object_has_parent (object1, NULL));
|
||||
fail_if (gst_object_has_parent (object2, NULL));
|
||||
fail_if (gst_object_has_parent (NULL, object1));
|
||||
fail_if (gst_object_has_parent (NULL, object2));
|
||||
fail_if (gst_object_has_parent (object1, object1));
|
||||
fail_if (gst_object_has_parent (object2, object2));
|
||||
fail_if (gst_object_has_as_parent (object2, object1));
|
||||
fail_if (gst_object_has_as_parent (object1, NULL));
|
||||
fail_if (gst_object_has_as_parent (object2, NULL));
|
||||
fail_if (gst_object_has_as_parent (NULL, object1));
|
||||
fail_if (gst_object_has_as_parent (NULL, object2));
|
||||
fail_if (gst_object_has_as_parent (object1, object1));
|
||||
fail_if (gst_object_has_as_parent (object2, object2));
|
||||
|
||||
/* try to set other object as parent again */
|
||||
result = gst_object_set_parent (object1, object2);
|
||||
|
@ -489,40 +489,40 @@ GST_START_TEST (test_fake_object_has_ancestor)
|
|||
*/
|
||||
|
||||
/* An object isn't its own parent, but it is its own ancestor */
|
||||
fail_if (gst_object_has_parent (object1, object1));
|
||||
fail_if (gst_object_has_as_parent (object1, object1));
|
||||
fail_unless (gst_object_has_ancestor (object1, object1));
|
||||
|
||||
fail_if (gst_object_has_parent (object4, object4));
|
||||
fail_if (gst_object_has_as_parent (object4, object4));
|
||||
fail_unless (gst_object_has_ancestor (object4, object4));
|
||||
|
||||
/* direct parents */
|
||||
fail_unless (gst_object_has_parent (object1, object3));
|
||||
fail_unless (gst_object_has_as_parent (object1, object3));
|
||||
fail_unless (gst_object_has_ancestor (object1, object3));
|
||||
|
||||
fail_unless (gst_object_has_parent (object2, object3));
|
||||
fail_unless (gst_object_has_as_parent (object2, object3));
|
||||
fail_unless (gst_object_has_ancestor (object2, object3));
|
||||
|
||||
fail_unless (gst_object_has_parent (object3, object4));
|
||||
fail_unless (gst_object_has_as_parent (object3, object4));
|
||||
fail_unless (gst_object_has_ancestor (object3, object4));
|
||||
|
||||
/* grandparents */
|
||||
fail_if (gst_object_has_parent (object1, object4));
|
||||
fail_if (gst_object_has_as_parent (object1, object4));
|
||||
fail_unless (gst_object_has_ancestor (object1, object4));
|
||||
|
||||
fail_if (gst_object_has_parent (object2, object4));
|
||||
fail_if (gst_object_has_as_parent (object2, object4));
|
||||
fail_unless (gst_object_has_ancestor (object2, object4));
|
||||
|
||||
/* not ancestors */
|
||||
fail_if (gst_object_has_parent (object1, object2));
|
||||
fail_if (gst_object_has_as_parent (object1, object2));
|
||||
fail_if (gst_object_has_ancestor (object1, object2));
|
||||
|
||||
fail_if (gst_object_has_parent (object3, object1));
|
||||
fail_if (gst_object_has_as_parent (object3, object1));
|
||||
fail_if (gst_object_has_ancestor (object3, object1));
|
||||
|
||||
fail_if (gst_object_has_parent (object4, object1));
|
||||
fail_if (gst_object_has_as_parent (object4, object1));
|
||||
fail_if (gst_object_has_ancestor (object4, object1));
|
||||
|
||||
fail_if (gst_object_has_parent (object4, object3));
|
||||
fail_if (gst_object_has_as_parent (object4, object3));
|
||||
fail_if (gst_object_has_ancestor (object4, object3));
|
||||
|
||||
/* unparent everything */
|
||||
|
|
|
@ -781,7 +781,7 @@ EXPORTS
|
|||
gst_object_get_value_array
|
||||
gst_object_has_active_control_bindings
|
||||
gst_object_has_ancestor
|
||||
gst_object_has_parent
|
||||
gst_object_has_as_parent
|
||||
gst_object_ref
|
||||
gst_object_ref_sink
|
||||
gst_object_remove_control_binding
|
||||
|
|
Loading…
Reference in a new issue