[vlc-devel] [RFC] Module specific commands in the RC interface

Antoine Cellerier dionoea at videolan.org
Sat Mar 24 21:06:33 CET 2007

Having to edit the RC interface when ever we want to add a module
specific command is kind of burdensome. If a module could register
variables as commands, the RC interface code wouldn't need to be edited.

It is already possible to register a variable in VLC as a command (using
the VLC_VAR_ISCOMMAND flag when creating the variable). This is already
used by core commands 'list', 'tree' and 'vars' defined in
src/misc/objects.c for p_libvlc_global. Those work in the RC interface
because it checks if commands it receives are registered on the p_intf
and p_intf->pèlibvlc_global objects.

To make it possible to execute commands registered by other objects, we
need a way to specify which object we're targetting (We could also loop
through all the objects until we find one which qualifies ... but that
sounds like a bad idea). As some of you might have noticed, I commited
code this afternoon which makes it possible to name an object. For
example, if you use 'vlc --sub-filter marq at somename', the marq instance
will be named 'somename'. I suggest that we use this name to identify
the commands' destination object.

The syntax in the RC interface would thus be:
@objectname command [args]

(All core related commands would still be issued using the old syntax.)

This would break compatibility with older version (I already broke it
this afternoon ...) but fix two fundamental errors in the previous way
the marq, time, logo and mosaic commands were handled:
1/ Those objects should not use p_libvlc_global to store their
variables. (This makes it impossible to have more than one instance.)
2/ The RC interface code shouldn't need to be changed to add new

I already have code on my computer to make it work that way (which adds
support for 'adjust' filter commands). I'd like to know what you think
about this new syntax and commands handling before commiting it.

Antoine Cellerier

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list