summaryrefslogtreecommitdiff
path: root/pwg-other-manager.md
blob: d18a316d63246e71ca4c03876fcc08ecdfc71716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
title: Writing a Manager
...

# Writing a Manager

Managers are elements that add a function or unify the function of
another (series of) element(s). Managers are generally a `GstBin` 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:

  - To add support for private events with custom event handling to
    another element.

  - To add support for custom pad `_query ()` or `_convert ()` handling
    to another element.

  - To add custom data handling before or after another element's data
    handler function (generally its `_chain ()` function).

  - To embed an element, or a series of elements, into something that
    looks and works like a simple element to the outside world. This is
    particular handy for implementing sources and sink elements with
    multiple pads.

Making a manager is about as simple as it gets. You can derive from a
`GstBin`, and in most cases, you can embed the required elements in the
`_init ()` already, including setup of ghostpads. If you need any custom
data handlers, you can connect signals or embed a second element which
you control.