changeset 4489:745cf5ba7117

make opendivx codec optional at compiletime
author rfelker
date Sun, 03 Feb 2002 00:52:51 +0000
parents 7e8910727e7a
children e4943e6797bd
files Makefile configure dec_video.c
diffstat 3 files changed, 50 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat Feb 02 23:39:53 2002 +0000
+++ b/Makefile	Sun Feb 03 00:52:51 2002 +0000
@@ -53,7 +53,10 @@
 endif
 CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) # -Wall
 
-PARTS = g72x libmpdemux mp3lib libac3 liba52 libmp1e libmpeg2 opendivx libavcodec libao2 drivers drivers/syncfb linux postproc xa input
+PARTS = g72x libmpdemux mp3lib libac3 liba52 libmp1e libmpeg2 libavcodec libao2 drivers drivers/syncfb linux postproc xa input
+ifeq ($(OPENDIVX),yes)
+PARTS += opendivx
+endif
 ifeq ($(VIDIX),yes)
 PARTS += libdha vidix
 endif
@@ -95,8 +98,11 @@
 .c.o:
 	$(CC) -c $(CFLAGS) -o $@ $<
 
-COMMON_DEPS = g72x/libg72x.a libmpdemux/libmpdemux.a libao2/libao2.a libac3/libac3.a liba52/liba52.a mp3lib/libMP3.a libmpeg2/libmpeg2.a opendivx/libdecore.a linux/libosdep.a postproc/libpostproc.a xa/libxa.a
+COMMON_DEPS = g72x/libg72x.a libmpdemux/libmpdemux.a libao2/libao2.a libac3/libac3.a liba52/liba52.a mp3lib/libMP3.a libmpeg2/libmpeg2.a linux/libosdep.a postproc/libpostproc.a xa/libxa.a
 
+ifeq ($(OPENDIVX),yes)
+COMMON_DEPS += opendivx/libdecore.a
+endif
 ifeq ($(VIDIX),yes)
 COMMON_DEPS += libdha/libdha.so vidix/libvidix.a
 endif
--- a/configure	Sat Feb 02 23:39:53 2002 +0000
+++ b/configure	Sun Feb 03 00:52:51 2002 +0000
@@ -123,6 +123,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-opendivx     disable OpenDivx codec [enable]
   --enable-vorbis        build with OggVorbis support [autodetect]
   --disable-iconv        do not use iconv(3) function [autodetect]
   --disable-rtc          disable RTC (/dev/rtc) on Linux [autodetect]
@@ -742,6 +744,7 @@
 _streaming=yes
 _vidix=yes
 _divx4linux=auto
+_opendivx=yes
 _lirc=auto
 _gui=no
 _termcap=auto
@@ -843,6 +846,8 @@
   --disable-vidix)	_vidix=no	;;
   --enable-divx4linux)	_divx4linux=yes	;;
   --disable-divx4linux)	_divx4linux=no	;;
+  --enable-opendivx)	_opendivx=yes	;;
+  --disable-opendivx)	_opendivx=no	;;
   --enable-lirc)	_lirc=yes	;;
   --disable-lirc)	_lirc=no	;;
   --enable-gui)		_gui=yes	;;
@@ -2549,13 +2554,25 @@
   test "$_divx4linux_decore" = yes && _divx4linux=yes
 fi
 if test "$_divx4linux_decore" = yes ; then
+  _opendivx='no'
   _def_decore='#define NEW_DECORE 1'
   _ld_decore='-ldivxdecore opendivx/postprocess.o'
+  _def_divx='#define USE_DIVX'
+  _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
   _codecmodules="divx4linux $_codecmodules"
 else
-  _ld_decore='-Lopendivx -ldecore'
-  _def_decore='#undef NEW_DECORE'
-  _codecmodules="opendivx $_codecmodules"
+  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
 fi
 
 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
@@ -2874,6 +2891,8 @@
 STREAMING_LIB = $_ld_streaming
 VIDIX = $_vidix
 
+OPENDIVX = $_opendivx
+
 VO2 = $_vo2
 
 EXTRA_LIB = $_ld_extra
@@ -2972,6 +2991,9 @@
    -cache <kilobytes> */
 #define USE_STREAM_CACHE 1
 
+/* Define to include support for OpenDivx/Divx4Linux */
+$_def_divx
+
 /* Define for using new DivX4Linux library, instead of open-source OpenDivX */
 /* You have to change DECORE_LIBS in config.mak too! */
 $_def_decore
@@ -3064,7 +3086,8 @@
 /* Define this to enable image postprocessing in libavcodec (requires FAST cpu!) */
 $_def_ffpostprocess
 
-#define HAVE_ODIVX_POSTPROCESS 1
+/* Define to include support for OpenDivx postprocessing */
+$_def_odivx_postprocess
 
 /* Win32 DLL support */
 $_def_win32
--- a/dec_video.c	Sat Feb 02 23:39:53 2002 +0000
+++ b/dec_video.c	Sun Feb 03 00:52:51 2002 +0000
@@ -80,11 +80,13 @@
     unsigned int lavc_pp=0;
 #endif
 
+#ifdef USE_DIVX
 #ifndef NEW_DECORE
 #include "opendivx/decore.h"
 #else
 #include <decore.h>
 #endif
+#endif
 
 #ifdef USE_XANIM
 #include "xacodec.h"
@@ -223,6 +225,7 @@
   case VFM_FFMPEG:
       return GET_PP_QUALITY_MAX;
 #endif
+#ifdef USE_DIVX
   case VFM_DIVX4:
   case VFM_ODIVX:
 #ifdef NEW_DECORE
@@ -230,6 +233,7 @@
 #else
       return GET_PP_QUALITY_MAX;  // for opendivx
 #endif
+#endif
  }
  return 0;
 }
@@ -262,6 +266,7 @@
     lavc_pp=getPpModeForQuality(quality);
     break;
 #endif
+#ifdef USE_DIVX
   case VFM_DIVX4:
   case VFM_ODIVX: {
    DEC_SET dec_set;
@@ -274,6 +279,7 @@
 #endif
    decore(0x123,DEC_OPT_SETPP,&dec_set,NULL);
   }
+#endif
   break;
  }
 }
@@ -403,10 +409,12 @@
 	xacodec_exit();
 	break;
 #endif
+#ifdef USE_DIVX
     case VFM_DIVX4:
     case VFM_ODIVX:
       decore(0x123,DEC_OPT_RELEASE,NULL,NULL);
       break;
+#endif
     }
     if(sh_video->our_out_buffer){
 	free(sh_video->our_out_buffer);
@@ -533,6 +541,10 @@
    return 0;
 #endif	/* !USE_WIN32DLL */
  case VFM_ODIVX: {  // OpenDivX
+#ifndef USE_DIVX
+   mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT OpenDivx support!\n");
+   return 0;
+#else
    mp_msg(MSGT_DECVIDEO,MSGL_V,"OpenDivX video codec\n");
    { DEC_PARAM dec_param;
      DEC_SET dec_set;
@@ -550,6 +562,7 @@
    }
    mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n");
    break;
+#endif
  }
  case VFM_DIVX4: {  // DivX4Linux
 #ifndef NEW_DECORE
@@ -813,6 +826,7 @@
     break;
   }
 #endif
+#ifdef USE_DIVX
   case VFM_ODIVX: {
     // OpenDivX
     DEC_FRAME dec_frame;
@@ -861,6 +875,7 @@
 
     break;
   }
+#endif
 #ifdef NEW_DECORE
   case VFM_DIVX4: {
     // DivX4Linux