summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-22 01:03:22 +0200
committerwm4 <wm4@nowhere>2013-07-22 01:50:22 +0200
commit5e0ee41617387118deb463663176fb4d52a0a6e3 (patch)
tree36692118cfc93049b49f7312c574e819670c4b0d /video
parent549ef68c62f2585d7818003cc2e57d82c7e46714 (diff)
downloadmpv-5e0ee41617387118deb463663176fb4d52a0a6e3.tar.bz2
mpv-5e0ee41617387118deb463663176fb4d52a0a6e3.tar.xz
options: move --colorkey option to vo_xv
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_xv.c11
1 files changed, 8 insertions, 3 deletions
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}
},
};