summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-03-22 06:26:37 +0100
committerwm4 <wm4@mplayer2.org>2012-07-28 23:36:07 +0200
commit74e7a1e937c10d9f4d8ce9b0ba4edee52044a757 (patch)
treec421c5b79b36ad4e29b3141b4b5753107b77a343 /command.c
parent7a06095dc3e5a3590f489aad3619dc6023a5b0f5 (diff)
downloadmpv-74e7a1e937c10d9f4d8ce9b0ba4edee52044a757.tar.bz2
mpv-74e7a1e937c10d9f4d8ce9b0ba4edee52044a757.tar.xz
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which used freetype/fontconfig and did text layout manually, is disabled. To re-enable the old code, use the --disable-libass-osd configure switch. Some switches do nothing with the new code enabled, such as -subalign, -sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that the code for rendering unstyled subtitles with libass doesn't make any attempts to support them. Some of them could be supported in theory.) Teletext rendering is not implemented in the new OSD rendering code. I don't have any teletext sources for testing, and since teletext is being phased out world-wide, the need for this is questionable. Note that rendering is extremely inefficient, mostly because the libass output is blended with the extremely strange mplayer OSD format. This could be improved at a later point. Remove most OSD rendering from vo_aa.c, because that was extremely hacky, can't be made work with osd_libass, and didn't work anyway in my tests. Internally, some cleanup is done. Subtitle and OSD related variable declarations were literally all over the place. Move them to sub.h and sub.c, which were hoarding most of these declarations already. Make the player core in mplayer.c free of concerns like bitmap font loading. The old OSD rendering code has been moved to osd_ft.c. The font_load.c and font_load_ft.c are only needed and compiled if the old OSD rendering code is configured.
Diffstat (limited to 'command.c')
-rw-r--r--command.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/command.c b/command.c
index cfb8d0ec17..6a32148de8 100644
--- a/command.c
+++ b/command.c
@@ -43,7 +43,6 @@
#include "mp_osd.h"
#include "libvo/video_out.h"
#include "libvo/csputils.h"
-#include "sub/font_load.h"
#include "playtree.h"
#include "libao2/audio_out.h"
#include "mpcommon.h"
@@ -2062,7 +2061,6 @@ static int mp_property_sub_forced_only(m_option_t *prop, int action,
}
-#ifdef CONFIG_FREETYPE
/// Subtitle scale (RW)
static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
MPContext *mpctx)
@@ -2081,8 +2079,7 @@ static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
}
#endif
text_font_scale_factor = *(float *) arg;
- force_load_font = 1;
- vo_osd_changed(OSDTYPE_SUBTITLE);
+ vo_osd_resized();
return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
@@ -2097,8 +2094,7 @@ static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
text_font_scale_factor += (arg ? *(float *) arg : 0.1) *
(action == M_PROPERTY_STEP_UP ? 1.0 : -1.0);
M_PROPERTY_CLAMP(prop, text_font_scale_factor);
- force_load_font = 1;
- vo_osd_changed(OSDTYPE_SUBTITLE);
+ vo_osd_resized();
return M_PROPERTY_OK;
default:
#ifdef CONFIG_ASS
@@ -2109,7 +2105,6 @@ static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
return m_property_float_ro(prop, action, arg, text_font_scale_factor);
}
}
-#endif
#ifdef CONFIG_TV
@@ -2378,10 +2373,8 @@ static const m_option_t mp_properties[] = {
M_OPT_RANGE, 0, 1, NULL },
{ "sub_forced_only", mp_property_sub_forced_only, CONF_TYPE_FLAG,
M_OPT_RANGE, 0, 1, NULL },
-#ifdef CONFIG_FREETYPE
{ "sub_scale", mp_property_sub_scale, CONF_TYPE_FLOAT,
M_OPT_RANGE, 0, 100, NULL },
-#endif
#ifdef CONFIG_ASS
{ "ass_use_margins", mp_property_ass_use_margins, CONF_TYPE_FLAG,
M_OPT_RANGE, 0, 1, NULL },
@@ -2497,9 +2490,7 @@ static struct property_osd_display {
{ "sub_delay", 0, OSD_MSG_SUB_DELAY, _("Sub delay: %s") },
{ "sub_visibility", 0, -1, _("Subtitles: %s") },
{ "sub_forced_only", 0, -1, _("Forced sub only: %s") },
-#ifdef CONFIG_FREETYPE
{ "sub_scale", 0, -1, _("Sub Scale: %s")},
-#endif
{ "ass_vsfilter_aspect_compat", 0, -1,
_("Subtitle VSFilter aspect compat: %s")},
#ifdef CONFIG_TV
@@ -2624,9 +2615,7 @@ static struct {
{ "sub_delay", MP_CMD_SUB_DELAY, 0},
{ "sub_visibility", MP_CMD_SUB_VISIBILITY, 1},
{ "sub_forced_only", MP_CMD_SUB_FORCED_ONLY, 1},
-#ifdef CONFIG_FREETYPE
{ "sub_scale", MP_CMD_SUB_SCALE, 0},
-#endif
#ifdef CONFIG_ASS
{ "ass_use_margins", MP_CMD_ASS_USE_MARGINS, 1},
#endif