Clarifications on the new configuration architecture.
gbazin at netcourrier.com
Mon Feb 25 21:20:09 CET 2002
I just realised that I should have explained a few things about the new
configuration scheme, so here I go:
Firstly, there are two places where you can add config options when you want
a plugin to be customizable:
- The first place is in the plugin itself and it is usually the right thing
to do, but you have to keep in mind that these configuration options will
then actually be instanciated only if the plugin is installed with vlc.
In fact the whole configuration structure is built dynamically on startup
when vlc will loads all the plugins.
- This is why you can alternatively declare config options in the main module
(main.c). As main() will always be there, you are guaranteed that the
configuration option will always exist. Of course declaring config options in
main should only be useful for config options which are used by several
plugins and which are kind of generic options (in contrast to plugin
(just as a side note, to make generic options (main options) more accessible
to plugins, I decided to define their names as macros in include/config.h,
but plugin specific options shouldn't have any need to do the same)
Another really important point is that configuration options need to have
unique names. This is partly a design restriction as config options are
associated with the plugin which declare them ( a config_t structure is
stored in the module_t structure of each plugin -including main- ) but
config_Get* and config_Put* functions don't have any notion of plugins (they
just look for the first occurance of the config option). But also the goal
was to keep everything simple, and allowing for identical config options will
just make things more complex.
So when a config option is common between several plugins, you can either
define it with a different name in each plugin ( anyway prefixing plugin
specific options with the plugin name seems a good practice to me ), or if
the option is generic enough you can add it to main().
As a quick example, I would like in the future to add an alternative
fullscreen method for the x11, xvideo and xmga plugins. This alternative
fullscreen would make the video window transient so things like taskbars
never show on top. I cannot really qualify this as a generic option as it is
really X specific so I plan to add in fact the following config options:
x11_altfullscreen, xvideo_altfullscreen and xmga_altfullscreen.
I hope I didn't confuse people more with my explanations ;-)
If I think of anything else I will repost a mail.
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the vlc-devel