Class: Gst::Object

Inherits:
GObject::InitiallyUnowned
  • Object
show all
Defined in:
(unknown)

Overview

GStreamer base object class.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check_uniqueness(list, name) ⇒ Boolean

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::Object in the list to compare the name, so be careful when passing a list with a locked object. false if it does.

MT safe. Grabs and releases the LOCK of each object in the list.

Parameters:

  • list (GLib::List<Gst::Object>)

    a list of Gst::Object to check through

  • name (String)

    the name to search for

Returns:

  • (Boolean)

    true if a Gst::Object named name does not appear in list,

.default_deep_notify(object, orig, pspec, excluded_props) ⇒ nil

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.

Parameters:

  • object (GObject::Object)

    the #GObject that signalled the notify.

  • orig (Gst::Object)

    a Gst::Object that initiated the notify.

  • pspec (GObject::ParamSpec)

    a GParam::Spec of the property.

  • excluded_props (Array<String>)

    a set of user-specified properties to exclude or nil to show all changes.

Returns:

  • (nil)

.ref_sink(object) ⇒ GObject

Increase the reference count of object, and possibly remove the floating reference, if object has a floating reference.

In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

For more background on "floating references" please see the #GObject documentation.

Parameters:

  • object (GObject)

    a Gst::Object to sink

Returns:

  • (GObject)

.replace(oldobj, newobj) ⇒ Boolean

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 nil.

Parameters:

  • oldobj (Gst::Object)

    pointer to a place of a Gst::Object to replace

  • newobj (Gst::Object)

    a new Gst::Object

Returns:

  • (Boolean)

    true if newobj was different from oldobj

Instance Method Details

#add_control_binding(binding) ⇒ Boolean

Attach the Gst::ControlBinding to the object. If there already was a Gst::ControlBinding for 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()) has been setup for a non suitable property, true otherwise.

Parameters:

Returns:

  • (Boolean)

    false if the given binding has not been setup for this object or

#control_bindings_disabled=(disabled) ⇒ nil

This function is used to disable all controlled properties of the object for some time, i.e. gst_object_sync_values() will do nothing. or not.

Parameters:

  • disabled (Boolean)

    boolean that specifies whether to disable the controller

Returns:

  • (nil)

#control_rateGst::ClockTime

Obtain the control-rate for this object. Audio processing Gst::Element objects 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 object 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_PAUSED or %GST_STATE_PLAYING.

Returns:

  • (Gst::ClockTime)

    the control rate in nanoseconds

#control_rate=(control_rate) ⇒ nil

Change the control-rate for this object. Audio processing Gst::Element objects 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_PAUSED or %GST_STATE_PLAYING.

Parameters:

  • control_rate (Gst::ClockTime)

    the new control-rate in nanoseconds.

Returns:

  • (nil)

#default_error(error, debug) ⇒ nil

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.

Parameters:

  • error (GLib::Error)

    the GError.

  • debug (String)

    an additional debug information string, or nil

Returns:

  • (nil)

#get_control_binding(property_name) ⇒ Gst::ControlBinding

Gets the corresponding Gst::ControlBinding for the property. This should be unreferenced again after use. property_name or nil if the property is not controlled.

Parameters:

  • property_name (String)

    name of the property

Returns:

#get_g_value_array(property_name, timestamp, interval, n_values, values) ⇒ Boolean

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.

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.

Parameters:

  • property_name (String)

    the name of the property to get

  • timestamp (Gst::ClockTime)

    the time that should be processed

  • interval (Gst::ClockTime)

    the time spacing between subsequent values

  • n_values (Integer)

    the number of values

  • values (Array<GObject::Value>)

    array to put control-values in

Returns:

  • (Boolean)

    true if the given array could be filled, false otherwise

#get_value(property_name, timestamp) ⇒ GObject::Value

Gets the value for the given controlled property at the requested time. or nil if the property isn't controlled.

Parameters:

  • property_name (String)

    the name of the property to get

  • timestamp (Gst::ClockTime)

    the time the control-change should be read from

Returns:

  • (GObject::Value)

    the GValue of the property at the given time,

#get_value_array(property_name, timestamp, interval, n_values, values) ⇒ Boolean

Gets a number of values for the given controlled property starting at the requested time. The array values need to hold enough space for n_values of the same type as the objects property's type.

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.

The values are unboxed and ready to be used. The similar function gst_object_get_g_value_array() returns the array as #GValues and is better suites for bindings.

Parameters:

  • property_name (String)

    the name of the property to get

  • timestamp (Gst::ClockTime)

    the time that should be processed

  • interval (Gst::ClockTime)

    the time spacing between subsequent values

  • n_values (Integer)

    the number of values

  • values (Array<GObject>)

    array to put control-values in

Returns:

  • (Boolean)

    true if the given array could be filled, false otherwise

#has_active_control_bindingsBoolean

Check if the object has active controlled properties.

Returns:

  • (Boolean)

    true if the object has active controlled properties

#has_ancestor(ancestor) ⇒ Boolean

Check if object has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a Gst::Element is inside a #GstPipeline.

Parameters:

  • ancestor (Gst::Object)

    a Gst::Object to check as ancestor

Returns:

  • (Boolean)

    true if ancestor is an ancestor of object.

#has_as_ancestor(ancestor) ⇒ Boolean

Check if object has an ancestor ancestor somewhere up in the hierarchy. One can e.g. check if a Gst::Element is inside a #GstPipeline. MT safe. Grabs and releases object's locks.

Parameters:

  • ancestor (Gst::Object)

    a Gst::Object to check as ancestor

Returns:

  • (Boolean)

    true if ancestor is an ancestor of object.

#has_as_parent(parent) ⇒ Boolean

Check if parent is the parent of object. E.g. a Gst::Element can check if it owns a given #GstPad. MT safe. Grabs and releases object's locks.

Parameters:

  • parent (Gst::Object)

    a Gst::Object to check as parent

Returns:

  • (Boolean)

    false if either object or parent is nil. true if parent is the parent of object. Otherwise false.

#nameString

Returns name.

Returns:

  • (String)

    name

#name=(name) ⇒ String

Parameters:

  • name (String)

Returns:

  • (String)

    name

  • (String)

    name

#parentGst::Object

The parent of the object. Please note, that when changing the 'parent' property, we don't emit #GObject::notify and Gst::Object::deep-notify signals due to locking issues. In some cases one can use Gst::Bin::element-added or #GstBin::element-removed signals on the parent to achieve a similar effect.

Returns:

#parent=(parent) ⇒ Gst::Object

The parent of the object. Please note, that when changing the 'parent' property, we don't emit #GObject::notify and Gst::Object::deep-notify signals due to locking issues. In some cases one can use Gst::Bin::element-added or #GstBin::element-removed signals on the parent to achieve a similar effect.

Parameters:

Returns:

#path_stringString

Generates a string describing the path of object in the object hierarchy. Only useful (or used) for debugging.

Free-function: g_free MT safe. Grabs and releases the Gst::Object's LOCK for all objects in the hierarchy.

Returns:

  • (String)

    a string describing the path of object. You must g_free() the string after usage.

#refGst::Object

Increments the reference count on object. This function does not take the lock on object because it relies on atomic refcounting.

This object returns the input parameter to ease writing constructs like : result = gst_object_ref (object->parent);

Returns:

#remove_control_binding(binding) ⇒ Boolean

Removes the corresponding Gst::ControlBinding. If it was the last ref of the binding, it will be disposed.

Parameters:

Returns:

  • (Boolean)

    true if the binding could be removed.

#set_control_binding_disabled(property_name, disabled) ⇒ nil

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. or not.

Parameters:

  • property_name (String)

    property to disable

  • disabled (Boolean)

    boolean that specifies whether to disable the controller

Returns:

  • (nil)

#suggest_next_syncGst::ClockTime

Returns a suggestion for timestamps where buffers should be split to get best controller results. if no control-rate was set.

Returns:

  • (Gst::ClockTime)

    Returns the suggested timestamp or %GST_CLOCK_TIME_NONE

#sync_values(timestamp) ⇒ Boolean

Sets the properties of the object, according to the Gst::ControlSources that (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. properties, false otherwise

Parameters:

  • timestamp (Gst::ClockTime)

    the time that should be processed

Returns:

  • (Boolean)

    true if the controller values could be applied to the object

#unparentnil

Clear the parent of object, removing the associated reference. This function decreases the refcount of object.

MT safe. Grabs and releases object's lock.

Returns:

  • (nil)

#unrefnil

Decrements the reference count on object. If reference count hits zero, destroy object. This function does not take the lock on object as it relies on atomic refcounting.

The unref method should never be called with the LOCK held since this might deadlock the dispose function.

Returns:

  • (nil)