mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
vo_opengl: unify blend-subtitles-res and blend-subtitles
This commit is contained in:
parent
3bfdc20aa1
commit
2b679020f7
@ -692,7 +692,7 @@ Available video output drivers are:
|
||||
Default is 128x256x64.
|
||||
Sizes must be a power of two, and 512 at most.
|
||||
|
||||
``blend-subtitles``
|
||||
``blend-subtitles=<yes|video|no>``
|
||||
Blend subtitles directly onto upscaled video frames, before
|
||||
interpolation and/or color management (default: no). Enabling this
|
||||
causes subtitles to be affected by ``icc-profile``, ``target-prim``,
|
||||
@ -703,6 +703,10 @@ Available video output drivers are:
|
||||
visible portion of the video, so you can't have subtitles exist in the
|
||||
black margins below a video (for example).
|
||||
|
||||
If ``video`` is selected, the behavior is similar to ``yes``, but subs
|
||||
are drawn at the video's native resolution, and scaled along with the
|
||||
video.
|
||||
|
||||
.. warning:: This changes the way subtitle colors are handled. Normally,
|
||||
subtitle colors are assumed to be in sRGB and color managed
|
||||
as such. Enabling this makes them treated as being in the
|
||||
@ -710,17 +714,6 @@ Available video output drivers are:
|
||||
things like softsubbed ASS signs to match the video colors,
|
||||
but may cause SRT subtitles or similar to look slightly off.
|
||||
|
||||
``blend-subtitles-res=<display|video>``
|
||||
The resolution at which subtitles get drawn if ``blend-subtitles`` is
|
||||
enabled (default: display). In the absence of ``blend-subtitles``,
|
||||
subtitles are always drawn at the window's size, together with the OSD.
|
||||
|
||||
display
|
||||
Subs are drawn directly at the window's size.
|
||||
video
|
||||
Subs are drawn at the video's native resolution, and scaled along
|
||||
with the video.
|
||||
|
||||
``alpha=<blend|yes|no>``
|
||||
Decides what to do if the input has an alpha component (default: blend).
|
||||
|
||||
|
@ -434,10 +434,10 @@ const struct m_sub_options gl_video_conf = {
|
||||
OPT_FLAG("rectangle-textures", use_rectangle, 0),
|
||||
OPT_COLOR("background", background, 0),
|
||||
OPT_FLAG("interpolation", interpolation, 0),
|
||||
OPT_FLAG("blend-subtitles", blend_subs, 0),
|
||||
OPT_CHOICE("blend-subtitles-res", blend_subs_res, 0,
|
||||
({"display", 0},
|
||||
{"video", 1})),
|
||||
OPT_CHOICE("blend-subtitles", blend_subs, 0,
|
||||
({"no", 0},
|
||||
{"yes", 1},
|
||||
{"video", 2})),
|
||||
|
||||
OPT_REMOVED("approx-gamma", "this is always enabled now"),
|
||||
OPT_REMOVED("cscale-down", "chroma is never downscaled"),
|
||||
@ -1836,7 +1836,7 @@ static void pass_render_frame(struct gl_video *p)
|
||||
if (vpts == MP_NOPTS_VALUE)
|
||||
vpts = p->osd_pts;
|
||||
|
||||
if (p->osd && p->opts.blend_subs && p->opts.blend_subs_res == 1) {
|
||||
if (p->osd && p->opts.blend_subs == 2) {
|
||||
double scale[2];
|
||||
get_scale_factors(p, scale);
|
||||
struct mp_osd_res rect = {
|
||||
@ -1851,7 +1851,7 @@ static void pass_render_frame(struct gl_video *p)
|
||||
|
||||
pass_scale_main(p);
|
||||
|
||||
if (p->osd && p->opts.blend_subs && p->opts.blend_subs_res == 0) {
|
||||
if (p->osd && p->opts.blend_subs == 1) {
|
||||
// Recreate the real video size from the src/dst rects
|
||||
int vp_w = p->dst_rect.x1 - p->dst_rect.x0,
|
||||
vp_h = p->dst_rect.y1 - p->dst_rect.y0;
|
||||
@ -2274,7 +2274,7 @@ static void check_gl_features(struct gl_video *p)
|
||||
disabled[n_disabled++] = "interpolation (FBO)";
|
||||
}
|
||||
if (p->opts.blend_subs && !test_fbo(p, &have_fbo)) {
|
||||
p->opts.blend_subs = false;
|
||||
p->opts.blend_subs = 0;
|
||||
disabled[n_disabled++] = "subtitle blending (FBO)";
|
||||
}
|
||||
if (gl->es && p->opts.pbo) {
|
||||
|
@ -66,7 +66,6 @@ struct gl_video_opts {
|
||||
struct m_color background;
|
||||
int interpolation;
|
||||
int blend_subs;
|
||||
int blend_subs_res;
|
||||
};
|
||||
|
||||
extern const struct m_sub_options gl_video_conf;
|
||||
|
Loading…
Reference in New Issue
Block a user