]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/directx.c
Add a bunch of help strings. Feel free to correct them, and add more
[vlc] / modules / video_output / msw / directx.c
index 7b3b2ea896e2733cbf813ba2a98e2c554ee10348..be246c9e8c7d913f496b9dbc9d37661738764877 100644 (file)
@@ -34,9 +34,6 @@
  * display video in window mode.
  *
  *****************************************************************************/
-
-#include <errno.h>                                                 /* ENOMEM */
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -158,17 +155,16 @@ BOOL WINAPI DirectXEnumCallback2( GUID* p_guid, LPTSTR psz_desc,
     "window to open on. For example, \"\\\\.\\DISPLAY1\" or " \
     "\"\\\\.\\DISPLAY2\"." )
 
-#define WALLPAPER_TEXT N_("Enable wallpaper mode ")
-#define WALLPAPER_LONGTEXT N_( \
-    "The wallpaper mode allows you to display the video as the desktop " \
-    "background. Note that this feature only works in overlay mode and " \
-    "the desktop must not already have a wallpaper." )
+#define DX_HELP N_("Recommended video output for Windows XP. " \
+    "Incompatible with Vista's Aero interface" )
 
 static const char *const ppsz_dev[] = { "" };
 static const char *const ppsz_dev_text[] = { N_("Default") };
 
 vlc_module_begin ()
     set_shortname( "DirectX" )
+    set_description( N_("DirectX (DirectDraw) video output") )
+    set_help(DX_HELP)
     set_category( CAT_VIDEO )
     set_subcategory( SUBCAT_VIDEO_VOUT )
     add_bool( "directx-hw-yuv", true, NULL, HW_YUV_TEXT, HW_YUV_LONGTEXT,
@@ -183,10 +179,6 @@ vlc_module_begin ()
         change_string_list( ppsz_dev, ppsz_dev_text, FindDevicesCallback )
         change_action_add( FindDevicesCallback, N_("Refresh list") )
 
-    add_bool( "directx-wallpaper", false, NULL, WALLPAPER_TEXT, WALLPAPER_LONGTEXT,
-              true )
-
-    set_description( N_("DirectX (DirectDraw) video output") )
     set_capability( "video output", 100 )
     add_shortcut( "directx" )
     set_callbacks( OpenVideo, CloseVideo )
@@ -273,11 +265,11 @@ static int OpenVideo( vlc_object_t *p_this )
 
     /* Variable to indicate if the window should be on top of others */
     /* Trigger a callback right now */
-    var_Create( p_vout, "directx-wallpaper", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
+    var_Create( p_vout, "video-wallpaper", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
     val.psz_string = _("Wallpaper");
-    var_Change( p_vout, "directx-wallpaper", VLC_VAR_SETTEXT, &val, NULL );
-    var_AddCallback( p_vout, "directx-wallpaper", WallpaperCallback, NULL );
-    var_TriggerCallback( p_vout, "directx-wallpaper" );
+    var_Change( p_vout, "video-wallpaper", VLC_VAR_SETTEXT, &val, NULL );
+    var_AddCallback( p_vout, "video-wallpaper", WallpaperCallback, NULL );
+    var_TriggerCallback( p_vout, "video-wallpaper" );
 
     return VLC_SUCCESS;
 
@@ -381,7 +373,7 @@ static int Init( vout_thread_t *p_vout )
     {
         /* If it still didn't work then don't try to use an overlay */
         p_vout->output.i_chroma = i_chroma_backup;
-        p_vout->p_sys->b_using_overlay = 0;
+        p_vout->p_sys->b_using_overlay = false;
         msg_Warn( p_vout, "Could not initialize directx overlay" ) ;
         NewPictureVec( p_vout, p_vout->p_picture );
     }
@@ -397,6 +389,7 @@ static int Init( vout_thread_t *p_vout )
     else
         psz_fallback = VOUT_TITLE " (software RGB DirectX output)";
     EventThreadUpdateTitle( p_vout->p_sys->p_event, psz_fallback );
+    EventThreadUseOverlay( p_vout->p_sys->p_event, p_vout->p_sys->b_using_overlay );
 
     return VLC_SUCCESS;
 }
@@ -427,7 +420,7 @@ static void CloseVideo( vlc_object_t *p_this )
     vout_thread_t * p_vout = (vout_thread_t *)p_this;
 
     /* Make sure the wallpaper is restored */
-    var_DelCallback( p_vout, "directx-wallpaper", WallpaperCallback, NULL );
+    var_DelCallback( p_vout, "video-wallpaper", WallpaperCallback, NULL );
     SwitchWallpaperMode( p_vout, false );
 
     CommonClean( p_vout );
@@ -1819,11 +1812,9 @@ BOOL WINAPI DirectXEnumCallback2( GUID* p_guid, LPTSTR psz_desc,
 
     module_config_t *p_item = (module_config_t *)p_context;
 
-    p_item->ppsz_list =
-        (char **)realloc( p_item->ppsz_list,
+    p_item->ppsz_list = xrealloc( p_item->ppsz_list,
                           (p_item->i_list+2) * sizeof(char *) );
-    p_item->ppsz_list_text =
-        (char **)realloc( p_item->ppsz_list_text,
+    p_item->ppsz_list_text = xrealloc( p_item->ppsz_list_text,
                           (p_item->i_list+2) * sizeof(char *) );
 
     p_item->ppsz_list[p_item->i_list] = strdup( psz_drivername );
@@ -1903,8 +1894,8 @@ static int WallpaperCallback( vlc_object_t *p_this, char const *psz_cmd,
         {
             /* Modify playlist as well because the vout might have to be
              * restarted */
-            var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL );
-            var_Set( p_playlist, "directx-wallpaper", newval );
+            var_Create( p_playlist, "video-wallpaper", VLC_VAR_BOOL );
+            var_Set( p_playlist, "video-wallpaper", newval );
             pl_Release( p_vout );
         }