]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/wingdi.c
Merge commit 'origin/1.0-bugfix'
[vlc] / modules / video_output / msw / wingdi.c
index af58156f9beb93f2e29f19504f4300a6d102d6f5..706aded1725d59e795381d183d84c8e4e55f4842 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * wingdi.c : Win32 / WinCE GDI video output plugin for vlc
  *****************************************************************************
- * Copyright (C) 2002 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
@@ -36,6 +36,8 @@
 #include <vlc_playlist.h>
 #include <vlc_vout.h>
 
+#include <windows.h>
+#include <tchar.h>
 #include <commctrl.h>
 
 /*#ifdef MODULE_NAME_IS_wingapi
@@ -69,7 +71,7 @@
 #       define kfDirect444      0x200
 #       define kfDirectInverted 0x400
 #   endif
-#endif /* MODULE_NAME_IS_wingapi */
+#endif */ /* MODULE_NAME_IS_wingapi */
 
 #include "vout.h"
 
@@ -145,11 +147,9 @@ vlc_module_end ()
 static int OpenVideo ( vlc_object_t *p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *)p_this;
-    vlc_value_t val;
 
-    p_vout->p_sys = (vout_sys_t *)malloc( sizeof(vout_sys_t) );
+    p_vout->p_sys = (vout_sys_t *)calloc( 1, sizeof(vout_sys_t) );
     if( !p_vout->p_sys ) return VLC_ENOMEM;
-    memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
 #ifdef MODULE_NAME_IS_wingapi
     /* Load GAPI */
@@ -268,15 +268,13 @@ static int OpenVideo ( vlc_object_t *p_this )
 #ifndef UNDER_CE
     /* Variable to indicate if the window should be on top of others */
     /* Trigger a callback right now */
-    var_Get( p_vout, "video-on-top", &val );
-    var_Set( p_vout, "video-on-top", val );
+    var_TriggerCallback( p_vout, "video-on-top" );
 
     /* disable screensaver by temporarily changing system settings */
     p_vout->p_sys->i_spi_lowpowertimeout = 0;
     p_vout->p_sys->i_spi_powerofftimeout = 0;
     p_vout->p_sys->i_spi_screensavetimeout = 0;
-    var_Get( p_vout, "disable-screensaver", &val);
-    if( val.b_bool ) {
+    if( var_GetBool( p_vout, "disable-screensaver" ) ) {
         msg_Dbg(p_vout, "disabling screen saver");
         SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
             0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
@@ -381,29 +379,29 @@ static int Init( vout_thread_t *p_vout )
     switch( p_vout->p_sys->i_depth )
     {
     case 8:
-        p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+        p_vout->output.i_chroma = VLC_CODEC_RGB8;
         p_vout->output.pf_setpalette = SetPalette;
         break;
     case 15:
-        p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+        p_vout->output.i_chroma = VLC_CODEC_RGB15;
         p_vout->output.i_rmask  = 0x7c00;
         p_vout->output.i_gmask  = 0x03e0;
         p_vout->output.i_bmask  = 0x001f;
         break;
     case 16:
-        p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+        p_vout->output.i_chroma = VLC_CODEC_RGB16;
         p_vout->output.i_rmask  = 0xf800;
         p_vout->output.i_gmask  = 0x07e0;
         p_vout->output.i_bmask  = 0x001f;
         break;
     case 24:
-        p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+        p_vout->output.i_chroma = VLC_CODEC_RGB24;
         p_vout->output.i_rmask  = 0x00ff0000;
         p_vout->output.i_gmask  = 0x0000ff00;
         p_vout->output.i_bmask  = 0x000000ff;
         break;
     case 32:
-        p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+        p_vout->output.i_chroma = VLC_CODEC_RGB32;
         p_vout->output.i_rmask  = 0x00ff0000;
         p_vout->output.i_gmask  = 0x0000ff00;
         p_vout->output.i_bmask  = 0x000000ff;