summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-29 21:12:26 +0200
committerwm4 <wm4@nowhere>2015-09-29 21:12:26 +0200
commitee63c9c210683df9cbf17f7bbc5f4de8725260f3 (patch)
tree4079022e388fb4ff4bf0dfefe03f0f4d3cffbe0c /player/command.c
parentb4491c00c4b514e925b6bbf501e26de801f28a39 (diff)
downloadmpv-ee63c9c210683df9cbf17f7bbc5f4de8725260f3.tar.bz2
mpv-ee63c9c210683df9cbf17f7bbc5f4de8725260f3.tar.xz
video: replace vf_format outputlevels option with global option
The vf_format suboption is replaced with --video-output-levels (a global option and property). In particular, the parameter is removed from mp_image_params. The mechanism is moved to the "video equalizer", which also handles common video output customization like brightness and contrast controls. The new code is slightly cleaner, and the top-level option is slightly more user-friendly than as vf_format sub-option.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index 6dcd200b29..44ffd170a6 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2370,18 +2370,19 @@ static int mp_property_framedrop(void *ctx, struct m_property *prop,
static int mp_property_video_color(void *ctx, struct m_property *prop,
int action, void *arg)
{
+ const char *name = prop->priv ? prop->priv : prop->name;
MPContext *mpctx = ctx;
if (!mpctx->d_video)
return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_SET: {
- if (video_set_colors(mpctx->d_video, prop->name, *(int *) arg) <= 0)
+ if (video_set_colors(mpctx->d_video, name, *(int *) arg) <= 0)
return M_PROPERTY_UNAVAILABLE;
break;
}
case M_PROPERTY_GET:
- if (video_get_colors(mpctx->d_video, prop->name, (int *)arg) <= 0)
+ if (video_get_colors(mpctx->d_video, name, (int *)arg) <= 0)
return M_PROPERTY_UNAVAILABLE;
// Write new value to option variable
mp_property_generic_option(mpctx, prop, M_PROPERTY_SET, arg);
@@ -2440,8 +2441,6 @@ static int property_imgparams(struct mp_image_params p, int action, void *arg)
SUB_PROP_STR(m_opt_choice_str(mp_csp_names, p.colorspace))},
{"colorlevels",
SUB_PROP_STR(m_opt_choice_str(mp_csp_levels_names, p.colorlevels))},
- {"outputlevels",
- SUB_PROP_STR(m_opt_choice_str(mp_csp_levels_names, p.outputlevels))},
{"primaries",
SUB_PROP_STR(m_opt_choice_str(mp_csp_prim_names, p.primaries))},
{"gamma",
@@ -3453,6 +3452,8 @@ static const struct m_property mp_properties[] = {
{"contrast", mp_property_video_color},
{"saturation", mp_property_video_color},
{"hue", mp_property_video_color},
+ {"video-output-levels", mp_property_video_color,
+ .priv = (void *)"output-levels"},
{"panscan", panscan_property_helper},
{"video-zoom", panscan_property_helper},
{"video-align-x", panscan_property_helper},
@@ -3563,7 +3564,6 @@ static const struct m_property mp_properties[] = {
M_PROPERTY_ALIAS("sub", "sid"),
M_PROPERTY_ALIAS("colormatrix", "video-params/colormatrix"),
M_PROPERTY_ALIAS("colormatrix-input-range", "video-params/colorlevels"),
- M_PROPERTY_ALIAS("colormatrix-output-range", "video-params/outputlevels"),
M_PROPERTY_ALIAS("colormatrix-primaries", "video-params/primaries"),
M_PROPERTY_ALIAS("colormatrix-gamma", "video-params/gamma"),