summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-30 23:52:28 +0200
committerwm4 <wm4@nowhere>2015-03-31 00:09:03 +0200
commit27715b7dd18c4a393b8483b8048cb957172e776b (patch)
tree1a0c9fbcab9591fd451f1525f5fe6613d15a7b7e /options/m_option.h
parent273afdc3a4dc775e427b282f0e30c9a6ae167e06 (diff)
downloadmpv-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.h')
-rw-r--r--options/m_option.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h
index 401d98473d..a07c5a1082 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -165,6 +165,9 @@ struct m_opt_choice_alternatives {
int value;
};
+const char *m_opt_choice_str(const struct m_opt_choice_alternatives *choices,
+ int value);
+
// For OPT_STRING_VALIDATE(). Behaves like m_option_type.parse().
typedef int (*m_opt_string_validate_fn)(struct mp_log *log, const m_option_t *opt,
struct bstr name, struct bstr param);
@@ -626,6 +629,11 @@ extern const char m_option_path_separator;
OPT_CHOICE_(__VA_ARGS__, .type = &m_option_type_choice)
#define OPT_CHOICE_(optname, varname, flags, choices, ...) \
OPT_GENERAL(int, optname, varname, flags, M_CHOICES(choices), __VA_ARGS__)
+// Variant which takes a pointer to struct m_opt_choice_alternatives directly
+#define OPT_CHOICE_C(optname, varname, flags, choices) \
+ OPT_GENERAL(int, optname, varname, flags, .priv = (void *) \
+ MP_EXPECT_TYPE(const struct m_opt_choice_alternatives*, choices), \
+ .type = &m_option_type_choice)
#define OPT_FLAGS(...) \
OPT_CHOICE_(__VA_ARGS__, .type = &m_option_type_flags)