GStreamer 0.10 Library Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <libs/controller/gstcontrolsource.h> struct GstControlSource; struct GstControlSourceClass; gboolean (*GstControlSourceBind) (GstControlSource *self
,GParamSpec *pspec
); gboolean (*GstControlSourceGetValue) (GstControlSource *self
,GstClockTime timestamp
,GValue *value
); gboolean (*GstControlSourceGetValueArray) (GstControlSource *self
,GstClockTime timestamp
,GstValueArray *value_array
); struct GstTimedValue; struct GstValueArray; gboolean gst_control_source_bind (GstControlSource *self
,GParamSpec *pspec
); gboolean gst_control_source_get_value (GstControlSource *self
,GstClockTime timestamp
,GValue *value
); gboolean gst_control_source_get_value_array (GstControlSource *self
,GstClockTime timestamp
,GstValueArray *value_array
);
GObject +----GstControlSource +----GstInterpolationControlSource +----GstLFOControlSource
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 { GObjectClass parent_class; GstControlSourceBind bind; /* Binds the GstControlSource to a specific GParamSpec */ };
The class structure of GstControlSource.
GObjectClass |
Parent class |
GstControlSourceBind |
Class method for binding the GstControlSource to a specific GParamSpec |
gboolean (*GstControlSourceBind) (GstControlSource *self
,GParamSpec *pspec
);
Function for binding a GstControlSource to a GParamSpec.
|
the GstControlSource instance |
|
GParamSpec that should be bound to |
Returns : |
TRUE if the property could be bound to the GstControlSource, FALSE otherwise. |
gboolean (*GstControlSourceGetValue) (GstControlSource *self
,GstClockTime timestamp
,GValue *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
,GstValueArray *value_array
);
Function for returning a GstValueArray for a given timestamp.
|
the GstControlSource instance |
|
timestamp for which a value should be calculated |
|
array to put control-values in |
Returns : |
TRUE if the values were successfully calculated. |
struct GstTimedValue { GstClockTime timestamp; GValue value; };
Structure for saving a timestamp and a value.
GstClockTime |
timestamp of the value change |
GValue |
the corresponding value |
struct GstValueArray { const gchar *property_name; gint nbsamples; GstClockTime sample_interval; gpointer *values; };
Structure to receive multiple values at once.
const gchar * |
the name of the property this array belongs to |
gint |
number of samples requested |
GstClockTime |
interval between each sample |
gpointer * |
pointer to the array |
gboolean gst_control_source_bind (GstControlSource *self
,GParamSpec *pspec
);
Binds a GstControlSource to a specific property. This must be called only once for a GstControlSource.
|
the GstControlSource object |
|
GParamSpec for the property for which this GstControlSource should generate values. |
Returns : |
TRUE if the GstControlSource was bound correctly, FALSE otherwise. |
gboolean gst_control_source_get_value (GstControlSource *self
,GstClockTime timestamp
,GValue *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
,GstValueArray *value_array
);
Gets an array of values for one element property.
All fields of value_array
must be filled correctly. Especially the
value_array->values
array must be big enough to keep the requested amount
of values.
The type of the values in the array is the same as the property's type.
|
the GstControlSource object |
|
the time that should be processed |
|
array to put control-values in |
Returns : |
TRUE if the given array could be filled, FALSE otherwise |