Merge remote-tracking branch 'origin/0.10'
[platform/upstream/gstreamer.git] / docs / design / part-controller.txt
1 Controller
2 ----------
3
4 The controller subsystem allows to automate element property changes. It works
5 so that all parameter changes are time based and elements request property
6 updates at processing time.
7
8 Element view
9 ~~~~~~~~~~~~
10 Elements don't need to do much. They need to:
11 - mark object properties that can be changed while processing with
12   GST_PARAM_CONTROLLABLE
13 - call gst_object_sync_values (self, timestamp) in the processing function
14   before accessing the parameters.
15   
16 All ordered property types can be automated (int, double, boolean, enum). 
17
18 Application view
19 ~~~~~~~~~~~~~~~~
20 Applications need to setup the property automation. For that they need to create
21 a GstControlSource and attach it to a property using GstControlBinding. Various
22 control-sources and control-bindings exist. All control sources produce control
23 value sequences in the form of gdouble values. The control bindings map them to
24 the value range and type of the bound property.
25
26 One control-source can be attached to one or more properties at the same time.
27 If it is attached multiple times, then each control-binding will scale and
28 convert the control values to the target property type and range.
29
30 One can create complex control-curves by using a GstInterpolationControlSource.
31 This allows the classic user editable control-curve (often seen in audio/video
32 editors). Another way is to use computed control curves. GstLFOControlSource can
33 generate various repetitive signals. Those can be made more complex by chaining
34 the control sources. One can attach another control-source to e.g. modulate the
35 frequency of the first GstLFOControlSource.
36
37 In most cases GstControlBindingDirect will be the binding to be used. Other
38 control bindings are there to handle special cases, such as having 1-4 control-
39 sources and combine their values into a single guint to control a rgba-color
40 property.