2002-01-15 00:41:22 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GstObject
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2004-03-25 04:20:33 +00:00
|
|
|
Base class for the GStreamer object hierarchy
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
GstObject provides a root for the object hierarchy tree filed in by the
|
|
|
|
GST library. It is currently a thin wrapper on top of
|
2002-07-12 23:21:20 +00:00
|
|
|
<classname>GObject</classname>. It is an abstract class that is not
|
2002-01-15 00:41:22 +00:00
|
|
|
very usable on its own.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2004-10-13 13:03:25 +00:00
|
|
|
GstObject gives us basic refcounting, parenting functionality and locking.
|
|
|
|
Most of the function are just extended for special gstreamer needs and can be
|
|
|
|
found under the same name in the base class of GstObject which is GObject
|
|
|
|
(e.g. g_object_ref becomes gst_object_ref).
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
2004-10-13 13:03:25 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The most interesting difference between GstObject and GObject is the "floating"
|
|
|
|
reference count. A GObject is created with a reference count of 1, owned by the
|
|
|
|
creator of the GObject. (The owner of a reference is the code section that has
|
|
|
|
the right to call gst_object_unref() in order to remove that reference.)
|
|
|
|
A GstObject is created with a reference count of 1 also, but it isn't owned by
|
|
|
|
anyone; calling gst_object_unref() on the newly-created GtkObject is incorrect.
|
|
|
|
Instead, the initial reference count of a GstObject is "floating". The floating
|
|
|
|
reference can be removed by anyone at any time, by calling gst_object_sink().
|
|
|
|
gst_object_sink() does nothing if an object is already sunk (has no floating
|
|
|
|
reference).
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
When you add a GstElement to its parent container, the parent container will do
|
|
|
|
this:
|
|
|
|
<programlisting>
|
|
|
|
gst_object_ref (GST_OBJECT (child_element));
|
|
|
|
gst_object_sink (GST_OBJECT (child_element));
|
|
|
|
</programlisting>
|
|
|
|
This means that the container now owns a reference to the child element (since
|
|
|
|
it called gst_object_ref()), and the child element has no floating reference.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The purpose of the floating reference is to keep the child element alive until
|
|
|
|
you add it to a parent container:
|
|
|
|
<programlisting>
|
|
|
|
element = gst_element_factory_make (factoryname, name);
|
|
|
|
/* element has one floating reference to keep it alive */
|
|
|
|
gtk_bin_add (GTK_BIN (bin), element);
|
|
|
|
/* element has one non-floating reference owned by the container */
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Another effect of this is, that calling gst_object_unref() on a bin object, will
|
|
|
|
also destoy all the GstElement objects in it. The same is true for calling
|
|
|
|
gst_bin_remove().
|
|
|
|
</para>
|
|
|
|
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
gst_object_set_name() and gst_object_get_name() are used to set/get the name of the
|
|
|
|
object.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-07-15 11:04:18 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2004-07-21 11:32:09 +00:00
|
|
|
<!-- ##### STRUCT GstObject ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-03-29 10:55:39 +00:00
|
|
|
@refcount:
|
|
|
|
@lock:
|
|
|
|
@name:
|
|
|
|
@name_prefix:
|
|
|
|
@parent:
|
|
|
|
@flags:
|
2004-07-21 11:32:09 +00:00
|
|
|
|
|
|
|
<!-- ##### SIGNAL GstObject::deep-notify ##### -->
|
|
|
|
<para>
|
|
|
|
The deep notify signal is used to be notified of property changes.
|
|
|
|
it is typically attached to the toplevel bin to receive notifications
|
|
|
|
from all the elements contained in that bin.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@gstobject: the object which received the signal.
|
|
|
|
@arg1: the object that originated the signal
|
|
|
|
@arg2: the property that changed
|
|
|
|
|
|
|
|
<!-- ##### SIGNAL GstObject::object-saved ##### -->
|
|
|
|
<para>
|
|
|
|
Is trigered whenever a new object is saved to XML. You can connect to
|
|
|
|
this signal to insert custom XML tags into the core XML.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@gstobject: the object which received the signal.
|
|
|
|
@arg1: the xmlNodePtr of the parent node
|
|
|
|
|
|
|
|
<!-- ##### SIGNAL GstObject::parent-set ##### -->
|
|
|
|
<para>
|
|
|
|
Is emitted when the parent of an object is set.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@gstobject: the object which received the signal.
|
|
|
|
@arg1: the new parent
|
|
|
|
|
|
|
|
<!-- ##### SIGNAL GstObject::parent-unset ##### -->
|
|
|
|
<para>
|
|
|
|
Is emitted when the parent of an object is unset.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@gstobject: the object which received the signal.
|
|
|
|
@arg1: the old parent
|
|
|
|
|
|
|
|
<!-- ##### ARG GstObject:name ##### -->
|
|
|
|
<para>
|
|
|
|
The name of the object
|
|
|
|
</para>
|
|
|
|
|
2002-01-15 00:41:22 +00:00
|
|
|
<!-- ##### ENUM GstObjectFlags ##### -->
|
|
|
|
<para>
|
2002-12-14 13:02:16 +00:00
|
|
|
Flags for an object
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2005-03-29 10:55:39 +00:00
|
|
|
@GST_OBJECT_DISPOSING:
|
|
|
|
@GST_OBJECT_DESTROYED:
|
|
|
|
@GST_OBJECT_FLOATING:
|
2002-07-12 23:21:20 +00:00
|
|
|
@GST_OBJECT_FLAG_LAST: subclasses can add additional flags starting from this flag
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
<!-- ##### MACRO GST_FLAGS ##### -->
|
|
|
|
<para>
|
|
|
|
This macro returns the entire set of flags for the object.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@obj: Object to return flags for.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_FLAG_IS_SET ##### -->
|
|
|
|
<para>
|
|
|
|
This macro checks to see if the given flag is set.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@obj: GstSrc to check for flag in.
|
|
|
|
@flag: Flag to check for, must be a single bit in guint32.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_FLAG_SET ##### -->
|
|
|
|
<para>
|
|
|
|
This macro sets the given bits.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@obj: Object to set flag in.
|
|
|
|
@flag: Flag to set, can by any number of bits in guint32.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_FLAG_UNSET ##### -->
|
|
|
|
<para>
|
|
|
|
This macro usets the given bits.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@obj: Object to unset flag in.
|
|
|
|
@flag: Flag to set, must be a single bit in guint32.
|
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### MACRO GST_OBJECT_NAME ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
2004-03-25 04:20:33 +00:00
|
|
|
Get the name of this object
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@obj: Object to get the name of.
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### MACRO GST_OBJECT_PARENT ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
2004-03-25 04:20:33 +00:00
|
|
|
Get the parent of this object
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@obj: Object to get the parent of.
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### MACRO GST_LOCK ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
2004-03-25 04:20:33 +00:00
|
|
|
This macro will obtain a lock on the object, making serialization
|
|
|
|
possible.
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@obj: Object to lock.
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### MACRO GST_TRYLOCK ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
2004-03-25 04:20:33 +00:00
|
|
|
This macro will try to obtain a lock on the object, but will return with
|
|
|
|
FALSE if it can't get it immediately.
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@obj: Object to try to get a lock on.
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### MACRO GST_UNLOCK ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
2004-03-25 04:20:33 +00:00
|
|
|
This macro releases a lock on the object.
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@obj: Object to unlock.
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### MACRO GST_GET_LOCK ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
2004-03-25 04:20:33 +00:00
|
|
|
Acquire a reference to the mutex of this object.
|
2002-01-15 00:41:22 +00:00
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@obj: Object to get the mutex of.
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_set_name ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@object:
|
2002-01-15 00:41:22 +00:00
|
|
|
@name:
|
2005-03-29 10:55:39 +00:00
|
|
|
@Returns:
|
2004-03-25 04:20:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_object_get_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
2002-01-15 00:41:22 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_object_set_parent ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
|
|
|
@parent:
|
2005-03-29 10:55:39 +00:00
|
|
|
@Returns:
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_object_get_parent ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_unparent ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_default_deep_notify ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
2004-03-25 04:20:33 +00:00
|
|
|
@orig:
|
|
|
|
@pspec:
|
|
|
|
@excluded_props:
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_check_uniqueness ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@list:
|
|
|
|
@name:
|
|
|
|
@Returns:
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_save_thyself ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@object:
|
|
|
|
@parent:
|
2002-01-15 00:41:22 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_restore_thyself ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@object:
|
|
|
|
@self:
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_ref ##### -->
|
2003-02-10 23:01:55 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@object: the object
|
|
|
|
@Returns:
|
2003-02-10 23:01:55 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_unref ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object: the object
|
2005-06-28 09:17:14 +00:00
|
|
|
<!-- # Unused Parameters # -->
|
2005-03-29 10:55:39 +00:00
|
|
|
@Returns:
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_sink ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@object: the object
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_object_replace ##### -->
|
2002-01-15 00:41:22 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@oldobj:
|
|
|
|
@newobj:
|
2002-01-15 00:41:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_object_get_path_string ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### FUNCTION gst_class_signal_connect ##### -->
|
2002-12-14 13:02:16 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
@klass:
|
|
|
|
@name:
|
|
|
|
@func:
|
|
|
|
@func_data:
|
|
|
|
@Returns:
|
2002-12-14 13:02:16 +00:00
|
|
|
|
|
|
|
|
2002-01-15 00:41:22 +00:00
|
|
|
<!-- ##### FUNCTION gst_class_signal_emit_by_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@object:
|
|
|
|
@name:
|
|
|
|
@self:
|
|
|
|
|
|
|
|
|