0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

options: move --colorkey option to vo_xv

This commit is contained in:
wm4 2013-07-22 01:03:22 +02:00
parent 549ef68c62
commit 5e0ee41617
5 changed files with 15 additions and 18 deletions

View File

@ -524,11 +524,6 @@
It is advisable to use your graphics driver's color range option
instead, if available.
``--colorkey=<number>``
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

View File

@ -54,6 +54,13 @@ Available video output drivers are:
auto
Let Xv draw the colorkey.
``colorkey=<number>``
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.

View File

@ -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}",

View File

@ -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;

View File

@ -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}
},
};