vf_format: allow forcing stereo mode parameters

This commit is contained in:
wm4 2015-04-02 23:57:56 +02:00
parent 5a2825ec35
commit 14a530f474
2 changed files with 16 additions and 0 deletions

View File

@ -302,6 +302,14 @@ Available filters are:
:bt.709: ITU-R BT.709 (HD) (same primaries as sRGB)
:bt.2020: ITU-R BT.2020 (UHD)
``<stereo-in>``
Set the stereo mode the video is assumed to be encoded in. Takes the
same values as the ``--video-stereo-mode`` option.
``<stereo-out>``
Set the stereo mode the video should be displayed as. Takes the
same values as the ``--video-stereo-mode`` option.
``noformat[=fmt]``
Restricts the color space for the next filter without doing any conversion.

View File

@ -38,6 +38,8 @@ struct vf_priv_s {
int outputlevels;
int primaries;
int chroma_location;
int stereo_in;
int stereo_out;
};
static bool is_compatible(int fmt1, int fmt2)
@ -90,6 +92,10 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
out->primaries = p->primaries;
if (p->chroma_location)
out->chroma_location = p->chroma_location;
if (p->stereo_in)
out->stereo_in = p->stereo_in;
if (p->stereo_out)
out->stereo_out = p->stereo_out;
// Make sure the user-overrides are consistent (no RGB csp for YUV, etc.).
mp_image_params_guess_csp(out);
@ -121,6 +127,8 @@ static const m_option_t vf_opts_fields[] = {
OPT_CHOICE_C("outputlevels", outputlevels, 0, mp_csp_levels_names),
OPT_CHOICE_C("primaries", primaries, 0, mp_csp_prim_names),
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),
{0}
};