#include <vlc_plugin.h>
#include <vlc_vout_display.h>
#include <vlc_picture_pool.h>
-#include "keythread.h"
#include <assert.h>
#include <SDL.h>
+#ifndef WIN32
+# ifdef X_DISPLAY_MISSING
+# error Xlib required due to XInitThreads
+# endif
+# include <vlc_xlib.h>
+#endif
+
/*****************************************************************************
* Module descriptor
*****************************************************************************/
* Local prototypes
*****************************************************************************/
static picture_pool_t *Pool (vout_display_t *, unsigned);
-static void Display(vout_display_t *, picture_t *);
+static void PictureDisplay(vout_display_t *, picture_t *);
static int Control(vout_display_t *, int, va_list);
static void Manage(vout_display_t *);
/* */
picture_pool_t *pool;
- key_thread_t *keys;
};
/**
vout_display_t *vd = (vout_display_t *)object;
vout_display_sys_t *sys;
+#ifndef WIN32
+ if (!vlc_xlib_init (object))
+ return VLC_EGENERIC;
+#endif
+
/* XXX: check for conflicts with the SDL audio output */
vlc_mutex_lock(&sdl_lock);
vd->pool = Pool;
vd->prepare = NULL;
- vd->display = Display;
+ vd->display = PictureDisplay;
vd->control = Control;
vd->manage = Manage;
/* */
vout_display_SendEventDisplaySize(vd, display_width, display_height, vd->cfg->is_fullscreen);
-
- sys->keys = vlc_CreateKeyThread (vd);
return VLC_SUCCESS;
error:
vout_display_t *vd = (vout_display_t *)object;
vout_display_sys_t *sys = vd->sys;
- vlc_DestroyKeyThread(sys->keys);
-
if (sys->pool)
picture_pool_Delete(sys->pool);
/**
* Display a picture
*/
-static void Display(vout_display_t *vd, picture_t *p_pic)
+static void PictureDisplay(vout_display_t *vd, picture_t *p_pic)
{
vout_display_sys_t *sys = vd->sys;
key |= KEY_MODIFIER_CTRL;
if (event.key.keysym.mod & KMOD_ALT)
key |= KEY_MODIFIER_ALT;
- vlc_EmitKey(sys->keys, key);
+ vout_display_SendEventKey(vd, key);
break;
}
}
return 0;
}
+