[Bug 739662] gstobject: Add gst_object_has_parent()

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Jan 22 23:53:28 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=739662
  GStreamer | gstreamer (core) | git master

--- Comment #13 from Stefan Sauer (gstreamer, gtkdoc dev) <ensonic at sonicpulse.de> 2015-01-23 07:53:25 UTC ---
A few more thoughts:
- in my projects I simply use GST_OBJECT_PARENT(obj) to implement
gboolean 
gst_object_has_parent(obj) {
  return GST_OBJECT_PARENT(obj) != NULL;
}

gboolean 
gst_object_compare_parent(obj, parent) {
  return GST_OBJECT_PARENT(obj) == parent;
}

If we want to introduce them as functions, we could also simply add both.

-1 for gst_object_is_parent() as I would understand this as (obj->children !=
NULL). I think I like gst_object_compare_parent() the most as this makes it
obvious that you need a 2nd parameter passing what you want to compare to.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list