2004-02-02 21:52:46 +00:00
|
|
|
<chapter id="chapter-other-manager" xreflabel="Writing a Manager">
|
|
|
|
<title>Writing a Manager</title>
|
|
|
|
<para>
|
2004-11-06 10:28:07 +00:00
|
|
|
Managers are elements that add a function or unify the function of
|
|
|
|
another (series of) element(s). Managers are generally a
|
|
|
|
<classname>GstBin</classname> with one or more ghostpads. Inside them
|
|
|
|
is/are the actual element(s) that matters. There is several cases where
|
|
|
|
this is useful. For example:
|
2004-02-02 21:52:46 +00:00
|
|
|
</para>
|
2004-11-06 10:28:07 +00:00
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To add support for private events with custom event handling to
|
|
|
|
another element.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To add support for custom pad <function>_query ()</function>
|
|
|
|
or <function>_convert ()</function> handling to another element.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To add custom data handling before or after another element's data
|
|
|
|
handler function (generally its <function>_chain ()</function>
|
|
|
|
function).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2005-07-20 08:29:06 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To embed an element, or a series of elements, into something that
|
2012-10-01 09:47:46 +00:00
|
|
|
looks and works like a simple element to the outside world. This
|
|
|
|
is particular handy for implementing sources and sink elements with
|
|
|
|
multiple pads.
|
2005-07-20 08:29:06 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2004-11-06 10:28:07 +00:00
|
|
|
</itemizedlist>
|
|
|
|
<para>
|
2005-07-20 08:29:06 +00:00
|
|
|
Making a manager is about as simple as it gets. You can derive from a
|
|
|
|
<classname>GstBin</classname>, and in most cases, you can embed the
|
|
|
|
required elements in the <function>_init ()</function> already, including
|
|
|
|
setup of ghostpads. If you need any custom data handlers, you can connect
|
|
|
|
signals or embed a second element which you control.
|
2004-11-06 10:28:07 +00:00
|
|
|
</para>
|
2004-02-02 21:52:46 +00:00
|
|
|
</chapter>
|