mirror of https://github.com/mpv-player/mpv
vf_d3d11vpp: add output format selection
This commit is contained in:
parent
c4d85fc0c4
commit
c2997aa7de
|
@ -691,6 +691,13 @@ Available mpv-only filters are:
|
|||
with hardware decoding. Software frames are automatically uploaded to hardware
|
||||
for processing.
|
||||
|
||||
``format``
|
||||
Convert to the selected image format, e.g., nv12, p010, etc. (default: don't change).
|
||||
Format names can be queried with ``--vf=d3d11vpp=format=help``.
|
||||
Note that only a limited subset is supported, and actual support depends
|
||||
on your hardware. Normally, this shouldn't be changed unless some
|
||||
processing only works with a specific format, in which case it can be
|
||||
selected here.
|
||||
``deint=<yes|no>``
|
||||
Whether deinterlacing is enabled (default: no).
|
||||
``scale``
|
||||
|
|
|
@ -79,6 +79,7 @@ struct opts {
|
|||
bool interlaced_only;
|
||||
int mode;
|
||||
int field_parity;
|
||||
int format;
|
||||
};
|
||||
|
||||
struct priv {
|
||||
|
@ -467,6 +468,9 @@ static void vf_d3d11vpp_process(struct mp_filter *vf)
|
|||
p->out_params.crop.y0 = lrintf(p->opts->scale * p->out_params.crop.y0);
|
||||
p->out_params.crop.y1 = lrintf(p->opts->scale * p->out_params.crop.y1);
|
||||
|
||||
if (p->opts->format)
|
||||
p->out_params.hw_subfmt = p->opts->format;
|
||||
|
||||
p->require_filtering = p->params.hw_subfmt != p->out_params.hw_subfmt ||
|
||||
p->params.w != p->out_params.w ||
|
||||
p->params.h != p->out_params.h;
|
||||
|
@ -599,6 +603,7 @@ fail:
|
|||
|
||||
#define OPT_BASE_STRUCT struct opts
|
||||
static const m_option_t vf_opts_fields[] = {
|
||||
{"format", OPT_IMAGEFORMAT(format)},
|
||||
{"deint", OPT_BOOL(deint_enabled)},
|
||||
{"scale", OPT_FLOAT(scale)},
|
||||
{"scaling-mode", OPT_CHOICE(scaling_mode,
|
||||
|
|
Loading…
Reference in New Issue