From 2b679020f7b7ba957f92bcaabacf38d50b856810 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 11 Apr 2015 19:16:34 +0200 Subject: [PATCH] vo_opengl: unify blend-subtitles-res and blend-subtitles --- DOCS/man/vo.rst | 17 +++++------------ video/out/gl_video.c | 14 +++++++------- video/out/gl_video.h | 1 - 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index 3e5840acfa..2447a8c455 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -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=`` 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=`` - 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=`` Decides what to do if the input has an alpha component (default: blend). diff --git a/video/out/gl_video.c b/video/out/gl_video.c index a1f0bfbcc7..649a72a8bc 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -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) { diff --git a/video/out/gl_video.h b/video/out/gl_video.h index a757d99cc9..30647153b5 100644 --- a/video/out/gl_video.h +++ b/video/out/gl_video.h @@ -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;