mirror of
https://github.com/mpv-player/mpv
synced 2025-04-23 15:47:54 +00:00
player: rename --background to --background-color
This better represents what it actually does. --background will be used for another, related option in the next commit.
This commit is contained in:
parent
b7fd232524
commit
c774b5f517
@ -57,6 +57,7 @@ Interface changes
|
|||||||
- move the `options` argument of the `loadfile` command from the third
|
- move the `options` argument of the `loadfile` command from the third
|
||||||
parameter to the fourth (after `index`)
|
parameter to the fourth (after `index`)
|
||||||
- add `--drag-and-drop=insert-next` option
|
- add `--drag-and-drop=insert-next` option
|
||||||
|
- rename `--background` to `--background-color`
|
||||||
--- mpv 0.37.0 ---
|
--- mpv 0.37.0 ---
|
||||||
- `--save-position-on-quit` and its associated commands now store state files
|
- `--save-position-on-quit` and its associated commands now store state files
|
||||||
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.
|
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.
|
||||||
|
@ -6946,7 +6946,7 @@ them.
|
|||||||
any advantages over normal textures. Note that hardware decoding overrides
|
any advantages over normal textures. Note that hardware decoding overrides
|
||||||
this flag. Could be removed any time.
|
this flag. Could be removed any time.
|
||||||
|
|
||||||
``--background=<color>``
|
``--background-color=<color>``
|
||||||
Color used to draw parts of the mpv window not covered by video. See the
|
Color used to draw parts of the mpv window not covered by video. See the
|
||||||
``--sub-color`` option for how colors are defined.
|
``--sub-color`` option for how colors are defined.
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ static const struct gl_video_opts gl_video_opts_def = {
|
|||||||
.sigmoid_upscaling = true,
|
.sigmoid_upscaling = true,
|
||||||
.interpolation_threshold = 0.01,
|
.interpolation_threshold = 0.01,
|
||||||
.alpha_mode = ALPHA_BLEND_TILES,
|
.alpha_mode = ALPHA_BLEND_TILES,
|
||||||
.background = {0, 0, 0, 255},
|
.background_color = {0, 0, 0, 255},
|
||||||
.gamma = 1.0f,
|
.gamma = 1.0f,
|
||||||
.tone_map = {
|
.tone_map = {
|
||||||
.curve = TONE_MAPPING_AUTO,
|
.curve = TONE_MAPPING_AUTO,
|
||||||
@ -453,7 +453,7 @@ const struct m_sub_options gl_video_conf = {
|
|||||||
{"blend", ALPHA_BLEND},
|
{"blend", ALPHA_BLEND},
|
||||||
{"blend-tiles", ALPHA_BLEND_TILES})},
|
{"blend-tiles", ALPHA_BLEND_TILES})},
|
||||||
{"opengl-rectangle-textures", OPT_BOOL(use_rectangle)},
|
{"opengl-rectangle-textures", OPT_BOOL(use_rectangle)},
|
||||||
{"background", OPT_COLOR(background)},
|
{"background-color", OPT_COLOR(background_color)},
|
||||||
{"interpolation", OPT_BOOL(interpolation)},
|
{"interpolation", OPT_BOOL(interpolation)},
|
||||||
{"interpolation-threshold", OPT_FLOAT(interpolation_threshold)},
|
{"interpolation-threshold", OPT_FLOAT(interpolation_threshold)},
|
||||||
{"blend-subtitles", OPT_CHOICE(blend_subs,
|
{"blend-subtitles", OPT_CHOICE(blend_subs,
|
||||||
@ -3088,7 +3088,7 @@ static void pass_draw_to_screen(struct gl_video *p, const struct ra_fbo *fbo, in
|
|||||||
GLSL(color.a = 1.0;)
|
GLSL(color.a = 1.0;)
|
||||||
} else if (p->opts.alpha_mode == ALPHA_BLEND) {
|
} else if (p->opts.alpha_mode == ALPHA_BLEND) {
|
||||||
// Blend into background color (usually black)
|
// Blend into background color (usually black)
|
||||||
struct m_color c = p->opts.background;
|
struct m_color c = p->opts.background_color;
|
||||||
GLSLF("vec4 background = vec4(%f, %f, %f, %f);\n",
|
GLSLF("vec4 background = vec4(%f, %f, %f, %f);\n",
|
||||||
c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0);
|
c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0);
|
||||||
GLSL(color.rgb += background.rgb * (1.0 - color.a);)
|
GLSL(color.rgb += background.rgb * (1.0 - color.a);)
|
||||||
@ -3864,7 +3864,7 @@ static void check_gl_features(struct gl_video *p)
|
|||||||
.fbo_format = p->opts.fbo_format,
|
.fbo_format = p->opts.fbo_format,
|
||||||
.alpha_mode = p->opts.alpha_mode,
|
.alpha_mode = p->opts.alpha_mode,
|
||||||
.use_rectangle = p->opts.use_rectangle,
|
.use_rectangle = p->opts.use_rectangle,
|
||||||
.background = p->opts.background,
|
.background_color = p->opts.background_color,
|
||||||
.dither_algo = p->opts.dither_algo,
|
.dither_algo = p->opts.dither_algo,
|
||||||
.dither_depth = p->opts.dither_depth,
|
.dither_depth = p->opts.dither_depth,
|
||||||
.dither_size = p->opts.dither_size,
|
.dither_size = p->opts.dither_size,
|
||||||
@ -4115,7 +4115,7 @@ static void reinit_from_options(struct gl_video *p)
|
|||||||
p->opts = *(struct gl_video_opts *)p->opts_cache->opts;
|
p->opts = *(struct gl_video_opts *)p->opts_cache->opts;
|
||||||
|
|
||||||
if (!p->force_clear_color)
|
if (!p->force_clear_color)
|
||||||
p->clear_color = p->opts.background;
|
p->clear_color = p->opts.background_color;
|
||||||
|
|
||||||
check_gl_features(p);
|
check_gl_features(p);
|
||||||
uninit_rendering(p);
|
uninit_rendering(p);
|
||||||
|
@ -157,7 +157,7 @@ struct gl_video_opts {
|
|||||||
char *fbo_format;
|
char *fbo_format;
|
||||||
int alpha_mode;
|
int alpha_mode;
|
||||||
bool use_rectangle;
|
bool use_rectangle;
|
||||||
struct m_color background;
|
struct m_color background_color;
|
||||||
bool interpolation;
|
bool interpolation;
|
||||||
float interpolation_threshold;
|
float interpolation_threshold;
|
||||||
int blend_subs;
|
int blend_subs;
|
||||||
|
@ -2083,10 +2083,10 @@ static void update_render_options(struct vo *vo)
|
|||||||
pl_options pars = p->pars;
|
pl_options pars = p->pars;
|
||||||
const struct gl_video_opts *opts = p->opts_cache->opts;
|
const struct gl_video_opts *opts = p->opts_cache->opts;
|
||||||
pars->params.antiringing_strength = opts->scaler[0].antiring;
|
pars->params.antiringing_strength = opts->scaler[0].antiring;
|
||||||
pars->params.background_color[0] = opts->background.r / 255.0;
|
pars->params.background_color[0] = opts->background_color.r / 255.0;
|
||||||
pars->params.background_color[1] = opts->background.g / 255.0;
|
pars->params.background_color[1] = opts->background_color.g / 255.0;
|
||||||
pars->params.background_color[2] = opts->background.b / 255.0;
|
pars->params.background_color[2] = opts->background_color.b / 255.0;
|
||||||
pars->params.background_transparency = 1.0 - opts->background.a / 255.0;
|
pars->params.background_transparency = 1 - opts->background_color.a / 255.0;
|
||||||
pars->params.skip_anti_aliasing = !opts->correct_downscaling;
|
pars->params.skip_anti_aliasing = !opts->correct_downscaling;
|
||||||
pars->params.disable_linear_scaling = !opts->linear_downscaling && !opts->linear_upscaling;
|
pars->params.disable_linear_scaling = !opts->linear_downscaling && !opts->linear_upscaling;
|
||||||
pars->params.disable_fbos = opts->dumb_mode == 1;
|
pars->params.disable_fbos = opts->dumb_mode == 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user