[vlc-devel] Re: Writing VLC interface plug-in

Clément Stenac zorglub at via.ecp.fr
Sat Feb 7 10:25:17 CET 2004


> Specifically, 'section 2.7 How to write an interface plugin' is only a
> half-page long and I cannot find 'plugins' directory at all.

This documentation is badly outdated.

> Could
> anyone provide some general instructions? I've just downloaded and
> compiled "VLC source code tarball (0.7.0)" on Cygwin under Windows
> environment.

1) Module declaration
---------------------

Your module should be put in modules/gui.

If you create a new directory for it, add a Modules.am file in it.
In this file, put something like :
"SOURCES_yourmodule = myfile1.c \
		      myfile2.c"
 
Then, go to the main configure.ac file, and at the end, in the
AC_CONFIG_GILES section, add a line similar to the others.

If you don't create a directory for your plugin (just put it in an
existing one), you only have to add the two SOURCES_... lines to the
existing Modules.am file

By doing this, your module is declared, but it will never automatically
compile.

You then have to restart from the beginning the build sequence, so:
./bootstrap
./configure...
make

To build the module, you have to do it manually, by going to its
directory, and typing 
"make libyourmodule_plugin.so" (or .dll, I don't know what is the
extension with Cygwin)

To automatize the build of your module, you must ask this in the
configure.ac file.

If you want it to be always built, add it to the "default modules"
section (line 874 of configure.ac), in one AX_ADD_PLUGINS directive.

If you want to have a configure option (--enable-yourmodule), you have
to use a AC_ARG_ENABLE section... look at the existing ones.

2) In the code
--------------

You have to add
 - a module descriptor (this should be quite well documented in the API
   doc on the developers site)
 - One "open" (or something else, as set in set_callbacks) and one 
   "close" functions that initialize and free all you want.
 - One "Run" function that must do all the stuff and must check
   periodically that p_intf->b_die is not true.

I suggest you had a look at modules/misc/dummy/* (for the general
structure) and modules/gui/ncurses/ncurses.c (a quite simple complete
interface module with playlist interaction, progress bar, ...)

Good luck :)

-- 
Zorglub
Clément Stenac

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list