From 2aae5ce0bae31f97d2506c455596150fdea49b0b Mon Sep 17 00:00:00 2001 From: igv Date: Sun, 3 Jul 2016 15:06:41 +0300 Subject: vo_opengl: make size of a cropped source image available to user shaders --- video/out/opengl/video.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 49b99e90b5..b9764063c0 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1509,6 +1509,12 @@ static bool szexp_lookup(void *priv, struct bstr var, float size[2]) struct szexp_ctx *ctx = priv; struct gl_video *p = ctx->p; + if (bstr_equals0(var, "NATIVE_CROPPED")) { + size[0] = (p->src_rect.x1 - p->src_rect.x0) * p->texture_offset.m[0][0]; + size[1] = (p->src_rect.y1 - p->src_rect.y0) * p->texture_offset.m[1][1]; + return true; + } + // The size of OUTPUT is determined. It could be useful for certain // user shaders to skip passes. if (bstr_equals0(var, "OUTPUT")) { -- cgit v1.2.3