2002-08-02 11:23:05 +00:00
|
|
|
SOMEWHAT OUTDATED
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
2000-12-12 19:31:00 +00:00
|
|
|
We describe how the plugin system works.
|
|
|
|
|
|
|
|
Plugins
|
|
|
|
-------
|
|
|
|
|
|
|
|
plugins are basically shared libraries with a plugin_init
|
|
|
|
function.
|
|
|
|
|
2002-09-09 09:31:26 +00:00
|
|
|
they provide the GStreamer core library with the following
|
2000-12-12 19:31:00 +00:00
|
|
|
information:
|
|
|
|
|
2002-09-09 09:31:26 +00:00
|
|
|
- element factories
|
|
|
|
- type factories
|
|
|
|
- metadata factories?
|
2000-12-12 19:31:00 +00:00
|
|
|
|
|
|
|
ElementFactory
|
|
|
|
--------------
|
|
|
|
|
2002-09-09 09:31:26 +00:00
|
|
|
element factories provide the core library with elements (duh)
|
2000-12-12 19:31:00 +00:00
|
|
|
|
2002-09-09 09:31:26 +00:00
|
|
|
an element factory has the following information:
|
2000-12-12 19:31:00 +00:00
|
|
|
|
2002-09-09 09:31:26 +00:00
|
|
|
- a unique name for the element factory
|
2000-12-12 19:31:00 +00:00
|
|
|
- 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
|
|
|
|
------------
|
|
|
|
|
2002-09-09 09:31:26 +00:00
|
|
|
The complete plugin tree will be exported into an XML description so
|
2000-12-12 19:31:00 +00:00
|
|
|
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)
|
|
|
|
|
2011-09-07 11:14:38 +00:00
|
|
|
The plugin will be located in the tree and if it already loaded, the
|
2000-12-12 19:31:00 +00:00
|
|
|
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
|
2011-09-07 11:14:38 +00:00
|
|
|
already loaded, an element with the given name is created.
|
2000-12-12 19:31:00 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|