summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-02 23:59:00 +0200
committerwm4 <wm4@nowhere>2015-04-03 00:12:30 +0200
commit28fa17dac66d29338d24bff217f31d38d494745c (patch)
treee4bec9153b2c66d16d3d63144c821ff94713a02a
parent14a530f4744fc7dee232bbb7c19218d1b0e00ef9 (diff)
downloadmpv-28fa17dac66d29338d24bff217f31d38d494745c.tar.bz2
mpv-28fa17dac66d29338d24bff217f31d38d494745c.tar.xz
vf_format: allow forcing rotation flags
-rw-r--r--DOCS/man/vf.rst4
-rw-r--r--video/filter/vf_format.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst
index 79055ec1a1..fb8047c201 100644
--- a/DOCS/man/vf.rst
+++ b/DOCS/man/vf.rst
@@ -310,6 +310,10 @@ Available filters are:
Set the stereo mode the video should be displayed as. Takes the
same values as the ``--video-stereo-mode`` option.
+ ``<rotate>``
+ Set the rotation the video is assumed to be encoded with in degrees.
+ The special value ``-1`` uses the input format.
+
``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 5731a6646b..e8f1bf1489 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -40,6 +40,7 @@ struct vf_priv_s {
int chroma_location;
int stereo_in;
int stereo_out;
+ int rotate;
};
static bool is_compatible(int fmt1, int fmt2)
@@ -96,6 +97,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
out->stereo_in = p->stereo_in;
if (p->stereo_out)
out->stereo_out = p->stereo_out;
+ if (p->rotate >= 0)
+ out->rotate = p->rotate;
// Make sure the user-overrides are consistent (no RGB csp for YUV, etc.).
mp_image_params_guess_csp(out);
@@ -129,6 +132,7 @@ static const m_option_t vf_opts_fields[] = {
OPT_CHOICE_C("chroma-location", chroma_location, 0, mp_chroma_names),
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),
{0}
};
@@ -138,4 +142,7 @@ const vf_info_t vf_info_format = {
.open = vf_open,
.priv_size = sizeof(struct vf_priv_s),
.options = vf_opts_fields,
+ .priv_defaults = &(const struct vf_priv_s){
+ .rotate = -1,
+ },
};