From ee63c9c210683df9cbf17f7bbc5f4de8725260f3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Sep 2015 21:12:26 +0200 Subject: 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. --- player/command.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'player/command.c') 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"), -- cgit v1.2.3