From 96c2021cb1c4a83f16b1f7dafd4e175034a71fcb Mon Sep 17 00:00:00 2001 From: Bin Jin Date: Fri, 22 Aug 2014 02:26:46 +0200 Subject: vf_vapoursynth: add display resolution support Add two new script environment variables 'video_in_dw' and 'video_in_dh', representing the display resolution of video. Along with video resolution, sample ratio aspect can be calculated in scripts. Currently it's impossible to change sample ratio aspect with single vapoursynth filter since '_SARNum' and '_SARDen' frame properties from output clip will be ignored. A following 'dsize' filter is necessary for this purpose. --- video/filter/vf_vapoursynth.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c index c8c9169a06..c9666438df 100644 --- a/video/filter/vf_vapoursynth.c +++ b/video/filter/vf_vapoursynth.c @@ -478,6 +478,9 @@ static int reinit_vs(struct vf_instance *vf) if (p->vsapi->propSetNode(vars, "video_in", p->in_node, 0)) goto error; + p->vsapi->propSetInt(vars, "video_in_dw", p->fmt_in.d_w, 0); + p->vsapi->propSetInt(vars, "video_in_dh", p->fmt_in.d_h, 0); + vsscript_setVariable(p->se, vars); if (vsscript_evaluateFile(&p->se, p->cfg_file, 0)) { @@ -519,6 +522,8 @@ static int config(struct vf_instance *vf, int width, int height, .imgfmt = fmt, .w = width, .h = height, + .d_w = d_width, + .d_h = d_height, }; if (reinit_vs(vf) < 0) -- cgit v1.2.3