GStreamer 1.0 Core Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <gst/gst.h> GstValueArray; struct GstControlSource; struct GstControlSourceClass; gboolean (*GstControlSourceGetValue) (GstControlSource *self
,GstClockTime timestamp
,gdouble *value
); gboolean (*GstControlSourceGetValueArray) (GstControlSource *self
,GstClockTime timestamp
,GstClockTime interval
,guint n_values
,gdouble *values
); struct GstTimedValue; gboolean gst_control_source_get_value (GstControlSource *self
,GstClockTime timestamp
,gdouble *value
); gboolean gst_control_source_get_value_array (GstControlSource *self
,GstClockTime timestamp
,GstClockTime interval
,guint n_values
,gdouble *values
);
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.
struct GstControlSource { GstControlSourceGetValue get_value; /* Returns the value for a property at a given timestamp */ GstControlSourceGetValueArray get_value_array; /* Returns values for a property in a given timespan */ };
The instance structure of GstControlSource.
GstControlSourceGetValue |
Function for returning a value for a given timestamp |
GstControlSourceGetValueArray |
Function for returning a GstValueArray for a given timestamp |
struct GstControlSourceClass { GstObjectClass parent_class; };
The class structure of GstControlSource.
GstObjectClass |
Parent class |
gboolean (*GstControlSourceGetValue) (GstControlSource *self
,GstClockTime timestamp
,gdouble *value
);
Function for returning a value for a given timestamp.
|
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. |
Returns : |
TRUE if the value was successfully calculated. |
gboolean (*GstControlSourceGetValueArray) (GstControlSource *self
,GstClockTime timestamp
,GstClockTime interval
,guint n_values
,gdouble *values
);
Function for returning an array of values for starting at a given timestamp.
|
the GstControlSource instance |
|
timestamp for which a value should be calculated |
|
the time spacing between subsequent values |
|
the number of values |
|
array to put control-values in |
Returns : |
TRUE if the values were successfully calculated. |
struct GstTimedValue { GstClockTime timestamp; gdouble value; };
Structure for saving a timestamp and a value.
GstClockTime |
timestamp of the value change |
gdouble |
the corresponding value |
gboolean gst_control_source_get_value (GstControlSource *self
,GstClockTime timestamp
,gdouble *value
);
Gets the value for this GstControlSource at a given timestamp.
|
the GstControlSource object |
|
the time for which the value should be returned |
|
the value |
Returns : |
FALSE if the value couldn't be returned, TRUE otherwise. |
gboolean gst_control_source_get_value_array (GstControlSource *self
,GstClockTime timestamp
,GstClockTime interval
,guint n_values
,gdouble *values
);
Gets an array of values for for this GstControlSource.
|
the GstControlSource object |
|
the first timestamp |
|
the time steps |
|
the number of values to fetch |
|
array to put control-values in |
Returns : |
TRUE if the given array could be filled, FALSE otherwise |