summaryrefslogtreecommitdiffstats
path: root/video/out/vo_xv.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r--video/out/vo_xv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index fd8901da80..b40add2273 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -944,6 +944,16 @@ static int control(struct vo *vo, uint32_t request, void *data)
args->out_image = get_screenshot(vo);
return true;
}
+ case VOCTRL_WINDOW_TO_OSD_COORDS: {
+ float *c = data;
+ struct mp_rect *src = &ctx->src_rect;
+ struct mp_rect *dst = &ctx->dst_rect;
+ c[0] = av_clipf(c[0], dst->x0, dst->x1) - dst->x0;
+ c[1] = av_clipf(c[1], dst->y0, dst->y1) - dst->y0;
+ c[0] = c[0] / (dst->x1 - dst->x0) * (src->x1 - src->x0) + src->x0;
+ c[1] = c[1] / (dst->y1 - dst->y0) * (src->y1 - src->y0) + src->y0;
+ return VO_TRUE;
+ }
}
int events = 0;
int r = vo_x11_control(vo, &events, request, data);