summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorBin Jin <bjin1990@gmail.com>2014-08-22 02:26:46 +0200
committerwm4 <wm4@nowhere>2014-08-22 14:22:04 +0200
commit96c2021cb1c4a83f16b1f7dafd4e175034a71fcb (patch)
tree680fcc7f981d8539ab82fa9b27c1673363185427 /video/filter
parente2d27cded79f01f20f536140163f8a87076ec8e2 (diff)
downloadmpv-96c2021cb1c4a83f16b1f7dafd4e175034a71fcb.tar.bz2
mpv-96c2021cb1c4a83f16b1f7dafd4e175034a71fcb.tar.xz
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.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_vapoursynth.c5
1 files changed, 5 insertions, 0 deletions
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)