summaryrefslogtreecommitdiffstats
path: root/video/csputils.c
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 /video/csputils.c
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 'video/csputils.c')
-rw-r--r--video/csputils.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/video/csputils.c b/video/csputils.c
index c10cfe5a7c..f8613399c8 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -37,32 +37,36 @@
#include "mp_image.h"
#include "csputils.h"
-
-const char *const mp_csp_names[MP_CSP_COUNT] = {
- "auto",
- "bt.601",
- "bt.709",
- "smpte-240m",
- "bt.2020-ncl",
- "bt.2020-cl",
- "rgb",
- "xyz",
- "ycgco",
+#include "options/m_option.h"
+
+const struct m_opt_choice_alternatives mp_csp_names[] = {
+ {"auto", MP_CSP_AUTO},
+ {"bt.601", MP_CSP_BT_601},
+ {"bt.709", MP_CSP_BT_709},
+ {"smpte-240m", MP_CSP_SMPTE_240M},
+ {"bt.2020-ncl", MP_CSP_BT_2020_NC},
+ {"bt.2020-cl", MP_CSP_BT_2020_C},
+ {"rgb", MP_CSP_RGB},
+ {"xyz", MP_CSP_XYZ},
+ {"ycgco", MP_CSP_YCGCO},
+ {0}
};
-const char *const mp_csp_levels_names[MP_CSP_LEVELS_COUNT] = {
- "auto",
- "limited",
- "full",
+const struct m_opt_choice_alternatives mp_csp_levels_names[] = {
+ {"auto", MP_CSP_LEVELS_AUTO},
+ {"limited", MP_CSP_LEVELS_TV},
+ {"full", MP_CSP_LEVELS_PC},
+ {0}
};
-const char *const mp_csp_prim_names[MP_CSP_PRIM_COUNT] = {
- "auto",
- "bt.601-525",
- "bt.601-625",
- "bt.709",
- "bt.2020",
- "bt.470 m",
+const struct m_opt_choice_alternatives mp_csp_prim_names[] = {
+ {"auto", MP_CSP_PRIM_AUTO},
+ {"bt.601-525", MP_CSP_PRIM_BT_601_525},
+ {"bt.601-625", MP_CSP_PRIM_BT_601_625},
+ {"bt.709", MP_CSP_PRIM_BT_709},
+ {"bt.2020", MP_CSP_PRIM_BT_2020},
+ {"bt.470m", MP_CSP_PRIM_BT_470M},
+ {0}
};
const char *const mp_csp_trc_names[MP_CSP_TRC_COUNT] = {
@@ -81,10 +85,11 @@ const char *const mp_csp_equalizer_names[MP_CSP_EQ_COUNT] = {
"gamma",
};
-const char *const mp_chroma_names[MP_CHROMA_COUNT] = {
- "unknown",
- "mpeg2/4/h264",
- "mpeg1/jpeg",
+const struct m_opt_choice_alternatives mp_chroma_names[] = {
+ {"unknown", MP_CHROMA_AUTO},
+ {"mpeg2/4/h264",MP_CHROMA_LEFT},
+ {"mpeg1/jpeg", MP_CHROMA_CENTER},
+ {0}
};
// The short name _must_ match with what vf_stereo3d accepts (if supported).