Class GstObject

java.lang.Object
All Implemented Interfaces:
Proxy
Direct Known Subclasses:
Allocator, AudioRingBuffer, BufferPool, Bus, Clock, CollectPads, ControlBinding, ControlSource, Device, DeviceMonitor, DeviceProvider, Element, GstObject.ObjectImpl, Pad, PadTemplate, Plugin, PluginFeature, Registry, Stream, StreamCollection, Task, TaskPool, Tracer, TracerRecord

@Generated("io.github.jwharm.JavaGI") public abstract class GstObject extends InitiallyUnowned
GstObject provides a root for the object hierarchy tree filed in by the GStreamer library. It is currently a thin wrapper on top of GInitiallyUnowned. It is an abstract class that is not very usable on its own.

GstObject 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 GstObject which is GObject (e.g. g_object_ref() becomes gst_object_ref()).

Since GstObject derives from GInitiallyUnowned, it also inherits the floating reference. Be aware that functions such as gst_bin_add() and gst_element_add_pad() take ownership of the floating reference.

In contrast to GObject instances, GstObject adds a name property. The functions gst_object_set_name() and gst_object_get_name() are used to set/get the name of the object.

controlled properties
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 GstElement? 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 GstControlSource. csource = gst_interpolation_control_source_new (); g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
  • Attach the GstControlSource 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