summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/en/mplayer.118
-rw-r--r--cfg-mplayer.h14
-rw-r--r--libvo/vo_sdl.c25
3 files changed, 31 insertions, 26 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 02f604ea0b..11ec0cfdaf 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -2058,10 +2058,6 @@ VESA framebuffer doesn't support mode changing.
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 @@ Only works with the x11, xv, xmga, xvidix, directx video output drivers.
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 @@ Play video through the XFree86 Direct Graphics Access extension.
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
.
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 3f2b12ff8f..fb5c518a86 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -22,12 +22,6 @@ extern char *fb_mode_name;
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 @@ m_option_t mplayer_opts[]={
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},
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c
index 2fd4a8f10f..59e32ed84f 100644
--- a/libvo/vo_sdl.c
+++ b/libvo/vo_sdl.c
@@ -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 @@ uninit(void)
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 @@ static uint32_t preinit(const char *arg)
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;