]> git.sesse.net Git - vlc/blobdiff - modules/video_output/sdl.c
Fixed video display with directx and multiple monitors.
[vlc] / modules / video_output / sdl.c
index bb25cb861a576d6fe0cff936f0b2ccbb2e7f43fe..ea78cfe285667ca8ac42d089a8dc914815803520 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <assert.h>
 
-#include <SDL/SDL.h>
+#include <SDL.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -51,10 +51,6 @@ static void Close(vlc_object_t *);
     "Force the SDL renderer to use a specific chroma format instead of " \
     "trying to improve performances by using the most efficient one.")
 
-#define DRIVER_TEXT N_("SDL video driver name")
-#define DRIVER_LONGTEXT N_(\
-    "Force a specific SDL video output driver.")
-
 vlc_module_begin()
     set_shortname("SDL")
     set_category(CAT_VIDEO)
@@ -63,13 +59,11 @@ vlc_module_begin()
     set_capability("vout display", 60)
     add_shortcut("sdl")
     add_string("sdl-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true)
-#ifdef HAVE_SETENV
-    add_string("sdl-video-driver", NULL, NULL, DRIVER_TEXT, DRIVER_LONGTEXT, true)
-#endif
+    add_obsolete_string("sdl-video-driver") /* obsolete since 1.1.0 */
     set_callbacks(Open, Close)
 #if defined(__i386__) || defined(__x86_64__)
     /* On i386, SDL is linked against svgalib */
-    linked_with_a_crap_library_which_uses_atexit()
+    cannot_unload_broken_library()
 #endif
 vlc_module_end()
 
@@ -77,10 +71,10 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage(vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage(vout_display_t *);
 
 /* */
 static int ConvertKey(SDLKey);
@@ -130,14 +124,6 @@ static int Open(vlc_object_t *object)
         return VLC_ENOMEM;
     }
 
-#ifdef HAVE_SETENV
-    char *psz_driver = var_CreateGetNonEmptyString(vd, "sdl-video-driver");
-    if (psz_driver) {
-        setenv("SDL_VIDEODRIVER", psz_driver, 1);
-        free(psz_driver);
-    }
-#endif
-
     /* */
     int sdl_flags = SDL_INIT_VIDEO;
 #ifndef WIN32
@@ -337,7 +323,7 @@ static int Open(vlc_object_t *object)
     vd->fmt = fmt;
     vd->info = info;
 
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -389,11 +375,12 @@ static void Close(vlc_object_t *object)
 }
 
 /**
- * Return a direct buffer
+ * Return a pool of direct buffers
  */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
+    VLC_UNUSED(count);
 
     if (!sys->pool) {
         picture_resource_t rsc;
@@ -430,11 +417,9 @@ static picture_t *Get(vout_display_t *vd)
             return NULL;
 
         sys->pool = picture_pool_New(1, &picture);
-        if (!sys->pool)
-            return NULL;
     }
 
-    return picture_pool_Get(sys->pool);
+    return sys->pool;
 }
 
 /**
@@ -557,7 +542,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
     }
 
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
-    case VOUT_DISPLAY_CHANGE_ON_TOP:
+    case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
         /* I don't think it is possible to support with SDL:
          * - crop
          * - on top