From 75298d9f0afa4adda99cf32459bb68f7967960f7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 17 Aug 2013 19:57:18 +0200 Subject: vo_vdpau: allow setting colorkey Formally, this sets the "background color" of the presentation queue. But in practice, this color is also used as colorkey. This commit doesn't change the VDPAU default yet. --- video/out/vo_vdpau.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'video/out/vo_vdpau.c') diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 588a1ceac5..addb155c56 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -72,6 +72,8 @@ struct vdpctx { struct vdp_functions *vdp; VdpDevice vdp_device; + struct m_color colorkey; + bool is_preempted; bool preemption_acked; bool preemption_user_notified; @@ -489,6 +491,18 @@ static int win_x11_init_vdpau_flip_queue(struct vo *vo) CHECK_ST_ERROR("Error when calling vdp_presentation_queue_create"); } + if (vc->colorkey.a > 0) { + VdpColor color = { + .red = vc->colorkey.r / 255.0, + .green = vc->colorkey.g / 255.0, + .blue = vc->colorkey.b / 255.0, + .alpha = 0, + }; + vdp_st = vdp->presentation_queue_set_background_color(vc->flip_queue, + &color); + CHECK_ST_WARNING("Error setting colorkey"); + } + VdpTime vdp_time; vdp_st = vdp->presentation_queue_get_time(vc->flip_queue, &vdp_time); CHECK_ST_ERROR("Error when calling vdp_presentation_queue_get_time"); @@ -1542,6 +1556,7 @@ const struct vo_driver video_out_vdpau = { OPT_INT("queuetime_fs", flip_offset_fs, 0, OPTDEF_INT(50)), OPT_INTRANGE("output_surfaces", num_output_surfaces, 0, 2, MAX_OUTPUT_SURFACES, OPTDEF_INT(3)), + OPT_COLOR("colorkey", colorkey, 0), {NULL}, } }; -- cgit v1.2.3