changeset 14857:29a09f111b41

Remove -noxv and -forcexv command line options and replace them by suboptions to -vo sdl. Renamed noxv to nohwaccel to better reflect the meaning of the option. Updated manual page. Original patch by < ods15 at ods15 dot dyndns dot org> Modified by me.
author ivo
date Tue, 01 Mar 2005 03:51:48 +0000
parents 7b1198123519
children cc0c5443548d
files DOCS/man/en/mplayer.1 cfg-mplayer.h libvo/vo_sdl.c
diffstat 3 files changed, 31 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Tue Mar 01 03:49:04 2005 +0000
+++ b/DOCS/man/en/mplayer.1	Tue Mar 01 03:51:48 2005 +0000
@@ -2058,10 +2058,6 @@
 Override framebuffer mode configuration file (default: /etc/\:fb.modes).
 .
 .TP
-.B \-forcexv (\-vo sdl only)
-Force using XVideo through the sdl video output driver.
-.
-.TP
 .B \-fs (also see \-zoom)
 Fullscreen playback (centers movie, and paints black bands around it).
 Not supported by all video output drivers.
@@ -2201,10 +2197,6 @@
 Furthermore under X11 your window manager has to honor window aspect hints.
 .
 .TP
-.B \-noxv (\-vo sdl only)
-Disables using XVideo through the sdl video output driver.
-.
-.TP
 .B \-ontop\ 
 Makes the player window stay on top of other windows.
 Supported by video output drivers which use X11, except SDL,
@@ -2418,15 +2410,19 @@
 Considered obsolete.
 .
 .TP
-.B sdl (also see \-forcexv, \-noxv) (SDL only)
+.B sdl (SDL only)
 Highly platform independent SDL (Simple Directmedia Layer) library
 video output driver.
 Since SDL uses its own X11 layer, MPlayer X11 options do not have
 any effect on SDL.
 .PD 0
 .RSs
-.IPs <driver>
-Explicitly choose the SDL driver to use.
+.IPs driver=<driver>
+Explicitly choose the SDL driver to use (default: x11).
+.IPs (no)forcexv
+Use XVideo through the sdl video output driver (default: forcexv).
+.IPs (no)hwaccel
+Use hardware accelerated scaler (default: hwaccel).
 .RE
 .PD 1
 .
--- a/cfg-mplayer.h	Tue Mar 01 03:49:04 2005 +0000
+++ b/cfg-mplayer.h	Tue Mar 01 03:51:48 2005 +0000
@@ -22,12 +22,6 @@
 extern char *dfb_params;
 #endif
 #endif
-#ifdef HAVE_SDL
-//extern char *sdl_driver;
-extern int sdl_noxv;
-extern int sdl_forcexv;
-//extern char *sdl_adriver;
-#endif
 #ifdef USE_FAKE_MONO
 extern int fakemono; // defined in dec_audio.c
 #endif
@@ -199,15 +193,13 @@
 	    CONF_TYPE_PRINT, 0, 0, 0, NULL},
 #endif
 	// -vo sdl only:
-#ifdef HAVE_SDL
-	{"sdl", "Use -vo sdl:driver instead of -vo sdl -sdl driver.\n",
+	{"sdl", "Use -vo sdl:driver=<driver> instead of -vo sdl -sdl driver.\n",
 	    CONF_TYPE_PRINT, 0, 0, 0, NULL},
-	{"noxv", &sdl_noxv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-	{"forcexv", &sdl_forcexv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"noxv", "-noxv is deprecated. Use -vo sdl:nohwaccel instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
+	{"forcexv", "-forcexv is deprecated. Use -vo sdl:forcexv instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
 	// -ao sdl only:
 	{"sdla", "Use -ao sdl:driver instead of -ao sdl -sdla driver.\n",
 	    CONF_TYPE_PRINT, 0, 0, 0, NULL},
-#endif
 
 #if defined(HAVE_FBDEV)||defined(HAVE_VESA) 
        {"monitor-hfreq", &monitor_hfreq_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, 
--- a/libvo/vo_sdl.c	Tue Mar 01 03:49:04 2005 +0000
+++ b/libvo/vo_sdl.c	Tue Mar 01 03:51:48 2005 +0000
@@ -121,10 +121,9 @@
 
 #include "input/input.h"
 #include "input/mouse.h"
+#include "subopt-helper.h"
 
 extern int verbose;
-int sdl_noxv;
-int sdl_forcexv;
 
 static vo_info_t info = 
 {
@@ -1594,6 +1593,21 @@
 static uint32_t preinit(const char *arg)
 {
     struct sdl_priv_s *priv = &sdl_priv;
+    char * sdl_driver;
+    int sdl_hwaccel;
+    int sdl_forcexv;
+    opt_t subopts[] = {
+	    {"forcexv", OPT_ARG_BOOL,  &sdl_forcexv, NULL, 0},
+	    {"hwaccel", OPT_ARG_BOOL,  &sdl_hwaccel, NULL, 0},
+	    {"driver",  OPT_ARG_MSTRZ, &sdl_driver,  NULL, 0},
+	    {NULL, 0, NULL, NULL, 0}
+    };
+
+    sdl_forcexv = 1;
+    sdl_hwaccel = 1;
+    sdl_driver = strdup("x11");
+
+    if (subopt_parse(arg, subopts) != 0) return -1;
 
     priv->rgbsurface = NULL;
     priv->overlay = NULL;
@@ -1601,13 +1615,16 @@
 
     if(verbose > 2) printf("SDL: Opening Plugin\n");
 
-    if(arg) setenv("SDL_VIDEODRIVER", arg, 1);
+    if(sdl_driver) setenv("SDL_VIDEODRIVER", sdl_driver, 1);
+    free(sdl_driver);
 
     /* does the user want SDL to try and force Xv */
     if(sdl_forcexv)	setenv("SDL_VIDEO_X11_NODIRECTCOLOR", "1", 1);
+    else setenv("SDL_VIDEO_X11_NODIRECTCOLOR", "0", 1);
 
     /* does the user want to disable Xv and use software scaling instead */
-    if(sdl_noxv) setenv("SDL_VIDEO_YUV_HWACCEL", "0", 1);
+    if(sdl_hwaccel) setenv("SDL_VIDEO_YUV_HWACCEL", "1", 1);
+    else setenv("SDL_VIDEO_YUV_HWACCEL", "0", 1);
 
     /* default to no fullscreen mode, we'll set this as soon we have the avail. modes */
     priv->fullmode = -2;