From 5e0ee41617387118deb463663176fb4d52a0a6e3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Jul 2013 01:03:22 +0200 Subject: options: move --colorkey option to vo_xv --- DOCS/man/en/options.rst | 9 --------- DOCS/man/en/vo.rst | 7 +++++++ core/options.c | 4 ---- core/options.h | 2 -- video/out/vo_xv.c | 11 ++++++++--- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index 394cc720f4..975139fdd9 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -524,11 +524,6 @@ It is advisable to use your graphics driver's color range option instead, if available. -``--colorkey=`` - Changes the colorkey to an RGB value of your choice. ``0x000000`` is black - and ``0xffffff`` is white. Only supported by the ``xv`` (see - ``--vo=xv:ck``) video output driver. See also ``--no-colorkey``. - ``--consolecontrols``, ``--no-consolecontrols`` ``--no-consolecontrols`` prevents the player from reading key events from standard input. Useful when reading data from standard input. This is @@ -1280,10 +1275,6 @@ ``--no-cache`` Turn off input stream caching. See ``--cache``. -``--no-colorkey`` - Disables colorkeying. Only supported by the xv (see ``--vo=xv:ck``) video - output driver. - ``--no-config`` Do not load default configuration files. This prevents loading of ``~/.mpv/config`` and ``~/.mpv/input.conf``, as well as loading the diff --git a/DOCS/man/en/vo.rst b/DOCS/man/en/vo.rst index 3f648b55fe..8f314f9b64 100644 --- a/DOCS/man/en/vo.rst +++ b/DOCS/man/en/vo.rst @@ -54,6 +54,13 @@ Available video output drivers are: auto Let Xv draw the colorkey. + ``colorkey=`` + Changes the colorkey to an RGB value of your choice. ``0x000000`` is + black and ``0xffffff`` is white. + + ``no-colorkey`` + Disables colorkeying. + ``x11`` (X11 only) Shared memory video output driver without hardware acceleration that works whenever X11 is present. diff --git a/core/options.c b/core/options.c index 2fa6e319ab..cce36b90bb 100644 --- a/core/options.c +++ b/core/options.c @@ -557,8 +557,6 @@ const m_option_t mp_opts[] = { OPT_FLAG("fs", vo.fullscreen, 0), // set fullscreen switch method (workaround for buggy WMs) OPT_INTRANGE("fsmode-dontuse", vo.fsmode, 0, 31, 4096), - OPT_INT("colorkey", vo.colorkey, 0), - OPT_FLAG_STORE("no-colorkey", vo.colorkey, 0, 0x1000000), OPT_FLAG("native-keyrepeat", vo.native_keyrepeat, 0), OPT_FLOATRANGE("panscan", vo.panscan, 0, 0.0, 1.0), OPT_FLOATRANGE("panscanrange", vo.panscanrange, 0, -19.0, 99.0), @@ -739,8 +737,6 @@ const struct MPOpts mp_default_opts = { .panscan = 0.0f, .keepaspect = 1, .border = 1, - .colorkey = 0x0000ff00, // default colorkey is green - // (0xff000000 means that colorkey has been disabled) .WinID = -1, }, .wintitle = "mpv - ${media-title}", diff --git a/core/options.h b/core/options.h index 212c3c79c9..e7f04b548c 100644 --- a/core/options.h +++ b/core/options.h @@ -29,8 +29,6 @@ typedef struct mp_vo_opts { int keepaspect; int border; - int colorkey; - int nomouse_input; int enable_mouse_movements; int cursor_autohide_delay; diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index d9ffa8104f..180dfc1d85 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -76,6 +76,7 @@ struct xvctx { int method; // CK_METHOD_* constants int source; // CK_SRC_* constants } xv_ck_info; + int colorkey; unsigned long xv_colorkey; int xv_port; int cfg_xv_adaptor; @@ -326,7 +327,7 @@ static int xv_init_colorkey(struct vo *vo) /* check if colorkeying is needed */ xv_atom = xv_intern_atom_if_exists(vo, "XV_COLORKEY"); - if (xv_atom != None && !(vo->opts->colorkey & 0xFF000000)) { + if (xv_atom != None && !(ctx->colorkey & 0xFF000000)) { if (ctx->xv_ck_info.source == CK_SRC_CUR) { int colorkey_ret; @@ -340,14 +341,14 @@ static int xv_init_colorkey(struct vo *vo) return 0; // error getting colorkey } } else { - ctx->xv_colorkey = vo->opts->colorkey; + ctx->xv_colorkey = ctx->colorkey; /* check if we have to set the colorkey too */ if (ctx->xv_ck_info.source == CK_SRC_SET) { xv_atom = XInternAtom(display, "XV_COLORKEY", False); rez = XvSetPortAttribute(display, ctx->xv_port, xv_atom, - vo->opts->colorkey); + ctx->colorkey); if (rez != Success) { mp_msg(MSGT_VO, MSGL_FATAL, "[xv] Couldn't set colorkey!\n"); return 0; // error setting colorkey @@ -899,6 +900,8 @@ const struct vo_driver video_out_xv = { .priv_defaults = &(const struct xvctx) { .cfg_xv_adaptor = -1, .xv_ck_info = {CK_METHOD_MANUALFILL, CK_SRC_CUR}, + .colorkey = 0x0000ff00, // default colorkey is green + // (0xff000000 means that colorkey has been disabled) }, .options = (const struct m_option[]) { OPT_INT("port", xv_port, M_OPT_MIN, .min = 0), @@ -911,6 +914,8 @@ const struct vo_driver video_out_xv = { ({"bg", CK_METHOD_BACKGROUND}, {"man", CK_METHOD_MANUALFILL}, {"auto", CK_METHOD_AUTOPAINT})), + OPT_INT("colorkey", colorkey, 0), + OPT_FLAG_STORE("no-colorkey", colorkey, 0, 0x1000000), {0} }, }; -- cgit v1.2.3