summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-03 00:02:40 +0200
committerwm4 <wm4@nowhere>2015-04-03 00:13:41 +0200
commit8585845c648ea781269f3bd094f54a3b3674fc51 (patch)
treec8a315274183a67e1e7e3e841694f6a08afa0640
parent3d17b12d9cfb26975740d2038e848dfe1e302a75 (diff)
downloadmpv-8585845c648ea781269f3bd094f54a3b3674fc51.tar.bz2
mpv-8585845c648ea781269f3bd094f54a3b3674fc51.tar.xz
vf_format: allow forcing display size
-rw-r--r--DOCS/man/vf.rst5
-rw-r--r--video/filter/vf_format.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst
index fb8047c201..a40cd1eea3 100644
--- a/DOCS/man/vf.rst
+++ b/DOCS/man/vf.rst
@@ -314,6 +314,11 @@ Available filters are:
Set the rotation the video is assumed to be encoded with in degrees.
The special value ``-1`` uses the input format.
+ ``<dw>``, ``<dh>``
+ Set the display size. Note that setting the display size such that
+ the video is scaled in both directions instead of just changing the
+ aspect ratio is an implementation detail, and might change later.
+
``noformat[=fmt]``
Restricts the color space for the next filter without doing any conversion.
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index e8f1bf1489..eda35cd104 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -41,6 +41,7 @@ struct vf_priv_s {
int stereo_in;
int stereo_out;
int rotate;
+ int dw, dh;
};
static bool is_compatible(int fmt1, int fmt2)
@@ -99,6 +100,10 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
out->stereo_out = p->stereo_out;
if (p->rotate >= 0)
out->rotate = p->rotate;
+ if (p->dw > 0)
+ out->d_w = p->dw;
+ if (p->dh > 0)
+ out->d_h = p->dh;
// Make sure the user-overrides are consistent (no RGB csp for YUV, etc.).
mp_image_params_guess_csp(out);
@@ -133,6 +138,8 @@ static const m_option_t vf_opts_fields[] = {
OPT_CHOICE_C("stereo-in", stereo_in, 0, mp_stereo3d_names),
OPT_CHOICE_C("stereo-out", stereo_out, 0, mp_stereo3d_names),
OPT_INTRANGE("rotate", rotate, 0, -1, 359),
+ OPT_INT("dw", dw, 0),
+ OPT_INT("dh", dh, 0),
{0}
};