]> git.sesse.net Git - vlc/blobdiff - modules/video_output/sdl.c
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / video_output / sdl.c
index 84af7d55df4e3731c464fcaca6c38ab00aba7e10..efebbff04601d404233f822500abf6b8da7dc941 100644 (file)
 #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
  *****************************************************************************/
@@ -73,7 +79,7 @@ vlc_module_end()
  * 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 *);
 
@@ -100,7 +106,6 @@ struct vout_display_sys_t {
 
     /* */
     picture_pool_t       *pool;
-    key_thread_t         *keys;
 };
 
 /**
@@ -111,6 +116,11 @@ static int Open(vlc_object_t *object)
     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);
 
@@ -328,14 +338,12 @@ static int Open(vlc_object_t *object)
 
     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:
@@ -362,8 +370,6 @@ static void Close(vlc_object_t *object)
     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);
 
@@ -432,7 +438,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 /**
  * 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;
 
@@ -602,7 +608,7 @@ static void Manage(vout_display_t *vd)
                 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;
         }
 
@@ -708,3 +714,4 @@ static int ConvertKey(SDLKey sdl_key)
     }
     return 0;
 }
+