[Mplayer-cvslog] CVS: main Makefile,1.201,1.202 cfg-common.h,1.53,1.54 configure,1.547,1.548 mencoder.c,1.148,1.149 mplayer.c,1.551,1.552

Arpi of Ize arpi at mplayerhq.hu
Wed Aug 28 22:52:31 CEST 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv17935

Modified Files:
	Makefile cfg-common.h configure mencoder.c mplayer.c 
Log Message:
freetype 2.0/2.1+ support - disabled by default until bugs fixed
patch by Jindrich Makovicka <makovick at kmlinux.fjfi.cvut.cz>


Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -r1.201 -r1.202
--- Makefile	28 Aug 2002 16:09:31 -0000	1.201
+++ Makefile	28 Aug 2002 20:51:58 -0000	1.202
@@ -32,7 +32,7 @@
 INSTALL = install
 
 SRCS_COMMON = xacodec.c cpudetect.c codec-cfg.c cfgparser.c my_profile.c spudec.c playtree.c playtreeparser.c asxparser.c vobsub.c subreader.c sub_cc.c find_sub.c
-SRCS_MENCODER = mencoder.c mp_msg-mencoder.c $(SRCS_COMMON) libao2/afmt.c divx4_vbr.c libvo/aclib.c libvo/osd.c libvo/sub.c libvo/font_load.c me-opt-reg.c
+SRCS_MENCODER = mencoder.c mp_msg-mencoder.c $(SRCS_COMMON) libao2/afmt.c divx4_vbr.c libvo/aclib.c libvo/osd.c libvo/sub.c libvo/font_load.c libvo/font_load_ft.c me-opt-reg.c
 SRCS_MPLAYER = mplayer.c mp_msg.c $(SRCS_COMMON) mixer.c mp-opt-reg.c
 
 OBJS_MENCODER = $(SRCS_MENCODER:.c=.o)
@@ -46,11 +46,11 @@
 A_LIBS = $(ALSA_LIB) $(ARTS_LIB) $(NAS_LIB) $(MAD_LIB) $(VORBIS_LIB) $(FAAD_LIB) $(SGIAUDIO_LIB)
 
 CODEC_LIBS = -Llibmpcodecs -lmpcodecs -Lmp3lib -lMP3 -Lliba52 -la52 -Llibmpeg2 -lmpeg2 $(AV_LIB) $(FAME_LIB) $(XVID_LIB)
-COMMON_LIBS = $(CODEC_LIBS) -Llibmpdemux -lmpdemux  -Linput -linput $(LIB_LOADER) $(A_LIBS) $(CSS_LIB) $(ARCH_LIB) -Lpostproc -lpostproc $(DECORE_LIB) -Llinux -losdep $(TERMCAP_LIB)  $(STREAMING_LIB) $(Z_LIB) $(GTK_LIBS) $(PNG_LIB) $(JPEG_LIB) $(GIF_LIB) $(CDPARANOIA_LIB) -lm
+COMMON_LIBS = $(CODEC_LIBS) -Llibmpdemux -lmpdemux  -Linput -linput $(LIB_LOADER) $(A_LIBS) $(CSS_LIB) $(ARCH_LIB) -Lpostproc -lpostproc $(DECORE_LIB) -Llinux -losdep $(TERMCAP_LIB)  $(STREAMING_LIB) $(Z_LIB) $(GTK_LIBS) $(PNG_LIB) $(JPEG_LIB) $(GIF_LIB) $(CDPARANOIA_LIB) $(FREETYPE_LIB) -lm
 ifeq ($(VIDIX),yes)
 MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix
 endif
-CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC)# -Wall
+CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(FREETYPE_INC) # -Wall
 
 PARTS = libfame libmpdemux libmpcodecs mp3lib liba52 libmp1e libmpeg2 libavcodec libao2 drivers linux postproc input libmpdvdkit libvo
 ifeq ($(VIDIX),yes)

Index: cfg-common.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-common.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- cfg-common.h	28 Aug 2002 16:55:40 -0000	1.53
+++ cfg-common.h	28 Aug 2002 20:51:58 -0000	1.54
@@ -163,6 +163,14 @@
 	{"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL},
  	{"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
+#ifdef HAVE_FREETYPE
+	{"subfont-encoding", &subtitle_font_encoding, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ 	{"subfont-text-scale", &text_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL},
+ 	{"subfont-osd-scale", &osd_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL},
+ 	{"subfont-blur", &subtitle_font_radius, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL},
+ 	{"subfont-outline", &subtitle_font_thickness, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL},
+ 	{"subfont-autoscale", &subtitle_autoscale, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
+#endif
 #endif
 
 #else

Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.547
retrieving revision 1.548
diff -u -r1.547 -r1.548
--- configure	28 Aug 2002 16:09:31 -0000	1.547
+++ configure	28 Aug 2002 20:51:58 -0000	1.548
@@ -168,6 +168,7 @@
   --disable-cdparanoia   Disable cdparanoia support [autodetect]
   --disable-big-endian   Force byte order to little endian [autodetect]
   --enable-big-endian    Force byte order to big endian [autodetect]
+  --enable-freetype      Enable freetype support [disabled]
   
 Video:
   --enable-gl            build with OpenGL render support [autodetect]
@@ -978,6 +979,7 @@
 _libdv=auto
 _cdparanoia=auto
 _big_endian=auto
+_freetype=no
 
 for ac_option do
   case "$ac_option" in
@@ -1136,6 +1138,8 @@
   --disable-cdparanoia)	_cdparanoia=no	;;
   --enable-big-endian)  _big_endian=yes ;;
   --disable-big-endian) _big_endian=no  ;;
+  --enable-freetype)    _freetype=yes   ;;
+  --disable-freetype)   _freetype=no    ;;
 
   --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
   --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
@@ -3185,7 +3189,7 @@
 int main(void) { return 1; }
 EOF
     _cdparanoia=no
-    cc_check $_inc_cdparnoia $_ld_cdparanoia -lcdda_interface -lcdda_paranoia && _cdparanoia=yes
+    cc_check $_inc_cdparanoia $_ld_cdparanoia -lcdda_interface -lcdda_paranoia && _cdparanoia=yes
 fi
 if test "$_cdparanoia" = yes ; then
     _def_cdparanoia='#define HAVE_CDDA'
@@ -3197,6 +3201,34 @@
 fi
 echores "$_cdparanoia"
 
+echocheck "freetype 2"
+if test "$_freetype" = yes ; then
+    if ( freetype-config --version ) >/dev/null 2>&1 ; then
+	cat > $TMPC << EOF
+#include <freetype/freetype.h>
+#if !(FREETYPE_MAJOR >= 2)
+#error "Need FreeType 2.0 or newer"
+#endif
+int main()
+{
+    return 0;
+}
+EOF
+	_freetype=no
+	cc_check `freetype-config --cflags` && _freetype=yes
+    else
+	_freetype=no
+    fi
+fi
+if test "$_freetype" = yes ; then
+    _def_freetype='#define HAVE_FREETYPE'
+    _inc_freetype=`freetype-config --cflags`
+    _ld_freetype=`freetype-config --libs`
+else
+    _def_freetype='#undef HAVE_FREETYPE'
+fi
+echores "$_freetype"
+
 echocheck "zlib"
 cat > $TMPC << EOF
 #include <zlib.h>
@@ -4274,8 +4306,10 @@
 ENCORE_LIB =  $_ld_encore $_ld_mp3lame
 DIRECTFB_INC = $_inc_directfb
 DIRECTFB_LIB = $_ld_directfb
-CDPARANOIA_INC = $_inc_cdparnoia
+CDPARANOIA_INC = $_inc_cdparanoia
 CDPARANOIA_LIB = $_ld_cdparanoia
+FREETYPE_INC = $_inc_freetype
+FREETYPE_LIB = $_ld_freetype
 
 # --- Some stuff for autoconfigure ----
 $_target_arch
@@ -4608,6 +4642,9 @@
 /* enable GIF support */
 $_def_gif
 $_def_gif_4
+
+/* enable FreeType support */
+$_def_freetype
 
 /* libmad support */
 $_def_mad

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -r1.148 -r1.149
--- mencoder.c	21 Aug 2002 21:31:18 -0000	1.148
+++ mencoder.c	28 Aug 2002 20:51:58 -0000	1.149
@@ -390,6 +390,9 @@
 
 // check font
 #ifdef USE_OSD
+#ifdef HAVE_FREETYPE
+  init_freetype();
+#else
   if(font_name){
        vo_font=read_font_desc(font_name,font_factor,verbose>1);
        if(!vo_font) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name);
@@ -399,6 +402,7 @@
        if(!vo_font)
        vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1);
   }
+#endif
 #endif
 
   vo_init_osd();

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.551
retrieving revision 1.552
diff -u -r1.551 -r1.552
--- mplayer.c	28 Aug 2002 15:55:42 -0000	1.551
+++ mplayer.c	28 Aug 2002 20:51:58 -0000	1.552
@@ -668,9 +668,9 @@
 
 //------ load global data first ------
 
-
-// check font
 #ifdef USE_OSD
+#ifndef HAVE_FREETYPE
+// check font
   if(font_name){
        vo_font=read_font_desc(font_name,font_factor,verbose>1);
        if(!vo_font) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name);
@@ -680,8 +680,10 @@
        if(!vo_font)
        vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1);
   }
+#else
+  init_freetype();
+#endif
 #endif
-
   vo_init_osd();
 
 #ifdef HAVE_RTC
@@ -1324,6 +1326,10 @@
    if(vo_flags & 0x08 && vo_spudec)
       spudec_set_hw_spu(vo_spudec,video_out);
 
+#ifdef HAVE_FREETYPE
+   force_load_font = 1;
+#endif
+
 //================== MAIN: ==========================
    main:
 if(!sh_video) osd_level = 0;
@@ -2774,6 +2780,12 @@
 
 if(use_gui || playtree_iter != NULL){
 
+#ifdef HAVE_FREETYPE
+    current_module="uninit_font";
+    if (vo_font) free_font_desc(vo_font);
+    vo_font = NULL;
+#endif
+
   current_module="uninit_acodec";
   if(sh_audio) uninit_audio(sh_audio);
   sh_audio=NULL;
@@ -2804,6 +2816,10 @@
   eof = 0;
   goto play_next_file;
 }
+
+#ifdef HAVE_FREETYPE
+done_freetype();
+#endif
 
 exit_player(MSGTR_Exit_eof);
 




More information about the MPlayer-cvslog mailing list