mpv/video/out/vulkan
Philip Langdale 3f006eced4 options: Make validation and help possible for all option types
Today, validation is only possible for string type options. But there's
no particular reason why it needs to be restricted in this way, and
there are potential uses, to allow other options to be validated
without forcing the option to have to reimplement parsing from
scratch.

The first part, simply making the validation function an explicit
field instead of overloading priv is simple enough. But if we only do
that, then the validation function still needs to deal with the raw
pre-parsed string. Instead, we want to allow the value to be parsed
before it is validated. That in turn leads to us having validator
functions that should be type aware. Unfortunately, that means we need
to keep the explicit macro like OPT_STRING_VALIDATE() as a way to
enforce the correct typing of the function. Otherwise, we'd have to
have the validator take a void * and hope the implementation can cast
it correctly.

For help, we don't have this problem, as help doesn't look at the
value.

Then, we turn validators that are really help generators into explicit
help functions and where a validator is help + validation, we split
them into two parts.

I have, however, left functions that need to query information for both
help and validation as single functions to avoid code duplication.

In this change, I have not added an other OPT_FOO_VALIDATE() macros as
they are not needed, but I will add some in a separate change to
illustrate the pattern.
2021-03-28 19:46:27 +03:00
..
common.h vo_gpu: vulkan: use libplacebo instead 2019-04-21 23:55:22 +03:00
context.c options: Make validation and help possible for all option types 2021-03-28 19:46:27 +03:00
context.h wayland: only render if we have frame callback 2020-09-21 20:42:17 +00:00
context_android.c wayland: use callback flag + poll for buffer swap 2019-10-10 17:41:19 +00:00
context_wayland.c wayland: unify frame/presentation callback code 2020-12-14 22:44:43 +00:00
context_win.c wayland: use callback flag + poll for buffer swap 2019-10-10 17:41:19 +00:00
context_xlib.c wayland: use callback flag + poll for buffer swap 2019-10-10 17:41:19 +00:00
utils.c vo_gpu: vulkan: print libplacebo API ver 2020-07-16 09:41:09 +02:00
utils.h vo_gpu: vulkan: use libplacebo instead 2019-04-21 23:55:22 +03:00