mirror of https://github.com/mpv-player/mpv
Move vo_gamma_* to options struct
This commit is contained in:
parent
a0de759a21
commit
4db72f6a80
|
@ -211,10 +211,10 @@ const m_option_t mplayer_opts[]={
|
|||
|
||||
{"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, -2, 32, NULL},
|
||||
|
||||
{"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||
{"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||
{"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||
{"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||
OPT_INTRANGE("brightness", vo_gamma_brightness, 0, -100, 100),
|
||||
OPT_INTRANGE("saturation", vo_gamma_saturation, 0, -100, 100),
|
||||
OPT_INTRANGE("contrast", vo_gamma_contrast, 0, -100, 100),
|
||||
OPT_INTRANGE("hue", vo_gamma_hue, 0, -100, 100),
|
||||
{"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"nokeepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
|
||||
|
|
13
command.c
13
command.c
|
@ -1127,7 +1127,8 @@ static int mp_property_framedropping(m_option_t *prop, int action,
|
|||
static int mp_property_gamma(m_option_t *prop, int action, void *arg,
|
||||
MPContext *mpctx)
|
||||
{
|
||||
int *gamma = prop->priv, r, val;
|
||||
int *gamma = (int *)((char *)&mpctx->opts + (int)prop->priv);
|
||||
int r, val;
|
||||
|
||||
if (!mpctx->sh_video)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
|
@ -2026,15 +2027,15 @@ static const m_option_t mp_properties[] = {
|
|||
{ "framedropping", mp_property_framedropping, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, 0, 2, NULL },
|
||||
{ "gamma", mp_property_gamma, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, -100, 100, &vo_gamma_gamma },
|
||||
M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_gamma)},
|
||||
{ "brightness", mp_property_gamma, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, -100, 100, &vo_gamma_brightness },
|
||||
M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_brightness) },
|
||||
{ "contrast", mp_property_gamma, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, -100, 100, &vo_gamma_contrast },
|
||||
M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_contrast) },
|
||||
{ "saturation", mp_property_gamma, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, -100, 100, &vo_gamma_saturation },
|
||||
M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_saturation) },
|
||||
{ "hue", mp_property_gamma, CONF_TYPE_INT,
|
||||
M_OPT_RANGE, -100, 100, &vo_gamma_hue },
|
||||
M_OPT_RANGE, -100, 100, (void *)offsetof(struct MPOpts, vo_gamma_hue) },
|
||||
{ "panscan", mp_property_panscan, CONF_TYPE_FLOAT,
|
||||
M_OPT_RANGE, 0, 1, NULL },
|
||||
{ "vsync", mp_property_vsync, CONF_TYPE_FLAG,
|
||||
|
|
|
@ -8,6 +8,11 @@ void set_default_mplayer_options(struct MPOpts *opts)
|
|||
.audio_driver_list = NULL,
|
||||
.video_driver_list = NULL,
|
||||
.fixed_vo = 0,
|
||||
.vo_gamma_gamma = 1000,
|
||||
.vo_gamma_brightness = 1000,
|
||||
.vo_gamma_contrast = 1000,
|
||||
.vo_gamma_saturation = 1000,
|
||||
.vo_gamma_hue = 1000,
|
||||
.loop_times = -1,
|
||||
.user_correct_pts = -1,
|
||||
.audio_id = -1,
|
||||
|
|
|
@ -103,17 +103,6 @@ const vd_functions_t * const mpcodecs_vd_drivers[] = {
|
|||
|
||||
#include "libvo/video_out.h"
|
||||
|
||||
/** global variables for gamma, brightness, contrast, saturation and hue
|
||||
modified by mplayer.c and gui/mplayer/gtk/eq.c:
|
||||
ranges -100 - 100
|
||||
1000 if the vo default should be used
|
||||
*/
|
||||
int vo_gamma_gamma = 1000;
|
||||
int vo_gamma_brightness = 1000;
|
||||
int vo_gamma_contrast = 1000;
|
||||
int vo_gamma_saturation = 1000;
|
||||
int vo_gamma_hue = 1000;
|
||||
|
||||
int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
|
||||
unsigned int preferred_outfmt)
|
||||
{
|
||||
|
@ -323,16 +312,16 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
|
|||
|
||||
sh->vf_initialized = 1;
|
||||
|
||||
if (vo_gamma_gamma != 1000)
|
||||
set_video_colors(sh, "gamma", vo_gamma_gamma);
|
||||
if (vo_gamma_brightness != 1000)
|
||||
set_video_colors(sh, "brightness", vo_gamma_brightness);
|
||||
if (vo_gamma_contrast != 1000)
|
||||
set_video_colors(sh, "contrast", vo_gamma_contrast);
|
||||
if (vo_gamma_saturation != 1000)
|
||||
set_video_colors(sh, "saturation", vo_gamma_saturation);
|
||||
if (vo_gamma_hue != 1000)
|
||||
set_video_colors(sh, "hue", vo_gamma_hue);
|
||||
if (opts->vo_gamma_gamma != 1000)
|
||||
set_video_colors(sh, "gamma", opts->vo_gamma_gamma);
|
||||
if (opts->vo_gamma_brightness != 1000)
|
||||
set_video_colors(sh, "brightness", opts->vo_gamma_brightness);
|
||||
if (opts->vo_gamma_contrast != 1000)
|
||||
set_video_colors(sh, "contrast", opts->vo_gamma_contrast);
|
||||
if (opts->vo_gamma_saturation != 1000)
|
||||
set_video_colors(sh, "saturation", opts->vo_gamma_saturation);
|
||||
if (opts->vo_gamma_hue != 1000)
|
||||
set_video_colors(sh, "hue", opts->vo_gamma_hue);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -256,15 +256,6 @@ extern int vo_keepaspect;
|
|||
extern int vo_rootwin;
|
||||
extern int vo_border;
|
||||
|
||||
extern int vo_gamma_gamma;
|
||||
extern int vo_gamma_brightness;
|
||||
extern int vo_gamma_saturation;
|
||||
extern int vo_gamma_contrast;
|
||||
extern int vo_gamma_hue;
|
||||
extern int vo_gamma_red_intensity;
|
||||
extern int vo_gamma_green_intensity;
|
||||
extern int vo_gamma_blue_intensity;
|
||||
|
||||
extern int vo_nomouse_input;
|
||||
|
||||
extern int vo_pts;
|
||||
|
|
|
@ -13,6 +13,14 @@ typedef struct MPOpts {
|
|||
int vidmode;
|
||||
int fullscreen;
|
||||
int vo_dbpp;
|
||||
|
||||
// ranges -100 - 100, 1000 if the vo default should be used
|
||||
int vo_gamma_gamma;
|
||||
int vo_gamma_brightness;
|
||||
int vo_gamma_contrast;
|
||||
int vo_gamma_saturation;
|
||||
int vo_gamma_hue;
|
||||
|
||||
int correct_pts;
|
||||
int loop_times;
|
||||
int user_correct_pts;
|
||||
|
|
Loading…
Reference in New Issue