[mythtv] Revamping the plugin system.

J. Donavan Stanley jdonavan at gorpe.com
Thu Nov 27 13:42:30 EST 2003


Isaac Richards wrote:

>On Thursday 27 November 2003 10:29 am, J. Donavan Stanley wrote:
>  
>
>>While working on the CD monitoring system I quickly realized that I
>>couldn't accomplish my goals for it without resorting to ugly hacks.  So I
>>took a step back and started from square one so that I could get the
>>foundation in place first.  To that end I've been working on a  revamped
>>plugin system for MythTV to allow for new types of plugins and a more
>>complete plugin framework.
>>
>>I started with "Yehia" as a baseline, and made several modifications so
>>that it fits into MythTV (mostly converting it to use Qt objects instead of
>>SigC++ and the like).  Under the new system, each plugin has a single entry
>>point which returns a pointer to an object derived from "Plugin".  This
>>allows us to define new types of plugins rather easily since we simply need
>>to define an interface derived from Plugin.
>>    
>>
>
>I don't want to limit plugins to C++ only, as this will do.
>  
>
There's a piece of the puzzle I left out, the PluginLoader... If you 
want your plugins in C, it'd be trival to implment a PluginLoader that 
creates the required interface by using pointers to exported functions, 
much in the way I currently do it for legacy plugins.  If you want them 
in some sort of scripting language, then once you've got bindings done, 
via SWIG or what have you, then create a loader that can load plugins 
from scripts as well.  The new system doesn't lose any existing 
functionality or flexibility only adds it.  The discovery of plugins is 
done by the PluginManager via it's register PluginLoaders.  The 
PluginManager doesn't care where the plugins come from just that there's 
a mechanism to get Plugin* from a plugin loader.



More information about the mythtv-dev mailing list