Added a document about how we handle plugins and dynamic loading.
[platform/upstream/gstreamer.git] / docs / random / plugins
1 We describe how the plugin system works.
2
3 Plugins
4 -------
5
6 plugins are basically shared libraries with a plugin_init
7 function.
8
9 they provide the GStreamer core library with the folowing
10 information:
11
12   - elementfactories
13   - typefactories
14   - metadatafactories?
15
16 ElementFactory
17 --------------
18
19 elementfactories provide the core library with elements (duh)
20
21 an elementfactory has the following information:
22
23   - a unique name for the element
24   - strings describing the element (name, desciption, copyright,...)
25   - a description of the media types it accepts (as capabilities) 
26   - a description of the media types it outputs (as capabilities)
27
28
29 TypeFactory
30 -----------
31
32 has the following properties:
33
34  - a mime type
35  - file extensions that may provide a hint for this type
36  - a function to detect this type
37  - a string to detect this type (file(1) like)
38
39
40 XML registry
41 ------------
42
43 The complete plugin tree will be exported into an XML desciption so
44 that the definitions of the factories can be obtained without having
45 to load and plugin_init the plugins.
46
47 Loading of plugins
48 ------------------
49
50 at some point, the plugin will need to be read into memory before
51 any elements it provides can be used. the XML description of the
52 loaded plugin will need to be updated.
53
54 We will have the following methods for (implicitly) loading plugins:
55
56  gst_plugin_load_all()
57
58   remove the complete XML tree and read all the plugins in the
59   paths. The plugin_init method will be called and the XML tree
60   will be rebuild in memory.
61
62  gst_plugin_load (name)
63
64   The plugin will be located in the tree and if it allready loaded, the
65   function returns. If it is not loaded, the XML entry is removed and
66   the plugin is loaded. The plugin_init is called so that the XML tree
67   is reconstructed.
68
69  gst_elementfactory_create (factory, name);
70
71   The plugin providing the element will be located, if the plugin is
72   allready loaded, an element with the given name is created.
73   if the plugin is not loaded, gst_plugin_load is called.
74   the loaded factory is located again and the element is created.
75
76  The typefind function is called
77
78   When the plugin description  is read from the XML file, the typefind 
79   function is hooked up to a dummy typefind function. The dummy typefind 
80   function will locate the plugin it belongs to and call gst_plugin_load.
81   after the loading of the plugin, the real typefind function is called.
82
83
84
85  
86
87   
88
89