]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/common.c
vout: remove no longer used display size event parameter
[vlc] / modules / video_output / msw / common.c
index 665d30ecf05afda47fa5d1ad2432665b6660975e..f8c1ceb61526235062677d37bd19f561e412c4cb 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * common.c:
+ * common.c: Windows video output common code
  *****************************************************************************
  * Copyright (C) 2001-2009 VLC authors and VideoLAN
  * $Id$
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-
 /*****************************************************************************
- * Preamble: This file contains the functions related to the creation of
- *             a window and the handling of its messages (events).
+ * Preamble: This file contains the functions related to the init of the vout
+ *           structure, the common display code, the screensaver, but not the
+ *           events and the Window Creation (events.c)
  *****************************************************************************/
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -41,7 +42,7 @@
 #include <vlc_windows_interfaces.h>
 
 static void CommonChangeThumbnailClip(vout_display_t *, bool show);
-static int CommonControlSetFullscreen(vout_display_t *, bool is_fullscreen);
+static int  CommonControlSetFullscreen(vout_display_t *, bool is_fullscreen);
 
 static void DisableScreensaver(vout_display_t *);
 static void RestoreScreensaver(vout_display_t *);
@@ -62,6 +63,7 @@ int CommonInit(vout_display_t *vd)
     sys->is_on_top = false;
 
     var_Create(vd, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
+    var_Create(vd, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
 
     /* */
     sys->event = EventThreadCreate(vd);
@@ -76,11 +78,10 @@ int CommonInit(vout_display_t *vd)
 #ifdef MODULE_NAME_IS_directdraw
     cfg.use_overlay = sys->use_overlay;
 #endif
-    cfg.win.type   = VOUT_WINDOW_TYPE_HWND;
-    cfg.win.x      = var_InheritInteger(vd, "video-x");
-    cfg.win.y      = var_InheritInteger(vd, "video-y");
-    cfg.win.width  = vd->cfg->display.width;
-    cfg.win.height = vd->cfg->display.height;
+    cfg.x      = var_InheritInteger(vd, "video-x");
+    cfg.y      = var_InheritInteger(vd, "video-y");
+    cfg.width  = vd->cfg->display.width;
+    cfg.height = vd->cfg->display.height;
 
     event_hwnd_t hwnd;
     if (EventThreadStart(sys->event, &hwnd, &cfg))
@@ -97,8 +98,6 @@ int CommonInit(vout_display_t *vd)
             vout_display_SendEventFullscreen(vd, false);
     }
 
-    /* Why not with glwin32 */
-    var_Create(vd, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
     DisableScreensaver (vd);
 
     return VLC_SUCCESS;
@@ -213,7 +212,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
     /* fill in buffer info in first plane */
     picture->p->p_pixels = data;
     picture->p->i_pitch  = pitch;
-    picture->p->i_lines  = picture->format.i_height;
+    picture->p->i_lines  = picture->format.i_visible_height;
 
     /*  Fill chroma planes for planar YUV */
     if (picture->format.i_chroma == VLC_CODEC_I420 ||
@@ -226,7 +225,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
 
             p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
             p->i_pitch  = pitch / 2;
-            p->i_lines  = picture->format.i_height / 2;
+            p->i_lines  = picture->format.i_visible_height / 2;
         }
         /* The dx/d3d buffer is always allocated as YV12 */
         if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, VLC_CODEC_YV12)) {
@@ -329,8 +328,8 @@ void UpdateRects(vout_display_t *vd,
                                     point.x, point.y,
                                     rect.right, rect.bottom);
     if (is_resized)
-        vout_display_SendEventDisplaySize(vd, rect.right, rect.bottom, cfg->is_fullscreen);
-    if (!is_forced && !has_moved && !is_resized )
+        vout_display_SendEventDisplaySize(vd, rect.right, rect.bottom);
+    if (!is_forced && !has_moved && !is_resized)
         return;
 
     /* Update the window position and size */
@@ -403,8 +402,8 @@ void UpdateRects(vout_display_t *vd,
     /* src image dimensions */
     rect_src.left   = 0;
     rect_src.top    = 0;
-    rect_src.right  = source->i_width;
-    rect_src.bottom = source->i_height;
+    rect_src.right  = vd->fmt.i_visible_width;
+    rect_src.bottom = vd->fmt.i_visible_height;
 
     /* Clip the source image */
     rect_src_clipped.left = source->i_x_offset +
@@ -588,6 +587,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
                              rect_window.right - rect_window.left,
                              rect_window.bottom - rect_window.top, SWP_NOMOVE);
             }
+            return VLC_EGENERIC;
         }
         UpdateRects(vd, cfg, source, is_forced);
         return VLC_SUCCESS;