Name
GstObject -- Basis for the GST object hierarchy.
Description
GstObject provides a root for the object hierarchy tree filed in by the
GST library. It is currently a thin wrapper on top of
GtkObject, but eventually will be replaced by a
stripped down version of it. This will remove all the X dependencies from
the GST library, making it much more portably and generally useful.
GstObject gives us basic refcounting and parenting functionality, though
it is possible that we could use GtkObject's
equivalent functions. I'll probably use what I have now until I strip
down GtkObject to re-parent the hierarchy.
Details
GST_OBJECT_FLAG_LAST
#define GST_OBJECT_FLAG_LAST 4 |
subclasses can use this value to start the enumeration of their flags
GST_FLAGS()
#define GST_FLAGS(obj) GTK_OBJECT_FLAGS(obj) |
This macro returns the entire set of flags for the object.
GST_FLAG_IS_SET()
#define GST_FLAG_IS_SET(obj,flag) (GST_FLAGS (obj) & (1<<(flag))) |
This macro checks to see if the given flag is set.
GST_FLAG_SET()
#define GST_FLAG_SET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) |= (1<<(flag))); }G_STMT_END |
This macro sets the given bits.
GST_FLAG_UNSET()
#define GST_FLAG_UNSET(obj,flag) G_STMT_START{ (GST_FLAGS (obj) &= ~(1<<(flag))); }G_STMT_END |
This macro usets the given bits.
GST_LOCK()
#define GST_LOCK(obj) (g_mutex_lock(GST_OBJECT(obj)->lock)) |
This macro will obtain a lock on the object, making serialization
possible.
GST_TRYLOCK()
#define GST_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT(obj)->lock)) |
This macro will try to obtain a lock on the object, but will return with
FALSE if it can't get it immediately.
GST_UNLOCK()
#define GST_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT(obj)->lock)) |
This macro releases a lock on the object.
gst_object_new ()
Create a new, empty object. Not very useful, should never be used.
gst_object_set_parent ()
Set the parent of the object. The object's reference count is
incremented.
signals the parent-set signal
gst_object_get_parent ()
Return the parent of the object.
gst_object_unparent ()
void gst_object_unparent (GstObject *object); |
Clear the parent of the object, removing the associated reference.
gst_object_ref()
#define gst_object_ref(object) gtk_object_ref(GTK_OBJECT(object)); |
Increments the refence count on the object.
gst_object_unref()
#define gst_object_unref(object) gtk_object_unref(GTK_OBJECT(object)); |
Decrements the refence count on the object. If reference count hits
zero, destroy the object.
gst_object_sink()
#define gst_object_sink(object) gtk_object_sink(GTK_OBJECT(object)); |
Removes floating reference on an object. Any newly created object has
a refcount of 1 and is FLOATING. This function should be used when
creating a new object to symbolically 'take ownership of' the object.
gst_object_destroy()
#define gst_object_destroy(object) gtk_object_destroy(GTK_OBJECT(object)) |
gst_object_get_path_string ()
gchar* gst_object_get_path_string (GstObject *object); |
Generates a string describing the path of the object in
the object hierarchy. Usefull for debugging