History

vf_d3d11vpp: add output format selection

Kacper Michajłow committed 2 years ago

Commit c2997aa1 parent c4d85fc2 files · +12 −0Browse files

Unified · Split

2 files
  1. DOCS/man/vf.rst +7 −0
  2. video/filter/vf_d3d11vpp.c +5 −0
DOCS/man/vf.rst+7−0
@@ -691,6 +691,13 @@ Available mpv-only filters are: · 690 unmodified lines
691691 with hardware decoding. Software frames are automatically uploaded to hardware
692692 for processing.
693693
694+ ``format``
695+ Convert to the selected image format, e.g., nv12, p010, etc. (default: don't change).
696+ Format names can be queried with ``--vf=d3d11vpp=format=help``.
697+ Note that only a limited subset is supported, and actual support depends
698+ on your hardware. Normally, this shouldn't be changed unless some
699+ processing only works with a specific format, in which case it can be
700+ selected here.
694701 ``deint=<yes|no>``
695702 Whether deinterlacing is enabled (default: no).
696703 ``scale``
video/filter/vf_d3d11vpp.c+5−0
@@ -79,6 +79,7 @@ struct opts { · 78 unmodified lines
7979 bool interlaced_only;
8080 int mode;
8181 int field_parity;
82+ int format;
8283 };
8384
8485 struct priv {
@@ -467,6 +468,9 @@ static void vf_d3d11vpp_process(struct mp_filter *vf) · 382 unmodified lines
467468 p->out_params.crop.y0 = lrintf(p->opts->scale * p->out_params.crop.y0);
468469 p->out_params.crop.y1 = lrintf(p->opts->scale * p->out_params.crop.y1);
469470
471+ if (p->opts->format)
472+ p->out_params.hw_subfmt = p->opts->format;
473+
470474 p->require_filtering = p->params.hw_subfmt != p->out_params.hw_subfmt ||
471475 p->params.w != p->out_params.w ||
472476 p->params.h != p->out_params.h;
@@ -599,6 +603,7 @@ fail: · 126 unmodified lines
599603
600604 #define OPT_BASE_STRUCT struct opts
601605 static const m_option_t vf_opts_fields[] = {
606+ {"format", OPT_IMAGEFORMAT(format)},
602607 {"deint", OPT_BOOL(deint_enabled)},
603608 {"scale", OPT_FLOAT(scale)},
604609 {"scaling-mode", OPT_CHOICE(scaling_mode,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t