53381146bfbcdcf1fd7e9b76d31a172e90ee35c8
[platform/upstream/gstreamer.git] / docs / pwg / other-manager.xml
1 <chapter id="chapter-other-manager" xreflabel="Writing a Manager">
2   <title>Writing a Manager</title>
3   <para>
4     Managers are elements that add a function or unify the function of
5     another (series of) element(s). Managers are generally a
6     <classname>GstBin</classname> with one or more ghostpads. Inside them
7     is/are the actual element(s) that matters. There is several cases where
8     this is useful. For example:
9   </para>
10   <itemizedlist>
11     <listitem>
12       <para>
13         To add support for private events with custom event handling to
14         another element.
15       </para>
16     </listitem>
17     <listitem>
18       <para>
19         To add support for custom pad <function>_query ()</function>
20         or <function>_convert ()</function> handling to another element.
21       </para>
22     </listitem>
23     <listitem>
24       <para>
25         To add custom data handling before or after another element's data
26         handler function (generally its <function>_chain ()</function>
27         function).
28       </para>
29     </listitem>
30     <listitem>
31       <para>
32         To embed an element, or a series of elements, into something that
33         looks and works like a simple element to the outside world. This
34         is particular handy for implementing sources and sink elements with
35         multiple pads.
36       </para>
37     </listitem>
38   </itemizedlist>
39   <para>
40     Making a manager is about as simple as it gets. You can derive from a
41     <classname>GstBin</classname>, and in most cases, you can embed the
42     required elements in the <function>_init ()</function> already, including
43     setup of ghostpads. If you need any custom data handlers, you can connect
44     signals or embed a second element which you control.
45   </para>
46 </chapter>