notes: this is work in progress, have some new ideas, add/modify them later

This commit is contained in:
Christian Thaeter 2007-07-12 13:42:50 +02:00
parent 6add56a199
commit 4dc12c0884

View file

@ -1774,7 +1774,7 @@ struct cinelerra_interface_foo_1 myfoointerface =
Note: the protoname and version args for CINELERRA_INTERFACE_FUNC will be used for placement initialization and type checking, not mentioned here. This would allow to initialize this structure out of order.
</pre>
</div>
<div title="PluginLibrary" modifier="CehTeh" modified="200707111914" created="200707111329" changecount="10">
<div title="PluginLibrary" modifier="CehTeh" modified="200707112130" created="200707111329" changecount="13">
<pre>! Cinelerra Plugin API
There are only few functions to manage Plugins. Actually a user requests interfaces, the libraries which implement Plugins are managed transparently.
@ -1786,7 +1786,7 @@ cinelerra_interface_open (const char* plugin, const char* interface, size_t min_
}}}
!!! Parameters
* ''{{{plugin}}}'' is the name of the Plugin which interface to use. Plugins are looked up in $CINELERRA_PLUGIN_PATH, which is a colon separated list of directories, and then in $plugin_install_dir which is the directory where standard plugins get installed when installing cinelerra (example: /usr/local/lib/cinelerra3/). The name itself can contain slashes, see PluginHierachy for details. It shall not include a library extension (.so). When NULL is passed, a interface from the main application is queried.
* ''{{{plugin}}}'' is the name of the Plugin which interface to use. Plugins are looked up in $~CINELERRA_PLUGIN_PATH, which is a colon separated list of directories, and then in $plugin_install_dir which is the directory where standard plugins get installed when installing cinelerra (example: /usr/local/lib/cinelerra3/). The name itself can contain slashes, see PluginHierachy for details. It shall not include a library extension (.so). When NULL is passed, a interface from the main application is queried.
* ''{{{interface}}}'' is the name of the queried interface.
* ''{{{min_revision}}}'' is the expected minimal size of the interface structure, since interfaces are extended by adding new protos at the end, the size gives a unique value for each new revision.
@ -1796,6 +1796,15 @@ Interfaces can opened multiple times and need to be closed for each call to open
!!! Return
This function returns a pointer to the requested interface on success or NULL in case of an error. See {{{cinelerra_interface_error}}} about handing errors.
{{{
interface
CINELERRA_INTERFACE_OPEN(plugin, interface)
}}}
This macro form does the casting of the result and uses the current size for the min_revison argument
---
!! closing an Interface
{{{
void
@ -1851,19 +1860,34 @@ always succeeds.
!! C++ exceptions
</pre>
</div>
<div title="Plugins" modifier="CehTeh" modified="200707111824" created="200707111054" changecount="13">
<div title="PluginVersioningCases" modifier="CehTeh" modified="200707121141" created="200707121127" changecount="20">
<pre>
|&gt;|&gt;|!Source compatibility|
|!~~USES~~\^^PROVIDES^^|OLD|NEW|
|OLD|||
|NEW|||
</pre>
</div>
<div title="Plugins" modifier="CehTeh" modified="200707121120" created="200707111054" changecount="14">
<pre>Cinelerra3 will use a very simple and language neutral plugin system. It focuses easy and independent distribution of plugins and small specific interfaces. Ultimate flexibility is of second concern.
''WORK IN PROGRESS, everything here is NOT final''
! Concept
Plugins are just shared libraries which offer well defined Interfaces. A Plugin may offer more than one interface and may in turn request/use interfaces from other Plugins or from the main application.
! Interfaces
Plugin interfaces are simple C structs with some metadata at the beginning and function prototypes added at the end. Each interface is versioned. This allows to extend existing interfaces, but not alter functions which are already present. With some macros we can map simple functions to versioned interfaces. Compiled plugins will stay compatible even if the interface is extended, while sourcecode need maintenance.
Plugin interfaces are simple C structs with some metadata at the beginning and function prototypes added at the end. With some macros we can map simple functions to versioned interfaces. Compiled plugins will stay compatible even if the interface is extended, while sourcecode need maintenance.
This fosters the idea of free plugins updating them when the source is available, while still having the ability to deploy packaged binary plugins which will be compatible with newer interface versions.
The Plugin System is written in C with some preprocessor macros helpers. There will be some support to handle C++ specialties.
! Versioning
Each interface/prototype is versioned. How this works together is explained in PluginVersioningCases.
! Plugin Support includes
* [[An interface definition language|PluginInterfaceDefinition]]
* [[An interface implementation language|PluginInterfaceImplementation]]