Object
provides a root for the object hierarchy tree filed in by the
GStreamer library. It is currently a thin wrapper on top of
gobject::InitiallyUnowned
. It is an abstract class that is not very usable on its own.
Object
gives us basic refcounting, parenting functionality and locking.
Most of the functions are just extended for special GStreamer needs and can be
found under the same name in the base class of Object
which is gobject::Object
(e.g. gobject::ObjectExt::ref
becomes GstObjectExt::ref
).
Since Object
derives from gobject::InitiallyUnowned
, it also inherits the
floating reference. Be aware that functions such as BinExt::add
and
ElementExt::add_pad
take ownership of the floating reference.
In contrast to gobject::Object
instances, Object
adds a name property. The functions
GstObjectExt::set_name
and GstObjectExt::get_name
are used to set/get the name
of the object.
Controlled properties offers a lightweight way to adjust gobject properties
over stream-time. It works by using time-stamped value pairs that are queued
for element-properties. At run-time the elements continuously pull value
changes for the current stream-time.
What needs to be changed in a Element
?
Very little - it is just two steps to make a plugin controllable!
-
mark gobject-properties paramspecs that make sense to be controlled,
by GST_PARAM_CONTROLLABLE.
-
when processing data (get, chain, loop function) at the beginning call
gst_object_sync_values(element,timestamp).
This will make the controller update all GObject properties that are
under its control with the current values based on the timestamp.
What needs to be done in applications? Again it's not a lot to change.
-
create a ControlSource
.
csource = gst_interpolation_control_source_new ();
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
-
Attach the ControlSource
on the controller to a property.
gst_object_add_control_binding (object, gst_direct_control_binding_new (object, "prop1", csource));
-
Set the control values
gst_timed_value_control_source_set ((GstTimedValueControlSource *)csource,0 * GST_SECOND, value1);
gst_timed_value_control_source_set ((GstTimedValueControlSource *)csource,1 * GST_SECOND, value2);
-
start your pipeline
GstObjectExt
, glib::object::ObjectExt
Checks to see if there is any object named name
in list
. This function
does not do any locking of any kind. You might want to protect the
provided list with the lock of the owner of the list. This function
will lock each Object
in the list to compare the name, so be
careful when passing a list with a locked object.
a list of Object
to
check through
the name to search for
true
if a Object
named name
does not appear in list
,
false
if it does.
MT safe. Grabs and releases the LOCK of each object in the list.
Performs copy-assignment from source
. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
Returns the type identifier of Self
.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
Formats the value using the given formatter. Read more