gst.object

Module for [ObjectWrap] class

Types 3

#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. [gobject.object.ObjectWrap.ref_] becomes [gst.object.ObjectWrap.ref_]).

Since #GstObject derives from #GInitiallyUnowned, it also inherits the floating reference. Be aware that functions such as [gst.bin.Bin.add] and [gst.element.Element.addPad] take ownership of the floating reference.

In contrast to #GObject instances, #GstObject adds a name property. The functions [gst.object.ObjectWrap.setName] and [gst.object.ObjectWrap.getName] 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
Methods
GType _gType() @property
ObjectWrap self()Returns `this`, for use in `with` statements.
ObjectWrapGidBuilder builder()Get builder for [gst.object.ObjectWrap] Returns: New builder object
string name() @property
void name(string propval) @property
gst.object.ObjectWrap parent() @propertyGet `parent` property. Returns: The parent of the object. Please note, that when changing the 'parent' property, we don't emit #GObject::notify and #GstObject::deep-notify signals due to locking is...
void parent(gst.object.ObjectWrap propval) @propertySet `parent` property. Params: propval = The parent of the object. Please note, that when changing the 'parent' property, we don't emit #GObject::notify and #GstObject::deep-notify signals due to l...
bool checkUniqueness(gst.object.ObjectWrap[] list, string name)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 ...
void defaultDeepNotify(gobject.object.ObjectWrap object, gst.object.ObjectWrap orig, gobject.param_spec.ParamSpec pspec, string[] excludedProps = null)A default deepnotify signal callback for an object. The user data should contain a pointer to an array of strings that should be excluded from the notify. The default handler will print the new val...
bool replace(gst.object.ObjectWrap oldobj = null, gst.object.ObjectWrap newobj = null)Atomically modifies a pointer to point to a new object. The reference count of oldobj is decreased and the reference count of newobj is increased.
bool addControlBinding(gst.control_binding.ControlBinding binding)Attach the #GstControlBinding to the object. If there already was a #GstControlBinding for this property it will be replaced.
void defaultError(glib.error.ErrorWrap error, string debug_ = null)A default error function that uses [glib.global.printerr] to display the error message and the optional debug string..
gst.control_binding.ControlBinding getControlBinding(string propertyName)Gets the corresponding #GstControlBinding for the property. This should be unreferenced again after use.
gst.types.ClockTime getControlRate()Obtain the control-rate for this object. Audio processing #GstElement objects will use this rate to sub-divide their processing loop and call [gst.object.ObjectWrap.syncValues] in between. The leng...
bool getGValueArray(string propertyName, gst.types.ClockTime timestamp, gst.types.ClockTime interval, gobject.value.Value[] values)Gets a number of #GValues for the given controlled property starting at the requested time. The array values need to hold enough space for n_values of #GValue.
string getName()Returns a copy of the name of object. Caller should [glib.global.gfree] the return value after usage. For a nameless object, this returns null, which you can safely [glib.global.gfree] as well.
gst.object.ObjectWrap getParent()Returns the parent of object. This function increases the refcount of the parent object so you should [gst.object.ObjectWrap.unref] it after usage. Returns: parent of object, this can be null if ob...
string getPathString()Generates a string describing the path of object in the object hierarchy. Only useful (or used) for debugging.
gobject.value.Value getValue(string propertyName, gst.types.ClockTime timestamp)Gets the value for the given controlled property at the requested time.
bool hasActiveControlBindings()Check if the object has active controlled properties. Returns: true if the object has active controlled properties
bool hasAncestor(gst.object.ObjectWrap ancestor)Check if object has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
bool hasAsAncestor(gst.object.ObjectWrap ancestor)Check if object has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
bool hasAsParent(gst.object.ObjectWrap parent)Check if parent is the parent of object. E.g. a #GstElement can check if it owns a given #GstPad.
bool removeControlBinding(gst.control_binding.ControlBinding binding)Removes the corresponding #GstControlBinding. If it was the last ref of the binding, it will be disposed.
void setControlBindingDisabled(string propertyName, bool disabled)This function is used to disable the control bindings on a property for some time, i.e. [gst.object.ObjectWrap.syncValues] will do nothing for the property.
void setControlBindingsDisabled(bool disabled)This function is used to disable all controlled properties of the object for some time, i.e. [gst.object.ObjectWrap.syncValues] will do nothing.
void setControlRate(gst.types.ClockTime controlRate)Change the control-rate for this object. Audio processing #GstElement objects will use this rate to sub-divide their processing loop and call [gst.object.ObjectWrap.syncValues] in between. The leng...
bool setName(string name = null)Sets the name of object, or gives object a guaranteed unique name (if name is null). This function makes a copy of the provided name, so the caller retains ownership of the name it sent.
bool setParent(gst.object.ObjectWrap parent)Sets the parent of object to parent. The object's reference count will be incremented, and any floating reference will be removed (see [gst.object.ObjectWrap.refSink]).
gst.types.ClockTime suggestNextSync()Returns a suggestion for timestamps where buffers should be split to get best controller results. Returns: Returns the suggested timestamp or [gst.types.CLOCKTIMENONE] if no control-rate was set.
bool syncValues(gst.types.ClockTime timestamp)Sets the properties of the object, according to the #GstControlSources that (maybe) handle them and for the given timestamp.
void unparent()Clear the parent of object, removing the associated reference. This function decreases the refcount of object.
gulong connectDeepNotify(T)(string detail = null, T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gst.object.ObjectWrap))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gobject.param_spec.ParamSpec))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gst.object.ObjectWrap))) && Parameters!T.length < 4)Connect to `DeepNotify` signal.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T name(string propval)
T parent(gst.object.ObjectWrap propval)Set `parent` property. Params: propval = The parent of the object. Please note, that when changing the 'parent' property, we don't emit #GObject::notify and #GstObject::deep-notify signals due to l...

Fluent builder for [gst.object.ObjectWrap]

Methods