Package ch.bailu.gtk.gst
Klasse Object
- Alle implementierten Schnittstellen:
PointerInterface
#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
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
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
addControlBinding
(ControlBinding binding) Attach the #GstControlBinding to the object.static boolean
checkUniqueness
(List list, Str name) Checks to see if there is any object named @name in @list.void
defaultError
(Error error, Str debug) A default error function that uses g_printerr() to display the error message
and the optional debug string..void
defaultError
(Error error, String debug) A default error function that uses g_printerr() to display the error message
and the optional debug string..static ClassHandler
getControlBinding
(Str property_name) Gets the corresponding #GstControlBinding for the property.getControlBinding
(String property_name) Gets the corresponding #GstControlBinding for the property.long
Obtain the control-rate for this @object.static int
getName()
Returns a copy of the name of @object.Returns the parent of @object.static long
static TypeSystem.TypeSize
Generates a string describing the path of @object in
the object hierarchy.static long
static TypeSystem.TypeSize
Gets the value for the given controlled property at the requested time.Gets the value for the given controlled property at the requested time.boolean
getValueArray
(Str property_name, long timestamp, long interval, int n_values, Pointer values) Gets a number of values for the given controlled property starting at the
requested time.boolean
getValueArray
(String property_name, long timestamp, long interval, int n_values, Pointer values) Gets a number of values for the given controlled property starting at the
requested time.boolean
Check if the @object has active controlled properties.boolean
hasAncestor
(Object ancestor) Veraltet.boolean
hasAsAncestor
(Object ancestor) Check if @object has an ancestor @ancestor somewhere up in
the hierarchy.boolean
hasAsParent
(Object parent) Check if @parent is the parent of @object.onDeepNotify
(Object.OnDeepNotify signal) Connect to signal "deep-notify".ref()
Increments the reference count on @object.static Pointer
Increase the reference count of @object, and possibly remove the floating
reference, if @object has a floating reference.boolean
removeControlBinding
(ControlBinding binding) Removes the corresponding #GstControlBinding.void
setControlBindingDisabled
(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.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.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.void
setControlRate
(long control_rate) Change the control-rate for this @object.boolean
Sets the name of @object, or gives @object a guaranteed unique
name (if @name is %NULL).boolean
Sets the name of @object, or gives @object a guaranteed unique
name (if @name is %NULL).boolean
Sets the parent of @object to @parent.long
Returns a suggestion for timestamps where buffers should be split
to get best controller results.boolean
syncValues
(long 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.void
unref()
Decrements the reference count on @object.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_DEEP_NOTIFY
- Siehe auch:
-
-
Konstruktordetails
-
Object
-
-
Methodendetails
-
getClassHandler
-
addControlBinding
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
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
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
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
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
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
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
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
Gets the value for the given controlled property at the requested time.- Parameter:
property_name
- the name of the property to gettimestamp
- 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
Gets the value for the given controlled property at the requested time.- Parameter:
property_name
- the name of the property to gettimestamp
- 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 gettimestamp
- the time that should be processedinterval
- the time spacing between subsequent valuesn_values
- the number of valuesvalues
- 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 gettimestamp
- the time that should be processedinterval
- the time spacing between subsequent valuesn_values
- the number of valuesvalues
- 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
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
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
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
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); -
removeControlBinding
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
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 disabledisabled
- boolean that specifies whether to disable the controller or not.
-
setControlBindingDisabled
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 disabledisabled
- 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
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
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
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. -
onDeepNotify
Connect to signal "deep-notify".
SeeObject.OnDeepNotify.onDeepNotify(ch.bailu.gtk.gst.Object, ch.bailu.gtk.gobject.ParamSpec)
for signal description.
FieldSIGNAL_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
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 throughname
- 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
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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-