Klasse Object

Alle implementierten Schnittstellen:
PointerInterface

public class Object 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

https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html

  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addControlBinding

      public boolean addControlBinding(@Nonnull ControlBinding binding)
      Attach the #GstControlBinding to the object. If there already was a
      #GstControlBinding 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())
      Parameter:
      binding - the #GstControlBinding that should be used
      Gibt zurück:
      %FALSE if the given @binding has not been setup for this object or has been setup for a non suitable property, %TRUE otherwise.
    • defaultError

      public void defaultError(@Nonnull Error error, @Nullable Str debug)
      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.
      Parameter:
      error - the GError.
      debug - an additional debug information string, or %NULL
    • defaultError

      public void defaultError(@Nonnull Error error, String debug)
      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.
      Parameter:
      error - the GError.
      debug - an additional debug information string, or %NULL
    • getControlBinding

      public ControlBinding getControlBinding(@Nonnull Str property_name)
      Gets the corresponding #GstControlBinding for the property. This should be
      unreferenced again after use.
      Parameter:
      property_name - name of the property
      Gibt zurück:
      the #GstControlBinding for @property_name or %NULL if the property is not controlled.
    • getControlBinding

      public ControlBinding getControlBinding(String property_name)
      Gets the corresponding #GstControlBinding for the property. This should be
      unreferenced again after use.
      Parameter:
      property_name - name of the property
      Gibt zurück:
      the #GstControlBinding for @property_name or %NULL if the property is not controlled.
    • getControlRate

      public long 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_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.
      Gibt zurück:
      the control rate in nanoseconds
    • getName

      public Str getName()
      Returns a copy of the name of @object.
      Caller should g_free() the return value after usage.
      For a nameless object, this returns %NULL, which you can safely g_free()
      as well.

      Free-function: g_free
      Gibt zurück:
      the name of @object. g_free() after usage. MT safe. This function grabs and releases @object's LOCK.
    • getParent

      public Object getParent()
      Returns the parent of @object. This function increases the refcount
      of the parent object so you should gst_object_unref() it after usage.
      Gibt zurück:
      parent of @object, this can be %NULL if @object has no parent. unref after usage. MT safe. Grabs and releases @object's LOCK.
    • getPathString

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

      Free-function: g_free
      Gibt zurück:
      a string describing the path of @object. You must g_free() the string after usage. MT safe. Grabs and releases the #GstObject's LOCK for all objects in the hierarchy.
    • getValue

      public Value getValue(@Nonnull Str property_name, long timestamp)
      Gets the value for the given controlled property at the requested time.
      Parameter:
      property_name - the name of the property to get
      timestamp - the time the control-change should be read from
      Gibt zurück:
      the GValue of the property at the given time, or %NULL if the property isn't controlled.
    • getValue

      public Value getValue(String property_name, long timestamp)
      Gets the value for the given controlled property at the requested time.
      Parameter:
      property_name - the name of the property to get
      timestamp - the time the control-change should be read from
      Gibt zurück:
      the GValue of the property at the given time, or %NULL if the property isn't controlled.
    • getValueArray

      public boolean getValueArray(@Nonnull Str property_name, long timestamp, long interval, int n_values, @Nonnull Pointer values)
      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.
      Parameter:
      property_name - the name of the property to get
      timestamp - the time that should be processed
      interval - the time spacing between subsequent values
      n_values - the number of values
      values - array to put control-values in
      Gibt zurück:
      %TRUE if the given array could be filled, %FALSE otherwise
    • getValueArray

      public boolean getValueArray(String property_name, long timestamp, long interval, int n_values, @Nonnull Pointer values)
      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.
      Parameter:
      property_name - the name of the property to get
      timestamp - the time that should be processed
      interval - the time spacing between subsequent values
      n_values - the number of values
      values - array to put control-values in
      Gibt zurück:
      %TRUE if the given array could be filled, %FALSE otherwise
    • hasActiveControlBindings

      public boolean hasActiveControlBindings()
      Check if the @object has active controlled properties.
      Gibt zurück:
      %TRUE if the object has active controlled properties
    • hasAncestor

      @Deprecated public boolean hasAncestor(@Nonnull Object ancestor)
      Veraltet.
      Check if @object has an ancestor @ancestor somewhere up in
      the hierarchy. One can e.g. check if a #GstElement is inside a #GstPipeline.
      Parameter:
      ancestor - a #GstObject to check as ancestor
      Gibt zurück:
      %TRUE if @ancestor is an ancestor of @object.
    • hasAsAncestor

      public boolean hasAsAncestor(@Nonnull Object 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.
      Parameter:
      ancestor - a #GstObject to check as ancestor
      Gibt zurück:
      %TRUE if @ancestor is an ancestor of @object. MT safe. Grabs and releases @object's locks.
    • hasAsParent

      public boolean hasAsParent(@Nonnull Object parent)
      Check if @parent is the parent of @object.
      E.g. a #GstElement can check if it owns a given #GstPad.
      Parameter:
      parent - a #GstObject to check as parent
      Gibt zurück:
      %FALSE if either @object or @parent is %NULL. %TRUE if @parent is the parent of @object. Otherwise %FALSE. MT safe. Grabs and releases @object's locks.
    • ref

      public Pointer ref()
      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);
      Setzt außer Kraft:
      ref in Klasse Object
      Gibt zurück:
      A pointer to @object
    • removeControlBinding

      public boolean removeControlBinding(@Nonnull ControlBinding binding)
      Removes the corresponding #GstControlBinding. If it was the
      last ref of the binding, it will be disposed.
      Parameter:
      binding - the binding
      Gibt zurück:
      %TRUE if the binding could be removed.
    • setControlBindingDisabled

      public void setControlBindingDisabled(@Nonnull Str property_name, boolean disabled)
      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.
      Parameter:
      property_name - property to disable
      disabled - boolean that specifies whether to disable the controller or not.
    • setControlBindingDisabled

      public void setControlBindingDisabled(String property_name, boolean disabled)
      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.
      Parameter:
      property_name - property to disable
      disabled - boolean that specifies whether to disable the controller or not.
    • setControlBindingsDisabled

      public void setControlBindingsDisabled(boolean disabled)
      This function is used to disable all controlled properties of the @object for
      some time, i.e. gst_object_sync_values() will do nothing.
      Parameter:
      disabled - boolean that specifies whether to disable the controller or not.
    • setControlRate

      public void setControlRate(long control_rate)
      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_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.
      Parameter:
      control_rate - the new control-rate in nanoseconds.
    • setName

      public boolean setName(@Nullable Str name)
      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.
      Parameter:
      name - new name of object
      Gibt zurück:
      %TRUE if the name could be set. Since Objects that have a parent cannot be renamed, this function returns %FALSE in those cases. MT safe. This function grabs and releases @object's LOCK.
    • setName

      public boolean setName(String name)
      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.
      Parameter:
      name - new name of object
      Gibt zurück:
      %TRUE if the name could be set. Since Objects that have a parent cannot be renamed, this function returns %FALSE in those cases. MT safe. This function grabs and releases @object's LOCK.
    • setParent

      public boolean setParent(@Nonnull Object 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_ref_sink()).
      Parameter:
      parent - new parent of object
      Gibt zurück:
      %TRUE if @parent could be set or %FALSE when @object already had a parent or @object and @parent are the same. MT safe. Grabs and releases @object's LOCK.
    • suggestNextSync

      public long suggestNextSync()
      Returns a suggestion for timestamps where buffers should be split
      to get best controller results.
      Gibt zurück:
      Returns the suggested timestamp or %GST_CLOCK_TIME_NONE if no control-rate was set.
    • syncValues

      public boolean syncValues(long timestamp)
      Sets the properties of the object, according to the #GstControlSources 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.
      Parameter:
      timestamp - the time that should be processed
      Gibt zurück:
      %TRUE if the controller values could be applied to the object properties, %FALSE otherwise
    • unparent

      public void unparent()
      Clear the parent of @object, removing the associated reference.
      This function decreases the refcount of @object.

      MT safe. Grabs and releases @object's lock.
    • unref

      public void unref()
      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.
      Setzt außer Kraft:
      unref in Klasse Object
    • onDeepNotify

      public SignalHandler onDeepNotify(Object.OnDeepNotify signal)
      Connect to signal "deep-notify".
      See Object.OnDeepNotify.onDeepNotify(ch.bailu.gtk.gst.Object, ch.bailu.gtk.gobject.ParamSpec) for signal description.
      Field SIGNAL_ON_DEEP_NOTIFY contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • checkUniqueness

      public static boolean checkUniqueness(@Nonnull List list, @Nonnull Str 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 function
      will lock each #GstObject in the list to compare the name, so be
      careful when passing a list with a locked object.
      Parameter:
      list - a list of #GstObject to check through
      name - the name to search for
      Gibt zurück:
      %TRUE if a #GstObject named @name does not appear in @list, %FALSE if it does. MT safe. Grabs and releases the LOCK of each object in the list.
    • refSink

      public static Pointer refSink(@Nullable Pointer object)
      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.
      Parameter:
      object - a #GstObject to sink
      Gibt zurück:
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()