| GStreamer Application Development Manual (0.8.7) | ||
|---|---|---|
| <<< Previous | Dynamic Parameters | Next >>> |
All interaction with dparams to actually set the dparam value is done through simple GObject properties. There is a property value for each type that dparams supports - these currently being "value_double", "value_float", "value_int" and "value_int64". To set the value of a dparam, simply set the property which matches the type of your dparam instance.
#define ZERO(mem) memset(&mem, 0, sizeof(mem))
...
gdouble set_to_value;
GstDParam *volume;
GValue set_val;
ZERO(set_val);
g_value_init(&set_val, G_TYPE_DOUBLE);
...
g_value_set_double(&set_val, set_to_value);
g_object_set_property(G_OBJECT(volume), "value_double", &set_val);
|
Or if you create an actual GValue instance:
gdouble set_to_value;
GstDParam *volume;
GValue *set_val;
set_val = g_new0(GValue,1);
g_value_init(set_val, G_TYPE_DOUBLE);
...
g_value_set_double(set_val, set_to_value);
g_object_set_property(G_OBJECT(volume), "value_double", set_val);
|
| <<< Previous | Home | Next >>> |
| Creating and Attaching Dynamic Parameters | Up | Different Types of Dynamic Parameter |