diff options
author | wm4 <wm4@nowhere> | 2015-03-30 23:52:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-31 00:09:03 +0200 |
commit | 27715b7dd18c4a393b8483b8048cb957172e776b (patch) | |
tree | 1a0c9fbcab9591fd451f1525f5fe6613d15a7b7e /options/m_option.c | |
parent | 273afdc3a4dc775e427b282f0e30c9a6ae167e06 (diff) | |
download | mpv-27715b7dd18c4a393b8483b8048cb957172e776b.tar.bz2 mpv-27715b7dd18c4a393b8483b8048cb957172e776b.tar.xz |
video: move colorspace overrides to vf_format, simplify
Remove the colorspace-related top-level options, add them to vf_format.
They are rather obscure and not needed often, so it's better to get them
out of the way. In particular, this gets rid of the semi-complicated
logic in command.c (most of which was needed for OSD display and the
direct feedback from the VO). It removes the duplicated color-related
name mappings.
This removes the ability to write the colormatrix and related
properties. Since filters can be changed at runtime, there's no loss of
functionality, except that you can't cycle automatically through the
color constants anymore (but who needs to do this).
This also changes the type of the mp_csp_names and related variables, so
they can directly be used with OPT_CHOICE. This probably ended up a bit
awkward, for the sake of not adding a new option type which would have
used the previous format.
Diffstat (limited to 'options/m_option.c')
-rw-r--r-- | options/m_option.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/options/m_option.c b/options/m_option.c index 2b34c4e918..49d78a06d2 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -522,6 +522,16 @@ const struct m_option_type m_option_type_intpair = { .copy = copy_opt, }; +const char *m_opt_choice_str(const struct m_opt_choice_alternatives *choices, + int value) +{ + for (const struct m_opt_choice_alternatives *c = choices; c->name; c++) { + if (c->value == value) + return c->name; + } + return NULL; +} + static int clamp_choice(const m_option_t *opt, void *val) { int v = *(int *)val; |