[vlc-devel] Proposal for a new hotkeys design (one more)

brezhoneg1 brezhoneg1 at yahoo.fr
Wed Nov 5 12:08:51 CET 2008



One more email about hotkeys.

It all comes down to choosing between two alternatives. Both are okay.

1- We think locally
-------------------
Every entity producing key-pressed (QT4 GUI, vout plugins, rc/luarc
modules, ... ) is responsible for processing them ** NO MORE libvlc
hotkeys **. One hotkeys thread per vout, one hotkeys thread for qt4
interface, ... A basic integer key-pressed is okay, because context is
known. Of course, keys can refer to actions at different levels
(locally, p_input, p_libvlc).


2- We think globally
--------------------
We decide to collect all key-pressed from all entities within an
instance into a single processing thread. This is today's situation.
This is okay. The only thing is to that key-pressed variable must be
changed to a {key-pressed + p_origin_object} variable (see previous
email). WE MUST NOT forget the origin of key-pressed.


In my previous email, I acknowledged the point that some var_AddCallback
( p_libvlc, ...) could expect a global management of hotkeys. I traced
those callbacks and I now think it should never occur.
I found three files :
   - modules/codec/zvbi.c
   - modules/access/vcdx/intf.c
   - modules/video_filter/remoteosd.c

- zvbi.c is managed by a decoder. Yet, It doesn't care where hotkeys
come from. It should be re-written to address the right p_input/p_vout.
- intf.c is a funny thing. It already implement local hotkeys .... that
does not exist (Changelog seems to say it existed back in 2003). 
- remoteosd.c would be happier with local p_vout (it manages both mouse
and key) and already knows about p_vout.

Conclusion:
----------

Callbacks must not be a problem. This falls back to the first patch I
wrote. One generic hotkeys module for all need called by all that
produce hotkeys.

Two ways of thinking, both are okay, (Personally, I find solution 1 is
nicer)







I reviewed when var_AddCallback( p_libvlc, "key-pressed", ..) are
called.

Those are:
    - modules/codec/zvbi.c
    - modules/access/vcdx/intf.c
    - modules/video_filter/remoteosd.c

zvbi.c's context is a decoder. Yet, It rely on key-pressed as at global
level to perform action. A sm





More information about the vlc-devel mailing list