blob: ed1630ba1e9c18c361c0ca0929b983a8267a0d19 [file] [log] [blame]
We describe how the plugin system works.
plugins are basically shared libraries with a plugin_init
they provide the GStreamer core library with the following
- element factories
- type factories
- metadata factories?
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)
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:
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.