Object provides a root for the object hierarchy tree filed in by the GStreamer library.
It is currently a thin wrapper on top of 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 Object (e.g. @ref
becomes @ref).
Since Object derives from InitiallyUnowned
, it also inherits the floating reference. Be aware that functions such as add
and add_pad take ownership of the floating reference.
In contrast to Object instances, Object adds a
name property. The functions set_name and
get_name are used to set/get the name of the object.
typeof (unichar2)
typeof (unichar2)
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 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
- public unowned Object @ref ()
Increments the reference count on this.
- public bool add_control_binding (ControlBinding binding)
- public void default_error (Error error, string? debug)
A default error function that uses
printerr to display the error message and the optional debug string.
- public ControlBinding? get_control_binding (string property_name)
- public ClockTime get_control_rate ()
Obtain the control-rate for this this.
- public bool get_g_value_array (string property_name, ClockTime timestamp, ClockTime interval, Value[] values)
Gets a number of Value
s for the given controlled property starting at the requested time.
- public string? get_name ()
Returns a copy of the name of this.
- public Object? get_parent ()
Returns the parent of this.
- public string get_path_string ()
Generates a string describing the path of this
in the object hierarchy.
- public Value? get_value (string property_name, ClockTime timestamp)
Gets the value for the given controlled property at the requested time.
- public bool has_active_control_bindings ()
Check if the this has active controlled
properties.
- public bool has_ancestor (Object ancestor)
Check if this has an ancestor
ancestor
somewhere up in the hierarchy.
- public bool has_as_ancestor (Object ancestor)
Check if this has an ancestor
ancestor
somewhere up in the hierarchy.
- public bool has_as_parent (Object parent)
Check if parent
is the parent of
this.
- public bool remove_control_binding (ControlBinding binding)
- public void set_control_binding_disabled (string property_name, bool disabled)
This function is used to disable the control bindings on a property for some
time, i.e. sync_values will do nothing for the property.
- public void set_control_bindings_disabled (bool disabled)
This function is used to disable all controlled properties of the
this for some time, i.e. sync_values
will do nothing.
- public void set_control_rate (ClockTime control_rate)
Change the control-rate for this this.
- public bool set_name (string? name)
Sets the name of this, or gives
this a guaranteed unique name (if name
is null
).
- public bool set_parent (Object parent)
Sets the parent of this to parent
.
- public ClockTime suggest_next_sync ()
Returns a suggestion for timestamps where buffers should be split to get
best controller results.
- public bool sync_values (ClockTime timestamp)
Sets the properties of the object, according to the
ControlSources that (maybe) handle them and for the given
timestamp.
- public void unparent ()
Clear the parent of this, removing the
associated reference.
- public void unref ()
Decrements the reference count on this.