[MPlayer-dev-eng] TODO / [PATCH] xvid&configure

pl p_l at gmx.fr
Tue Feb 12 13:40:23 CET 2002


On Tue, Feb 12, 2002 at 11:07:27AM +0100, Arpi wrote:

> Just for the reference, and for some discussion, the URGENT section of TODO:
> (***=my comments)
> 
> URGENT:
...
> - ./configure support for XviD
>   *** Detecting static or dynamic XviD lib, and optionally use it instead of
>   divx4linux (pl?) 

The patch attached should do that but I'm not sure as for
opendivx/postprocess.o role. Check lines with 'XXX FIXME XXX' as I did
not have time to do build/linking tests.

Please commit, if that's what you meant/wanted.

As for the static version, do you mean a static version as for ffmpeg
libavcodec ?  Or a libcore.a somewhere (which is not installed by xvid
btw).  If it's directly from xvid cvs, where is it planned to be in
mplayer's tree ?

For the CVS log:
- fixed typo for --*able-divx4linux which is autodetected
- added support for XviD dynamic library (preferred to Divx4linux and
opendivx when available) => --{en,dis}able-xvid

-- 
Best regards,
  pl
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.388
diff -u -r1.388 configure
--- configure	11 Feb 2002 09:15:30 -0000	1.388
+++ configure	12 Feb 2002 12:43:27 -0000
@@ -124,7 +124,8 @@
   --disable-win32        disable Win32 DLL support [autodetect]
   --disable-dshow        disable DirectShow support [autodetect]
   --disable-xanim        disable XAnim DLL support [autodetect]
-  --disable-divx4linux   disable Divx4Linux codec [enable]
+  --disable-xvid         disable XviD codec [autodetect]
+  --disable-divx4linux   disable Divx4linux codec [autodetect]
   --disable-opendivx     disable OpenDivx codec [enable]
   --enable-vorbis        build with OggVorbis support [autodetect]
   --disable-iconv        do not use iconv(3) function [autodetect]
@@ -762,6 +763,7 @@
 _vidix=yes
 _new_input=no
 _joystick=no
+_xvid=auto
 _divx4linux=auto
 _opendivx=yes
 _lirc=auto
@@ -870,6 +872,8 @@
   --disable-new-input)	_new_input=no	;;
   --enable-joystick)	_joystick=yes	;;
   --disable-joystick)	_joystick=no	;;
+  --enable-xvid)	_xvid=yes	;;
+  --disable-xvid)	_xvid=no	;;
   --enable-divx4linux)	_divx4linux=yes	;;
   --disable-divx4linux)	_divx4linux=no	;;
   --enable-opendivx)	_opendivx=yes	;;
@@ -2558,6 +2562,7 @@
   _codecmodules="libavcodec.so $_codecmodules"
 fi
 
+
 echocheck "zr"
 if test "$_zr" = yes ; then
   if test "$_libavcodec" = yes ; then
@@ -2574,45 +2579,53 @@
   echores "$_zr"
 fi
 
-# FIXME : variables don't have a "standard" name so check this one day
-if test "$_divx4linux" = auto ; then
-  _divx4linux=no
-  echocheck "Divx4linux decore"
+
+if test "$_xvid" = auto || test "$_divx4linux" = auto ; then
+  echocheck "XviD/DivX4linux/OpenDivX decore"
   cat > $TMPC << EOF
 #include <decore.h>
 int main(void) { (void) decore(0, 0, 0, 0);  return DEC_OPT_FRAME_311; }
 EOF
-  _divx4linux_decore=no
-  if cc_check  -ldivxdecore -lm ; then
-    _divx4linux_decore=yes
-  else
-    _divx4linux_decore='not found'
-  fi
-  echores "$_divx4linux_decore"
-  test "$_divx4linux_decore" = yes && _divx4linux=yes
+  # XviD is preferred to DivX4
+  test "$_xvid" != no && cc_check -lm -lxvidcore && _xvid=yes _divx4linux=no
+  test "$_xvid" = auto && _xvid=no
+
+  test "$_divx4linux" != no &&  cc_check -lm -ldivxdecore -lm && _divx4linux=yes
+  test "$_divx4linux" = auto && _divx4linux=no
 fi
-if test "$_divx4linux_decore" = yes ; then
-  _opendivx='no'
+
+if test "$_xvid" = yes ; then
+  _opendivx=no
+  _def_decore='#define NEW_DECORE 1'
+  _ld_decore='-lm -lxvidcore'					# XXX FIXME XXX
+  _def_divx='#define USE_DIVX'
+  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
+  _codecmodules="xvid $_codecmodules"
+  echores "XviD"
+elif test "$_divx4linux" = yes ; then
+  _opendivx=no
   _def_decore='#define NEW_DECORE 1'
-  _ld_decore='-ldivxdecore opendivx/postprocess.o'
+  _ld_decore='-lm -ldivxdecore opendivx/postprocess.o'		# XXX FIXME XXX
+  _def_divx='#define USE_DIVX'
+  _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
+  _codecmodules="divx4 $_codecmodules"
+  echores "Divx4linux"
+elif test "$_opendivx" = yes ; then
+  _ld_decore='-Lopendivx -ldecore'
+  _def_decore='#undef NEW_DECORE'
   _def_divx='#define USE_DIVX'
   _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
-  _codecmodules="divx4linux $_codecmodules"
+  _codecmodules="opendivx $_codecmodules"
+  echores "OpenDivX"
 else
-  if test "$_opendivx" = yes ; then
-    _ld_decore='-Lopendivx -ldecore'
-    _def_decore='#undef NEW_DECORE'
-    _def_divx='#define USE_DIVX'
-    _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
-    _codecmodules="opendivx $_codecmodules"
-  else
-    _ld_decore=''
-    _def_decore='#undef NEW_DECORE'
-    _def_divx='#undef USE_DIVX'
-    _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
-  fi
+  _ld_decore=''
+  _def_decore='#undef NEW_DECORE'
+  _def_divx='#undef USE_DIVX'
+  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
+  echores "no"
 fi
 
+
 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
 if test "$_mencoder" != no ; then
 
@@ -2632,21 +2645,24 @@
   fi
   echores "$_mp3lame"
 
-  echocheck "Divx4linux encore (for mencoder)"
-  _divx4linux_encore=no
-  cat > $TMPC <<EOF
+
+  echocheck "XviD/DivX4 encore (for mencoder)"
+  cat > $TMPC << EOF
 #include <encore2.h>
 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
 EOF
-  if cc_check -ldivxencore -lm ; then
-    _divx4linux_encore=yes
+  if test "$_xvid" != no && cc_check -lm -lxvidcore ; then
+    _def_encore='#define HAVE_DIVX4ENCORE 1'
+    _ld_encore='lm -lxvidcore'
+    echores "XviD"
+  elif test "_$divx4linux" != no && cc_check -lm -ldivxencore ; then
     _def_encore='#define HAVE_DIVX4ENCORE 1'
-    _ld_encore='-ldivxencore'
+    _ld_encore='-lm -ldivxencore'
+    echores "DivX4linux"
   else
     _def_encore='#undef HAVE_DIVX4ENCORE'
+    echores "no"
   fi
-  echores "$_divx4linux_encore"
-
 fi
 
 echocheck "mencoder"
@@ -2993,6 +3009,7 @@
 MP1E_LIB = $_ld_mp1e
 ARCH_LIB =  $_ld_arch $_ld_iconv
 DIVX4LINUX = $_divx4linux
+XVID = $_xvid
 DECORE_LIB = $_ld_decore
 MENCODER = $_mencoder
 ENCORE_LIB =  $_ld_encore $_ld_mp3lame
@@ -3048,17 +3065,17 @@
    -cache <kilobytes> */
 #define USE_STREAM_CACHE 1
 
-/* Define to include support for OpenDivx/Divx4Linux */
+/* Define to include support for OpenDivx/Divx4Linux/XviD */
 $_def_divx
 
-/* Define for using new DivX4Linux library, instead of open-source OpenDivX */
+/* Define for using new DivX4Linux/XviD library, instead of open-source OpenDivX */
 /* You have to change DECORE_LIBS in config.mak too! */
 $_def_decore
 
 /* If build mencoder */
 $_mencoder_flag
 
-/* Indicates if Divx4linux encore is available
+/* Indicates if Divx4linux/XviD encore is available
    Note: for mencoder */
 $_def_encore
 


More information about the MPlayer-dev-eng mailing list