Gst.Object¶
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | check_uniqueness(list, name) | 
| class | default_deep_notify(object, orig, pspec, excluded_props) | 
| class | replace(oldobj, newobj) | 
| add_control_binding(binding) | |
| default_error(error, debug) | |
| get_control_binding(property_name) | |
| get_control_rate() | |
| get_g_value_array(property_name, timestamp, interval, values) | |
| get_name() | |
| get_parent() | |
| get_path_string() | |
| get_value(property_name, timestamp) | |
| has_active_control_bindings() | |
| has_ancestor(ancestor) | |
| has_as_ancestor(ancestor) | |
| has_as_parent(parent) | |
| ref() | |
| remove_control_binding(binding) | |
| set_control_binding_disabled(property_name, disabled) | |
| set_control_bindings_disabled(disabled) | |
| set_control_rate(control_rate) | |
| set_name(name) | |
| set_parent(parent) | |
| suggest_next_sync() | |
| sync_values(timestamp) | |
| unparent() | |
| unref() | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| name | str | r/w/c | The name of the object | 
| parent | Gst.Object | r/w | The parent of the object | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| deep-notify | The deep notify signal is used to be notified of property changes. | 
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| control_bindings | [ object] | r | |
| control_rate | int | r | |
| flags | int | r | flags for this object | 
| last_sync | int | r | |
| lock | GLib.Mutex | r | object LOCK | 
| name | str | r | The name of the object | 
| object | GObject.InitiallyUnowned | r | |
| parent | Gst.Object | r | this object’s parent, weak ref | 
Class Details¶
- 
class Gst.Object(**kwargs)¶
- Bases: - GObject.InitiallyUnowned- Abstract: - Yes - Structure: - Gst.ObjectClass- Gst.Objectprovides 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.- Gst.Objectgives 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- Gst.Objectwhich is- GObject.Object(e.g.- GObject.Object.ref() becomes- Gst.Object.ref()).- Since - Gst.Objectderives from- GObject.InitiallyUnowned, 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.Objectinstances,- Gst.Objectadds 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 - Gst.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 allGObject.Objectproperties 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 Gst.ControlSource. csource = gst_interpolation_control_source_new (); g_object_set (csource, “mode”, GST_INTERPOLATION_MODE_LINEAR,None);
- Attach the Gst.ControlSourceon 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
 - 
classmethod check_uniqueness(list, name)[source]¶
- Parameters: - list ([Gst.Object]) – a list ofGst.Objectto check through
- name (str) – the name to search for
 - Returns: - Trueif a- Gst.Objectnamed name does not appear in list,- Falseif it does.- MT safe. Grabs and releases the LOCK of each object in the list. - Return type: - 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 - Gst.Objectin the list to compare the name, so be careful when passing a list with a locked object.
- list ([
 - 
classmethod default_deep_notify(object, orig, pspec, excluded_props)[source]¶
- Parameters: - object (GObject.Object) – theGObject.Objectthat signalled the notify.
- orig (Gst.Object) – aGst.Objectthat initiated the notify.
- pspec (GObject.ParamSpec) – aGObject.ParamSpecof the property.
- excluded_props ([str] orNone) – a set of user-specified properties to exclude orNoneto show all changes.
 - A default deep_notify 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 value of the property using g_print. - MT safe. This function grabs and releases object’s LOCK for getting its path string. 
- object (
 - 
classmethod replace(oldobj, newobj)[source]¶
- Parameters: - oldobj (Gst.ObjectorNone) – pointer to a place of aGst.Objectto replace
- newobj (Gst.ObjectorNone) – a newGst.Object
 - Returns: - Trueif newobj was different from oldobj- oldobj: - pointer to a place of a - Gst.Objectto replace- Return type: - ( - bool, oldobj:- Gst.Objector- None)- 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. - Either newobj and the value pointed to by oldobj may be - None.
- oldobj (
 - 
add_control_binding(binding)[source]¶
- Parameters: - binding ( - Gst.ControlBinding) – the- Gst.ControlBindingthat should be used- Returns: - Falseif the given binding has not been setup for this object or has been setup for a non suitable property,- Trueotherwise.- Return type: - bool- Attach the - Gst.ControlBindingto the object. If there already was a- Gst.ControlBindingfor this property it will be replaced.- The object’s reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink()) 
 - 
default_error(error, debug)[source]¶
- Parameters: - error (GLib.Error) – theGLib.Error.
- debug (strorNone) – an additional debug information string, orNone
 - A default error function that uses g_printerr() to display the error message and the optional debug string.. - The default handler will simply print the error string using g_print. 
- error (
 - 
get_control_binding(property_name)[source]¶
- Parameters: - property_name ( - str) – name of the property- Returns: - the - Gst.ControlBindingfor property_name or- Noneif the property is not controlled.- Return type: - Gst.ControlBindingor- None- Gets the corresponding - Gst.ControlBindingfor the property. This should be unreferenced again after use.
 - 
get_control_rate()[source]¶
- Returns: - the control rate in nanoseconds - Return type: - int- Obtain the control-rate for this self. Audio processing - Gst.Elementobjects will use this rate to sub-divide their processing loop and call- Gst.Object.sync_values() in between. The length of the processing segment should be up to control-rate nanoseconds.- If the self is not under property control, this will return - Gst.CLOCK_TIME_NONE. This allows the element to avoid the sub-dividing.- The control-rate is not expected to change if the element is in - Gst.State.PAUSEDor- Gst.State.PLAYING.
 - 
get_g_value_array(property_name, timestamp, interval, values)[source]¶
- Parameters: - property_name (str) – the name of the property to get
- timestamp (int) – the time that should be processed
- interval (int) – the time spacing between subsequent values
- values ([GObject.Value]) – array to put control-values in
 - Returns: - Return type: - Gets a number of - GObject.Valuesfor the given controlled property starting at the requested time. The array values need to hold enough space for n_values of- GObject.Value.- This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample. 
- property_name (
 - 
get_name()[source]¶
- Returns: - the name of self. - GLib.free() after usage.- MT safe. This function grabs and releases self’s LOCK. - Return type: - stror- None- Returns a copy of the name of self. Caller should - GLib.free() the return value after usage. For a nameless object, this returns- None, which you can safely- GLib.free() as well.- Free-function: - GLib.free
 - 
get_parent()[source]¶
- Returns: - parent of self, this can be - Noneif self has no parent. unref after usage.- MT safe. Grabs and releases self’s LOCK. - Return type: - Gst.Objector- None- Returns the parent of self. This function increases the refcount of the parent object so you should - Gst.Object.unref() it after usage.
 - 
get_path_string()[source]¶
- Returns: - a string describing the path of self. You must - GLib.free() the string after usage.- MT safe. Grabs and releases the - Gst.Object’s LOCK for all objects in the hierarchy.- Return type: - str- Generates a string describing the path of self in the object hierarchy. Only useful (or used) for debugging. - Free-function: - GLib.free
 - 
get_value(property_name, timestamp)[source]¶
- Parameters: - Returns: - the - GObject.Valueof the property at the given time, or- Noneif the property isn’t controlled.- Return type: - Gets the value for the given controlled property at the requested time. 
 - 
has_active_control_bindings()[source]¶
- Returns: - Trueif the object has active controlled properties- Return type: - bool- Check if the self has active controlled properties. 
 - 
has_ancestor(ancestor)[source]¶
- Parameters: - ancestor ( - Gst.Object) – a- Gst.Objectto check as ancestor- Returns: - Trueif ancestor is an ancestor of self.- Return type: - bool- Check if self has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a - Gst.Elementis inside a- Gst.Pipeline.- Deprecated since version ???: Use - Gst.Object.has_as_ancestor() instead. MT safe. Grabs and releases object’s locks.
 - 
has_as_ancestor(ancestor)[source]¶
- Parameters: - ancestor ( - Gst.Object) – a- Gst.Objectto check as ancestor- Returns: - Trueif ancestor is an ancestor of self.- MT safe. Grabs and releases self’s locks. - Return type: - bool- Check if self has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a - Gst.Elementis inside a- Gst.Pipeline.
 - 
has_as_parent(parent)[source]¶
- Parameters: - parent ( - Gst.Object) – a- Gst.Objectto check as parent- Returns: - Falseif either self or parent is- None.- Trueif parent is the parent of self. Otherwise- False.- MT safe. Grabs and releases self’s locks. - Return type: - bool- Check if parent is the parent of self. E.g. a - Gst.Elementcan check if it owns a given- Gst.Pad.- New in version 1.6. 
 - 
ref()[source]¶
- Returns: - A pointer to self - Return type: - Gst.Object- Increments the reference count on self. This function does not take the lock on self because it relies on atomic refcounting. - This object returns the input parameter to ease writing constructs like : result = - Gst.Object.ref(object->parent);
 - 
remove_control_binding(binding)[source]¶
- Parameters: - binding ( - Gst.ControlBinding) – the binding- Returns: - Trueif the binding could be removed.- Return type: - bool- Removes the corresponding - Gst.ControlBinding. If it was the last ref of the binding, it will be disposed.
 - 
set_control_binding_disabled(property_name, disabled)[source]¶
- Parameters: - This function is used to disable the control bindings on a property for some time, i.e. - Gst.Object.sync_values() will do nothing for the property.
 - 
set_control_bindings_disabled(disabled)[source]¶
- Parameters: - disabled ( - bool) – boolean that specifies whether to disable the controller or not.- This function is used to disable all controlled properties of the self for some time, i.e. - Gst.Object.sync_values() will do nothing.
 - 
set_control_rate(control_rate)[source]¶
- Parameters: - control_rate ( - int) – the new control-rate in nanoseconds.- Change the control-rate for this self. Audio processing - Gst.Elementobjects will use this rate to sub-divide their processing loop and call- Gst.Object.sync_values() in between. The length of the processing segment should be up to control-rate nanoseconds.- The control-rate should not change if the element is in - Gst.State.PAUSEDor- Gst.State.PLAYING.
 - 
set_name(name)[source]¶
- Parameters: - name ( - stror- None) – new name of object- Returns: - Trueif the name could be set. Since Objects that have a parent cannot be renamed, this function returns- Falsein those cases.- MT safe. This function grabs and releases self’s LOCK. - Return type: - bool- Sets the name of self, or gives self a guaranteed unique name (if name is - None). This function makes a copy of the provided name, so the caller retains ownership of the name it sent.
 - 
set_parent(parent)[source]¶
- Parameters: - parent ( - Gst.Object) – new parent of object- Returns: - Trueif parent could be set or- Falsewhen self already had a parent or self and parent are the same.- MT safe. Grabs and releases self’s LOCK. - Return type: - bool- Sets the parent of self to parent. The object’s reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink()). 
 - 
suggest_next_sync()[source]¶
- Returns: - Returns the suggested timestamp or - Gst.CLOCK_TIME_NONEif no control-rate was set.- Return type: - int- Returns a suggestion for timestamps where buffers should be split to get best controller results. 
 - 
sync_values(timestamp)[source]¶
- Parameters: - timestamp ( - int) – the time that should be processed- Returns: - Trueif the controller values could be applied to the object properties,- Falseotherwise- Return type: - bool- Sets the properties of the object, according to the - Gst.ControlSourcesthat (maybe) handle them and for the given timestamp.- If this function fails, it is most likely the application developers fault. Most probably the control sources are not setup correctly. 
 - 
unparent()[source]¶
- Clear the parent of self, removing the associated reference. This function decreases the refcount of self. - MT safe. Grabs and releases self’s lock. 
 - 
unref()[source]¶
- Decrements the reference count on self. If reference count hits zero, destroy self. This function does not take the lock on self as it relies on atomic refcounting. - The unref method should never be called with the LOCK held since this might deadlock the dispose function. 
 - 
do_deep_notify(orig, pspec) virtual¶
- Parameters: - orig (Gst.Object) –
- pspec (GObject.ParamSpec) –
 
- orig (
 
Signal Details¶
- 
Gst.Object.signals.deep_notify(object, prop_object, prop)¶
- Signal Name: - deep-notify- Flags: - Parameters: - object (Gst.Object) – The object which received the signal
- prop_object (Gst.Object) – the object that originated the signal
- prop (GObject.ParamSpec) – the property that changed
 - 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. 
- object (
Property Details¶
- 
Gst.Object.props.name¶
- Name: - name- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The name of the object 
- 
Gst.Object.props.parent¶
- Name: - parent- Type: - Gst.Object- Default Value: - None- Flags: - READABLE,- WRITABLE- The parent of the object. Please note, that when changing the ‘parent’ property, we don’t emit - GObject.Object- ::notifyand- Gst.Object- ::deep-notifysignals due to locking issues. In some cases one can use- Gst.Bin- ::element-addedor- Gst.Bin- ::element-removedsignals on the parent to achieve a similar effect.