summaryrefslogtreecommitdiff
path: root/docs/random/plugins
blob: ed1630ba1e9c18c361c0ca0929b983a8267a0d19 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SOMEWHAT OUTDATED
-----------------


We describe how the plugin system works.

Plugins
-------

plugins are basically shared libraries with a plugin_init
function.

they provide the GStreamer core library with the following
information:

  - element factories
  - type factories
  - metadata factories?

ElementFactory
--------------

element factories provide the core library with elements (duh)

an element factory has the following information:

  - a unique name for the element factory
  - strings describing the element (name, desciption, copyright,...)
  - a description of the media types it accepts (as capabilities) 
  - a description of the media types it outputs (as capabilities)


TypeFactory
-----------

has the following properties:

 - a mime type
 - file extensions that may provide a hint for this type
 - a function to detect this type
 - a string to detect this type (file(1) like)


XML registry
------------

The complete plugin tree will be exported into an XML description so
that the definitions of the factories can be obtained without having
to load and plugin_init the plugins.

Loading of plugins
------------------

at some point, the plugin will need to be read into memory before
any elements it provides can be used. the XML description of the
loaded plugin will need to be updated.

We will have the following methods for (implicitly) loading plugins:

 gst_plugin_load_all()

  remove the complete XML tree and read all the plugins in the
  paths. The plugin_init method will be called and the XML tree
  will be rebuild in memory.

 gst_plugin_load (name)

  The plugin will be located in the tree and if it already loaded, the
  function returns. If it is not loaded, the XML entry is removed and
  the plugin is loaded. The plugin_init is called so that the XML tree
  is reconstructed.

 gst_elementfactory_create (factory, name);

  The plugin providing the element will be located, if the plugin is
  already loaded, an element with the given name is created.
  if the plugin is not loaded, gst_plugin_load is called.
  the loaded factory is located again and the element is created.

 The typefind function is called

  When the plugin description  is read from the XML file, the typefind 
  function is hooked up to a dummy typefind function. The dummy typefind 
  function will locate the plugin it belongs to and call gst_plugin_load.
  after the loading of the plugin, the real typefind function is called.