MythTV  master
Plugin Architecture
Collaboration diagram for Plugin Architecture:

MythPlugins are shared object files (i.e._libraries) which are loaded from a specific directory (_e.g. /usr/local/lib/mythtv/plugins). Currently, all plugins are written in the C++ language, but there is nothing preventing other languages being used (the functions are in the C name space). c int mythplugin_init(const char *libversion); is invoked whenever mythfrontend is started. This typically handles upgrading any database records - it will be the first method called after a new version of the plugin has been installed.

int mythplugin_run(); is invoked when the action attribute of a menu item requests it via the PLUGIN directive. This is when the user chooses to enter the plugin from the main menu or the appropriate submenu.

int mythplugin_config(); is invoked when the action attribute of a menu item requests it via the CONFIGPLUGIN directive. This should be when the users wishes to change the plugin's settings (in the main Setup menu).

Other plugin functions are listed in the file mythpluginapi.h (see also the MythPlugin and MythPluginManager classes.)