1 <chapter id="chapter-dparams">
2 <title>Dynamic Controllable Parameters</title>
4 <sect1 id="section-dparams-getting-started">
5 <title>Getting Started</title>
7 The controller subsystem offers a lightweight way to adjust gobject
8 properties over stream-time.
9 It works by using time-stamped value pairs that are queued for
11 At run-time the elements continously pull values changes for the
15 This subsystem is contained within the
16 <filename>gstcontroller</filename> library.
17 You need to include the header in your application's source file:
21 #include <gst/gst.h>
22 #include <gst/controller/gstcontroller.h>
26 Your application should link to the shared library <filename>gstreamer-controller</filename>.
29 The <filename>gstreamer-controller</filename> library needs to be initialized
30 when your application is run. This can be done after the the GStreamer
31 library has been initialized.
35 gst_init (&argc, &argv);
36 gst_controller_init (&argc, &argv);
41 <sect1 id="section-dparams-parameters">
42 <title>Setting up parameter control</title>
44 The first step is to select the parameters that should be controlled.
45 This returns a controller object that is needed to further adjust the
49 controller = g_object_control_properties(object, "prop1", "prop2",...);
52 Next we can select an interpolation mode. This mode controls how inbetween
53 values are determined.
54 The controller subsystem can e.g. fill gaps by smoothing parameter changes.
55 Each controllable GObject property can be
56 interpolated differently.
59 gst_controller_set_interpolation_mode(controller,"prop1",mode);
62 Finally one needs to set control points. These are time-stamped GValues.
63 The values become active when the timestamp is reached. They still stay
64 in the list. If e.g. the pipeline runs a loop (using a segmented seek),
65 the control-curve gets repeated as well.
68 gst_controller_set (controller, "prop1" ,0 * GST_SECOND, value1);
69 gst_controller_set (controller, "prop1" ,1 * GST_SECOND, value2);
72 The controller subsystem has a builtin live-mode. Even though a parameter
73 has timestamped control-values assigned one can change the GObject
74 property through <function>g_object_set()</function>.
75 This is highly useful when binding the GObject properties to GUI widgets.
76 When the user adjusts the value with the widget, one can set the GOBject
77 property and this remains active until the next timestamped value overrides.
78 This also works with smoothed parameters.