]> git.sesse.net Git - vlc/blobdiff - modules/video_output/sdl.c
vmem: remove stub controls
[vlc] / modules / video_output / sdl.c
index e431b0a0f42afbf1e207d7aabcbe5faa798a528a..211ab5cde101cf2110ea8075af5e4a83497b3037 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * sdl.c: SDL video output display method
  *****************************************************************************
- * Copyright (C) 1998-2009 the VideoLAN team
+ * Copyright (C) 1998-2009 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
@@ -9,19 +9,19 @@
  *          Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
  *          Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -40,7 +40,7 @@
 
 #include <SDL.h>
 
-#ifndef WIN32
+#if !defined(_WIN32) && !defined(__OS2__)
 # ifdef X_DISPLAY_MISSING
 #  error Xlib required due to XInitThreads
 # endif
@@ -116,7 +116,7 @@ static int Open(vlc_object_t *object)
     vout_display_t *vd = (vout_display_t *)object;
     vout_display_sys_t *sys;
 
-#ifndef WIN32
+#if !defined(_WIN32) && !defined(__OS2__)
     if (!vlc_xlib_init (object))
         return VLC_EGENERIC;
 #endif
@@ -138,7 +138,7 @@ static int Open(vlc_object_t *object)
 
     /* */
     int sdl_flags = SDL_INIT_VIDEO;
-#ifndef WIN32
+#ifndef _WIN32
     /* Win32 SDL implementation doesn't support SDL_INIT_EVENTTHREAD yet*/
     sdl_flags |= SDL_INIT_EVENTTHREAD;
 #endif
@@ -164,7 +164,8 @@ static int Open(vlc_object_t *object)
     sys->desktop_height = SDL_GetVideoInfo()->current_h;
 
     /* */
-    video_format_t fmt = vd->fmt;
+    video_format_t fmt;
+    video_format_ApplyRotation(&fmt, &vd->fmt);
 
     /* */
     vout_display_info_t info = vd->info;
@@ -638,11 +639,11 @@ static void Manage(vout_display_t *vd)
             if (sys->place.width <= 0 || sys->place.height <= 0)
                 break;
 
-            const int x = (int64_t)(event.motion.x - sys->place.x) * vd->source.i_width  / sys->place.width;
-            const int y = (int64_t)(event.motion.y - sys->place.y) * vd->source.i_height / sys->place.height;
-
             SDL_ShowCursor(1);
-            vout_display_SendEventMouseMoved(vd, x, y);
+
+            vout_display_SendMouseMovedDisplayCoordinates(vd, ORIENT_NORMAL,
+                                                          event.motion.x, event.motion.y,
+                                                          &sys->place);
             break;
         }