Chapter 20. Supporting Dynamic Parameters

Table of Contents

Getting Started
The Data Processing Loop
The Data Processing Loop for Video Elements
The Data Processing Loop for Audio Elements

Warning, this part describes 0.10 and is outdated.

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 being Controllable. Aware applications can use the controller subsystem to dynamically adjust the property values over time.

Getting Started

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 no 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 | G_PARAM_STATIC_STRINGS));