| 1 |
|
| 2 |
The autoplugger is a custom bin with a set of custom add/remove methods. |
| 3 |
The point is to virtually add a set of plugins that should take part in |
| 4 |
the autoplugging (like the src, sink elements). The autoplugger should |
| 5 |
try hard to included these plugins in the final pipeline. |
| 6 |
|
| 7 |
The autoplugger has to be a bin because else we cannot put it into the |
| 8 |
paused state when dynamically connecting elements. |
| 9 |
|
| 10 |
We cannot include the intermediate elements or sink/src elements to the bin |
| 11 |
right away because else they will be scheduled by the scheduler. |
| 12 |
|
| 13 |
The bin will use the elementfactory klass field to get a basic idea about |
| 14 |
the plugin: |
| 15 |
|
| 16 |
- the 'Source' keyword is used to detect source elements |
| 17 |
- the 'Sink' keyword is used to detect the sink elements or targets |
| 18 |
of the autoplugging. |
| 19 |
- other elements are considered intermediate elements and will be |
| 20 |
inserted when possible. |
| 21 |
|
| 22 |
|
| 23 |
algorithm: |
| 24 |
|
| 25 |
- Autoplugging starts from a source element, it will be added to the real bin. |
| 26 |
- for all unconnected pads: |
| 27 |
- if pad has NULL padtemplate caps add typefind + autoplugcache to the pad |
| 28 |
- if unconnected pad has fixed caps, find element in repository that can |
| 29 |
connect. |
| 30 |
- first check elements added to the bin |
| 31 |
- test elements ordered by rank |
| 32 |
- favour 'Demux' type elements close to sources, 'Decoder' elements after |
| 33 |
that and 'Filter' elements close to sinks. |
| 34 |
- link dummy element with pads with non-fixed caps. The dummy element getcaps |
| 35 |
function will use the repository to return a list of compatible caps, so that |
| 36 |
the element can choose freely. The dummy element is replaced with a real |
| 37 |
element when caps become fixed. |
| 38 |
- all new_pad signals and caps notifications trigger the above actions. |