1
mirror of https://github.com/mpv-player/mpv synced 2024-10-26 07:22:17 +02:00

sub: remove logic for disabling hinting on scaled EOSD

This was an extremely obscure setting, as it was used only with vo_gl
if its scaled-osd suboption was used. If you really want this, you can
set the desired ass-hinting value directly, and there will be literally
no loss in functionality.

Note that this didn't actually test whether the EOSD was scaled.
Basically, it only checked whether vo_gl had the scaled-osd suboption
set.
This commit is contained in:
wm4 2012-10-03 17:00:37 +02:00
parent cf61928eec
commit 8f8f6e6d9d
11 changed files with 8 additions and 17 deletions

View File

@ -163,8 +163,6 @@
:1: FreeType autohinter, light mode :1: FreeType autohinter, light mode
:2: FreeType autohinter, normal mode :2: FreeType autohinter, normal mode
:3: font native hinter :3: font native hinter
:0-3 + 4: The same, but hinting will only be performed if the OSD is
rendered at screen resolution and will therefore not be scaled.
The default value is 0 (no hinting). The default value is 0 (no hinting).

View File

@ -126,7 +126,6 @@ static int control(struct vf_instance *vf, int request, void *data)
return CONTROL_FALSE; return CONTROL_FALSE;
osd->normal_scale = 1; osd->normal_scale = 1;
osd->vsfilter_scale = vf->priv->scale_ratio; osd->vsfilter_scale = vf->priv->scale_ratio;
osd->unscaled = vf->default_caps & VFCAP_EOSD_UNSCALED;
struct sub_bitmaps images; struct sub_bitmaps images;
sub_get_bitmaps(osd, &images); sub_get_bitmaps(osd, &images);
return vo_control(video_out, VOCTRL_DRAW_EOSD, &images) == VO_TRUE; return vo_control(video_out, VOCTRL_DRAW_EOSD, &images) == VO_TRUE;

View File

@ -42,8 +42,6 @@
#define VFCAP_POSTPROC 0x800 #define VFCAP_POSTPROC 0x800
// filter can draw EOSD // filter can draw EOSD
#define VFCAP_EOSD 0x2000 #define VFCAP_EOSD 0x2000
// filter will draw EOSD at screen resolution (without scaling)
#define VFCAP_EOSD_UNSCALED 0x4000
// used by libvo and vf_vo, indicates the VO does not support draw_slice for this format // used by libvo and vf_vo, indicates the VO does not support draw_slice for this format
#define VOCAP_NOSLICES 0x8000 #define VOCAP_NOSLICES 0x8000
#define VFCAP_EOSD_FILTER 0x20000 // EOSD is drawn in filter chain #define VFCAP_EOSD_FILTER 0x20000 // EOSD is drawn in filter chain

View File

@ -1271,7 +1271,7 @@ static int query_format(d3d_priv *priv, uint32_t movie_fmt)
int eosd_caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW int eosd_caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW
| VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN; | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
if (priv->eosd) if (priv->eosd)
eosd_caps |= VFCAP_EOSD | VFCAP_EOSD_UNSCALED; eosd_caps |= VFCAP_EOSD;
return eosd_caps; return eosd_caps;
} }

View File

@ -1116,7 +1116,7 @@ static int query_format(struct vo *vo, uint32_t format)
int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP | int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP |
VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE; VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE;
if (p->use_osd) if (p->use_osd)
caps |= VFCAP_OSD | VFCAP_EOSD | (p->scaled_osd ? 0 : VFCAP_EOSD_UNSCALED); caps |= VFCAP_OSD | VFCAP_EOSD;
if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA) if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA)
return caps; return caps;
if (p->use_yuv && mp_get_chroma_shift(format, NULL, NULL, &depth) && if (p->use_yuv && mp_get_chroma_shift(format, NULL, NULL, &depth) &&

View File

@ -1758,7 +1758,7 @@ static int query_format(uint32_t format)
{ {
int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP | int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP |
VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE |
VFCAP_OSD | VFCAP_EOSD | VFCAP_EOSD_UNSCALED | VFCAP_EOSD_RGBA; VFCAP_OSD | VFCAP_EOSD | VFCAP_EOSD_RGBA;
if (!init_format(format, NULL)) if (!init_format(format, NULL))
return 0; return 0;
return caps; return caps;

View File

@ -1396,7 +1396,7 @@ static int query_format(uint32_t format)
{ {
int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW
| VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD | VFCAP_EOSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD | VFCAP_EOSD
| VFCAP_EOSD_UNSCALED | VFCAP_EOSD_RGBA | VFCAP_FLIP; | VFCAP_EOSD_RGBA | VFCAP_FLIP;
switch (format) { switch (format) {
case IMGFMT_YV12: case IMGFMT_YV12:
case IMGFMT_I420: case IMGFMT_I420:

View File

@ -226,17 +226,14 @@ ASS_Track *mp_ass_read_stream(ASS_Library *library, const char *fname,
} }
void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
struct mp_eosd_res *dim, bool unscaled) struct mp_eosd_res *dim)
{ {
int hinting; int hinting;
ass_set_frame_size(priv, dim->w, dim->h); ass_set_frame_size(priv, dim->w, dim->h);
ass_set_margins(priv, dim->mt, dim->mb, dim->ml, dim->mr); ass_set_margins(priv, dim->mt, dim->mb, dim->ml, dim->mr);
ass_set_use_margins(priv, opts->ass_use_margins); ass_set_use_margins(priv, opts->ass_use_margins);
ass_set_font_scale(priv, opts->ass_font_scale); ass_set_font_scale(priv, opts->ass_font_scale);
if (!unscaled && (opts->ass_hinting & 4)) hinting = opts->ass_hinting & 3; // +4 was for no hinting if scaled
hinting = 0;
else
hinting = opts->ass_hinting & 3;
ass_set_hinting(priv, hinting); ass_set_hinting(priv, hinting);
ass_set_line_spacing(priv, opts->ass_line_spacing); ass_set_line_spacing(priv, opts->ass_line_spacing);
} }

View File

@ -42,7 +42,7 @@ ASS_Track *mp_ass_read_stream(ASS_Library *library, const char *fname,
struct MPOpts; struct MPOpts;
void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
struct mp_eosd_res *dim, bool unscaled); struct mp_eosd_res *dim);
void mp_ass_configure_fonts(ASS_Renderer *priv); void mp_ass_configure_fonts(ASS_Renderer *priv);
ASS_Library *mp_ass_init(struct MPOpts *opts); ASS_Library *mp_ass_init(struct MPOpts *opts);

View File

@ -139,7 +139,7 @@ static void get_bitmaps(struct sh_sub *sh, struct osd_state *osd,
if (ctx->vsfilter_aspect && opts->ass_vsfilter_aspect_compat) if (ctx->vsfilter_aspect && opts->ass_vsfilter_aspect_compat)
scale = osd->vsfilter_scale; scale = osd->vsfilter_scale;
ASS_Renderer *renderer = osd->ass_renderer; ASS_Renderer *renderer = osd->ass_renderer;
mp_ass_configure(renderer, opts, &osd->dim, osd->unscaled); mp_ass_configure(renderer, opts, &osd->dim);
ass_set_aspect_ratio(renderer, scale, 1); ass_set_aspect_ratio(renderer, scale, 1);
mp_ass_render_frame(renderer, ctx->ass_track, osd->sub_pts * 1000 + .5, mp_ass_render_frame(renderer, ctx->ass_track, osd->sub_pts * 1000 + .5,
&ctx->parts, res); &ctx->parts, res);

View File

@ -67,7 +67,6 @@ struct osd_state {
struct mp_eosd_res dim; struct mp_eosd_res dim;
double normal_scale; double normal_scale;
double vsfilter_scale; double vsfilter_scale;
bool unscaled;
bool support_rgba; bool support_rgba;
int w, h; int w, h;