[vlc-devel] [PATCH] - Proposal for a new hotkeys design

brezhoneg1 brezhoneg1 at yahoo.fr
Mon Oct 27 23:16:35 CET 2008


Hello,

   This patch is aimed at making hotkeys work with multiple inputs /
multiple windows.

   Up to now, a single hotkeys interface and two variables
"key-pressed/key-action" at the libvlc level are responsible for
collecting all key-pressed within an instance wherever they come from
(either vout windows or GUI interface). The hotkeys module then selects
the input from the playlist if available and a vout at random to display
OSD messages.

  This way of working prevents libvlc api and vlm from benefiting from
some hotkeys (their inputs are not attached to the playlist) and
potentially mixes up things for other hotkeys (e.g a vout is chosen at
random for snapshot Shift-S)

  This patch tries to solve the problem by replicating the three
elements (two variables "key-pressed"/"key-action" and the hotkeys
plugin) at the vout (video output)level.
- What existed at the libvlc level still exists to keep on servicing
key-pressed from the QT4 GUI
- Each vout (video output) entity has got its own
"key-pressed/key-action" and hotkeys plugin attached to it to service
key-pressed from the window it is in charge of.
In other words, this patch allows each window to have its own dedicated
hotkeys thread.

  For the time being, the same hotkeys code is used everywhere. In
future, we could imagine passing a hotkeys module name as an option and
fine tune hotkeys depending on windows. (vout for video / vout for
audio-visual / vout for display in a sout chain may not need the same
set of hotkeys). 

  Changes were made to the files here below (taken from the nightly
build vlc-snapshot-20081025.tar.bz)
  It has been done for X11(Linux) but can easily be extended to Windows
and Mac.  
  
   src/video_output/video_output.c
   src/video_output/vout_intf.c
   src/video_output/vout_internal.h
   modules/control/hotkeys.c
   modules/video_output/x11/xcommon.c

  Attached to this email, the diff -u.

  Feel free to comment, ack or nack this patch. I'm sending it just in
case that can help!
  It has been tested with success but still needs to be reviewed as I'm
no expert in vlc.

Erwan100
   





 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xcommon.c.diff
Type: application/octet-stream
Size: 391 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081027/d11cf401/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hotkeys.c.diff
Type: application/octet-stream
Size: 16332 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081027/d11cf401/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: video_output.c.diff
Type: application/octet-stream
Size: 3188 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081027/d11cf401/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vout_internal.h.diff
Type: application/octet-stream
Size: 389 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081027/d11cf401/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vout_intf.c.diff
Type: application/octet-stream
Size: 608 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081027/d11cf401/attachment-0004.obj>


More information about the vlc-devel mailing list