GStreamer Plugin Writer's Guide (0.10.12) | ||
---|---|---|
<<< Previous | Next >>> |
Sometimes object properties are not powerful enough to control the parameters that affect the behaviour of your element. When this is the case you can mark these parameters as beeing Controllable. Aware appliations can use the controller subsystem to dynamically adjust the property values over time.
The controller subsystem is contained within the gstcontroller library. You need to include the header in your element's source file:
... #include <gst/gst.h> #include <gst/controller/gstcontroller.h> ... |
Even though the gstcontroller library may be linked into the host application, you should make sure it is initialized in your plugin_init function:
static gboolean plugin_init (GstPlugin *plugin) { ... /* initialize library */ gst_controller_init (NULL, NULL); ... } |
It makes not sense for all GObject parameter to be real-time controlled.
Therefore the next step is to mark controllable parameters.
This is done by using the special flag GST_PARAM_CONTROLLABLE
.
when setting up GObject params in the _class_init method.
g_object_class_install_property (gobject_class, PROP_FREQ, g_param_spec_double ("freq", "Frequency", "Frequency of test signal", 0.0, 20000.0, 440.0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); |
<<< Previous | Home | Next >>> |
Obligations of each element. | Up | The Data Processing Loop |