Commit e3866e72 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

SDL: use key thread (partially fix #3661)

(cherry picked from commit a0c1d2ccdd62ef333e30f2fc9717fd0bf44ec4a3)

Conflicts:

	modules/video_output/Modules.am
parent c09621d2
...@@ -9,7 +9,7 @@ SOURCES_caca = caca.c ...@@ -9,7 +9,7 @@ SOURCES_caca = caca.c
SOURCES_fb = fb.c SOURCES_fb = fb.c
SOURCES_omapfb = omapfb.c SOURCES_omapfb = omapfb.c
SOURCES_ggi = ggi.c SOURCES_ggi = ggi.c
SOURCES_vout_sdl = sdl.c SOURCES_vout_sdl = sdl.c keythread.h keythread.c
SOURCES_svgalib = svgalib.c SOURCES_svgalib = svgalib.c
SOURCES_hd1000v = hd1000v.cpp SOURCES_hd1000v = hd1000v.cpp
SOURCES_snapshot = snapshot.c SOURCES_snapshot = snapshot.c
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_vout_display.h> #include <vlc_vout_display.h>
#include <vlc_picture_pool.h> #include <vlc_picture_pool.h>
#include "keythread.h"
#include <assert.h> #include <assert.h>
...@@ -99,6 +100,7 @@ struct vout_display_sys_t { ...@@ -99,6 +100,7 @@ struct vout_display_sys_t {
/* */ /* */
picture_pool_t *pool; picture_pool_t *pool;
key_thread_t *keys;
}; };
/** /**
...@@ -331,6 +333,8 @@ static int Open(vlc_object_t *object) ...@@ -331,6 +333,8 @@ static int Open(vlc_object_t *object)
/* */ /* */
vout_display_SendEventDisplaySize(vd, display_width, display_height, vd->cfg->is_fullscreen); vout_display_SendEventDisplaySize(vd, display_width, display_height, vd->cfg->is_fullscreen);
sys->keys = vlc_CreateKeyThread (vd);
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
...@@ -357,6 +361,8 @@ static void Close(vlc_object_t *object) ...@@ -357,6 +361,8 @@ static void Close(vlc_object_t *object)
vout_display_t *vd = (vout_display_t *)object; vout_display_t *vd = (vout_display_t *)object;
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
vlc_DestroyKeyThread(sys->keys);
if (sys->pool) if (sys->pool)
picture_pool_Delete(sys->pool); picture_pool_Delete(sys->pool);
...@@ -595,7 +601,7 @@ static void Manage(vout_display_t *vd) ...@@ -595,7 +601,7 @@ static void Manage(vout_display_t *vd)
key |= KEY_MODIFIER_CTRL; key |= KEY_MODIFIER_CTRL;
if (event.key.keysym.mod & KMOD_ALT) if (event.key.keysym.mod & KMOD_ALT)
key |= KEY_MODIFIER_ALT; key |= KEY_MODIFIER_ALT;
vout_display_SendEventKey(vd, key); vlc_EmitKey(sys->keys, key);
break; break;
} }
...@@ -701,4 +707,3 @@ static int ConvertKey(SDLKey sdl_key) ...@@ -701,4 +707,3 @@ static int ConvertKey(SDLKey sdl_key)
} }
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment