mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-12 11:26:39 +00:00
79b77446d8
Original commit message from CVS: * docs/pwg/advanced-scheduling.xml: * docs/pwg/advanced-tagging.xml: * docs/pwg/advanced-types.xml: * docs/pwg/building-boiler.xml: * docs/pwg/building-chainfn.xml: * docs/pwg/building-signals.xml: * docs/pwg/building-state.xml: * docs/pwg/building-testapp.xml: * docs/pwg/intro-basics.xml: * docs/pwg/other-manager.xml: * docs/pwg/other-source.xml: Typo fixes. * docs/pwg/other-manager.xml: Add some first content. No example code yet. * gst/elements/gstfilesink.c: (gst_filesink_handle_event): Remove double newlines.
54 lines
2.1 KiB
XML
54 lines
2.1 KiB
XML
|
|
<!-- ############ chapter ############# -->
|
|
|
|
<chapter id="chapter-other-manager" xreflabel="Writing a Manager">
|
|
<title>Writing a Manager</title>
|
|
<para>
|
|
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:
|
|
</para>
|
|
<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>
|
|
</itemizedlist>
|
|
<para>
|
|
This chapter will explain the setup of managers. As a specific example,
|
|
we will try to add EOS event support to source elements. This can be
|
|
used to finish capturing an audio stream to a file. Source elements
|
|
normally don't do any EOS handling at all, so a manager is perfect to
|
|
extend those element's functionalities.
|
|
</para>
|
|
<para>
|
|
Specifically, this element will contain two child elements: the actual
|
|
source element and a <quote>helper element</quote> that implement an
|
|
event handler on its source pad. This event handler will respond to
|
|
EOS events by storing them internally and returning the event (rather
|
|
than data) on the next call to the <function>_get ()</function>
|
|
function. After that, it will go into EOS and set the parent (and
|
|
thereby the contained source element) to EOS as well. Other events will
|
|
be forwarded to the source element, which will handle them as usual.
|
|
</para>
|
|
<programlisting>
|
|
..
|
|
</programlisting>
|
|
</chapter>
|