The #GstControlSource is a base class for control value sources that could
be used by #GstController to get timestamp-value pairs.
A #GstControlSource is used by first getting an instance, binding it to a
#GParamSpec (for example by using gst_controller_set_control_source()) and
then by having it used by the #GstController or calling
gst_control_source_get_value() or gst_control_source_get_value_array().
For implementing a new #GstControlSource one has to implement a
#GstControlSourceBind method, which will depending on the #GParamSpec set up
the control source for use and sets the #GstControlSourceGetValue and
#GstControlSourceGetValueArray functions. These are then used by
gst_control_source_get_value() or gst_control_source_get_value_array()
to get values for specific timestamps.
Binds a #GstControlSource to a specific property. This must be called only once for a
#GstControlSource.
%TRUE if the #GstControlSource was bound correctly, %FALSE otherwise.
#GParamSpec for the property for which this #GstControlSource should generate values.
Gets the value for this #GstControlSource at a given timestamp.
FALSE if the value couldn't be returned, TRUE otherwise.
the time for which the value should be returned
the value
Gets an array of values for one element property.
All fields of @value_array must be filled correctly. Especially the
of values.
The type of the values in the array is the same as the property's type.
%TRUE if the given array could be filled, %FALSE otherwise
the time that should be processed
array to put control-values in
Function for binding a #GstControlSource to a #GParamSpec.
%TRUE if the property could be bound to the #GstControlSource, %FALSE otherwise.
the #GstControlSource instance
#GParamSpec that should be bound to
The class structure of #GstControlSource.
Function for returning a value for a given timestamp.
%TRUE if the value was successfully calculated.
the #GstControlSource instance
timestamp for which a value should be calculated
a #GValue which will be set to the result. It must be initialized to the correct type.
Function for returning a #GstValueArray for a given timestamp.
%TRUE if the values were successfully calculated.
the #GstControlSource instance
timestamp for which a value should be calculated
array to put control-values in
The controller subsystem 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 continously pull
values 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!
<orderedlist>
<listitem><para>
mark gobject-properties paramspecs that make sense to be controlled,
by GST_PARAM_CONTROLLABLE.
</para></listitem>
<listitem><para>
when processing data (get, chain, loop function) at the beginning call
gst_object_sync_values(element,timestamp).
This will made the controller to update all gobject properties that are under
control with the current values based on timestamp.
</para></listitem>
</orderedlist>
What needs to be done in applications?
Again its not a lot to change.
<orderedlist>
<listitem><para>
first put some properties under control, by calling
controller = gst_object_control_properties (object, "prop1", "prop2",...);
</para></listitem>
<listitem><para>
Get a #GstControlSource for the property and set it up.
csource = gst_interpolation_control_source_new ();
gst_interpolation_control_source_set_interpolation_mode(csource, mode);
gst_interpolation_control_source_set (csource,0 * GST_SECOND, value1);
gst_interpolation_control_source_set (csource,1 * GST_SECOND, value2);
</para></listitem>
<listitem><para>
Set the #GstControlSource in the controller.
gst_controller_set_control_source (controller, "prop1", csource);
</para></listitem>
<listitem><para>
start your pipeline
</para></listitem>
</orderedlist>
Creates a new GstController for the given object's properties
the new controller.
the object of which some properties should be controlled
Creates a new GstController for the given object's properties
the new controller.
the object of which some properties should be controlled
list of property names that should be controlled
Creates a new GstController for the given object's properties
the new controller.
the object of which some properties should be controlled
%NULL terminated list of property names that should be controlled
Initializes the use of the controller library. Suggested to be called right
after gst_init().
the %TRUE for success.
pointer to the commandline argument count
pointer to the commandline argument values
Gets the value for the given controller-handled property at the requested
time.
property isn't handled by the controller
the GValue of the property at the given time, or %NULL if the
the name of the property to get
the time the control-change should be read from
Returns a read-only copy of the list of #GstTimedValue for the given property.
Free the list after done with it.
<note><para>This doesn't modify the controlled GObject property!</para></note>
directly.
a copy of the list, or %NULL if the property isn't handled by the controller
the name of the property to get the list for
Gets the corresponding #GstControlSource for the property. This should be unreferenced
again after use.
controlled by this controller or no #GstControlSource was assigned yet.
the #GstControlSource for @property_name or NULL if the property is not
name of the property for which the #GstControlSource should be get
Function to be able to get an array of values for one element property.
All fields of @value_array must be filled correctly. Especially the
of values (as indicated by the nbsamples field).
The type of the values in the array is the same as the property's type.
<note><para>This doesn't modify the controlled GObject property!</para></note>
%TRUE if the given array could be filled, %FALSE otherwise
the time that should be processed
array to put control-values in
Function to be able to get an array of values for one or more given element
properties.
All fields of the %GstValueArray in the list must be filled correctly.
Especially the GstValueArray->values arrays must be big enough to keep
the requested amount of values.
The types of the values in the array are the same as the property's type.
<note><para>This doesn't modify the controlled GObject properties!</para></note>
%TRUE if the given array(s) could be filled, %FALSE otherwise
the time that should be processed
list to return the control-values in
Removes the given object properties from the controller
%FALSE if one of the given property isn't handled by the controller, %TRUE otherwise
Removes the given object properties from the controller
%FALSE if one of the given property isn't handled by the controller, %TRUE otherwise
#GList of property names that should be removed
Removes the given object properties from the controller
%FALSE if one of the given property isn't handled by the controller, %TRUE otherwise
%NULL terminated list of property names that should be removed
Set the value of given controller-handled property at a certain time.
directly.
FALSE if the values couldn't be set (ex : properties not handled by controller), TRUE otherwise
the name of the property to set
the time the control-change is schedules for
the control-value
Sets the #GstControlSource for @property_name. If there already was a #GstControlSource
for this property it will be unreferenced.
couldn't be bound to the property, %TRUE if everything worked as expected.
%FALSE if the given property isn't handled by the controller or the new #GstControlSource
name of the property for which the #GstControlSource should be set
the #GstControlSource that should be used for the property
This function is used to disable all properties of the #GstController
for some time, i.e. gst_controller_sync_values() will do nothing.
boolean that specifies whether to disable the controller or not.
Sets multiple timed values at once.
directly.
%FALSE if the values couldn't be set (ex : properties not handled by controller), %TRUE otherwise
the name of the property to set
a list with #GstTimedValue items
Sets the given interpolation mode on the given property.
<note><para>User interpolation is not yet available and quadratic interpolation
is deprecated and maps to cubic interpolation.</para></note>
directly.
%TRUE if the property is handled by the controller, %FALSE otherwise
the name of the property for which to change the interpolation
interpolation mode
This function is used to disable the #GstController on a property for
some time, i.e. gst_controller_sync_values() will do nothing for the
property.
property to disable
boolean that specifies whether to disable the controller or not.
Returns a suggestion for timestamps where buffers should be split
to get best controller results.
if no control-rate was set.
Returns the suggested timestamp or %GST_CLOCK_TIME_NONE
Sets the properties of the element, according to the controller that (maybe)
handles 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
%TRUE if the controller values could be applied to the object
the time that should be processed
Used to remove the value of given controller-handled property at a certain
time.
directly.
%FALSE if the values couldn't be unset (ex : properties not handled by controller), %TRUE otherwise
the name of the property to unset
the time the control-change should be removed from
Used to remove all time-stamped values of given controller-handled property
directly.
by controller), %TRUE otherwise
%FALSE if the values couldn't be unset (ex : properties not handled
the name of the property to unset
The various interpolation modes available.
#GstInterpolationControlSource is a #GstControlSource, that interpolates values between user-given
control points. It supports several interpolation modes and property types.
To use #GstInterpolationControlSource get a new instance by calling
gst_interpolation_control_source_new(), bind it to a #GParamSpec, select a interpolation mode with
gst_interpolation_control_source_set_interpolation_mode() and set some control points by calling
gst_interpolation_control_source_set().
All functions are MT-safe.
This returns a new, unbound #GstInterpolationControlSource.
a new, unbound #GstInterpolationControlSource.
Returns a read-only copy of the list of #GstTimedValue for the given property.
Free the list after done with it.
a copy of the list, or %NULL if the property isn't handled by the controller
Returns the number of control points that are set.
the number of control points that are set.
Set the value of given controller-handled property at a certain time.
FALSE if the values couldn't be set, TRUE otherwise.
the time the control-change is scheduled for
the control-value
Sets multiple timed values at once.
FALSE if the values couldn't be set, TRUE otherwise.
a list with #GstTimedValue items
Sets the given interpolation mode.
<note><para>User interpolation is not yet available and quadratic interpolation
is deprecated and maps to cubic interpolation.</para></note>
%TRUE if the interpolation mode could be set, %FALSE otherwise
interpolation mode
Used to remove the value of given controller-handled property at a certain
time.
FALSE if the value couldn't be unset (i.e. not found, TRUE otherwise.
the time the control-change should be removed from
Used to remove all time-stamped values of given controller-handled property
#GstLFOControlSource is a #GstControlSource, that provides several periodic waveforms
as control values. It supports all fundamental, numeric GValue types as property.
To use #GstLFOControlSource get a new instance by calling gst_lfo_control_source_new(),
bind it to a #GParamSpec and set the relevant properties or use
gst_lfo_control_source_set_waveform.
All functions are MT-safe.
This returns a new, unbound #GstLFOControlSource.
a new, unbound #GstLFOControlSource.
Specifies the amplitude for the waveform of this #GstLFOControlSource.
It should be given as a #GValue with a type that can be transformed
to the type of the bound property.
Specifies the frequency that should be used for the waveform
of this #GstLFOControlSource. It should be large enough
so that the period is longer than one nanosecond.
Specifies the offset for the waveform of this #GstLFOControlSource.
It should be given as a #GValue with a type that can be transformed
to the type of the bound property.
Specifies the timeshift to the right that should be used for the waveform
of this #GstLFOControlSource in nanoseconds.
To get a n nanosecond shift to the left use
"(GST_SECOND / frequency) - n".
Specifies the waveform that should be used for this #GstLFOControlSource.
The various waveform modes available.
Structure for saving a timestamp and a value.
Structure to receive multiple values at once.
Convenience function for GObject
Creates a GstController that allows you to dynamically control one, or more, GObject properties.
If the given GObject already has a GstController, it adds the given properties to the existing
controller and returns that controller.
one or more of the given properties aren't available, or cannot be controlled, for the given element.
The GstController with which the user can control the given properties dynamically or NULL if
the object of which some properties should be controlled
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() inbetween. 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.
the control rate in nanoseconds
the object that has controlled properties
Gets the corresponding #GstControlSource for the property. This should be unreferenced
again after use.
controlled by this controller or no #GstControlSource was assigned yet.
the #GstControlSource for @property_name or NULL if the property is not
the object
name of the property for which the #GstControlSource should be get
Gets the controller for the given GObject
the controller handling some of the given element's properties, %NULL if no controller
the object that has controlled properties
Function to be able to get an array of values for one element properties
If the GstValueArray->values array is NULL, it will be created by the function.
The type of the values in the array are the same as the property's type.
The g_object_* functions are just convenience functions for GObject
%TRUE if the given array(s) could be filled, %FALSE otherwise
the object that has controlled properties
the time that should be processed
array to put control-values in
Function to be able to get an array of values for one or more given element
properties.
If the GstValueArray->values array in list nodes is NULL, it will be created
by the function.
The type of the values in the array are the same as the property's type.
The g_object_* functions are just convenience functions for GObject
%TRUE if the given array(s) could be filled, %FALSE otherwise
the object that has controlled properties
the time that should be processed
list to return the control-values in
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() inbetween. 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.
the object that has controlled properties
the new control-rate in nanoseconds.
Sets the #GstControlSource for @property_name. If there already was a #GstControlSource
for this property it will be unreferenced.
couldn't be bound to the property, %TRUE if everything worked as expected.
%FALSE if the given property isn't handled by the controller or the new #GstControlSource
the controller object
name of the property for which the #GstControlSource should be set
the #GstControlSource that should be used for the property
Sets the controller on the given GObject
%FALSE if the GObject already has an controller, %TRUE otherwise
the object that should get the controller
the controller object to plug in
Convenience function for GObject
same thing as gst_controller_suggest_next_sync()
the object that has controlled properties
Convenience function for GObject
same thing as gst_controller_sync_values()
the object that has controlled properties
the time that should be processed
Convenience function for GObject
Removes the given element's properties from it's controller
controller, %TRUE otherwise
%FALSE if one of the given property names isn't handled by the
the object of which some properties should not be controlled anymore