From 74e7a1e937c10d9f4d8ce9b0ba4edee52044a757 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Mar 2012 06:26:37 +0100 Subject: 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. --- configure | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 0d407c693d..eade144dba 100755 --- a/configure +++ b/configure @@ -361,6 +361,7 @@ Optional features: --disable-pthreads disable Posix threads support [autodetect] --disable-w32threads disable Win32 threads support [autodetect] --disable-libass disable subtitle rendering with libass [autodetect] + --disable-libass-osd disable OSD rendering with libass [autodetect] --enable-rpath enable runtime linker path for extra libs [disabled] --disable-libpostproc disable postprocess filter (vf_pp) [autodetect] @@ -657,6 +658,7 @@ _vstream=auto _pthreads=auto _w32threads=auto _ass=auto +_libass_osd=auto _rpath=no libpostproc=auto _asmalign_pot=auto @@ -991,6 +993,8 @@ for ac_option do --disable-w32threads) _w32threads=no ;; --enable-libass) _ass=yes ;; --disable-libass) _ass=no ;; + --enable-libass-osd) _libass_osd=yes ;; + --disable-libass-osd) _libass_osd=no ;; --enable-rpath) _rpath=yes ;; --disable-rpath) _rpath=no ;; --enable-libpostproc) libpostproc=yes ;; @@ -4542,6 +4546,39 @@ else noinputmodules="cddb $noinputmodules" fi + +echocheck "SSA/ASS support" +if test "$_ass" = auto ; then + if pkg_config_add libass ; then + _ass=yes + def_ass='#define CONFIG_ASS 1' + else + die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass." + fi +else + def_ass='#undef CONFIG_ASS' +fi +echores "$_ass" + + +echocheck "libass OSD support" +_old_osd=yes +if test "$_libass_osd" = auto ; then + _libass_osd=no + if test "$_ass" = yes ; then + _libass_osd=yes + _old_osd=no + _bitmap_font=no + # disable unneeded dependencies + _freetype=no + _fontconfig=no + # this should always be forced, because libass does bidi itself + _fribidi=no + fi +fi +echores "$_libass_osd" + + echocheck "bitmap font support" if test "$_bitmap_font" = yes ; then def_bitmap_font="#define CONFIG_BITMAP_FONT 1" @@ -4593,20 +4630,6 @@ fi echores "$_fontconfig" -echocheck "SSA/ASS support" -if test "$_ass" = auto ; then - if pkg_config_add libass ; then - _ass=yes - def_ass='#define CONFIG_ASS 1' - else - die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass." - fi -else - def_ass='#undef CONFIG_ASS' -fi -echores "$_ass" - - echocheck "fribidi with charsets" if test "$_fribidi" = auto ; then _fribidi=no @@ -5724,6 +5747,8 @@ JPEG = $_jpeg LADSPA = $_ladspa LIBA52 = $_liba52 LIBASS = $_ass +LIBASS_OSD = $_libass_osd +OLD_OSD = $_old_osd LIBBLURAY = $_bluray LIBBS2B = $_libbs2b LIBDCA = $_libdca -- cgit v1.2.3