summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-03 00:52:51 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-03 00:52:51 +0000
commitb106f93d00cc57b4d1a12a36a14863d93b46a06d (patch)
treec26190479494997f4d55039faec92b5881f9d7e7
parent0234e8f3c7aa0153a2966470118b4587213d18ec (diff)
downloadmpv-b106f93d00cc57b4d1a12a36a14863d93b46a06d.tar.bz2
mpv-b106f93d00cc57b4d1a12a36a14863d93b46a06d.tar.xz
make opendivx codec optional at compiletime
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4490 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--Makefile10
-rwxr-xr-xconfigure31
-rw-r--r--dec_video.c15
3 files changed, 50 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index fe01ff9e59..d4b55b0f2f 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,10 @@ MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix
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 @@ all: $(ALL_PRG)
.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
diff --git a/configure b/configure
index f98c6e90c4..8a4bbc829c 100755
--- a/configure
+++ b/configure
@@ -123,6 +123,8 @@ Optional features:
--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 @@ _tv_v4l=auto
_streaming=yes
_vidix=yes
_divx4linux=auto
+_opendivx=yes
_lirc=auto
_gui=no
_termcap=auto
@@ -843,6 +846,8 @@ for ac_option do
--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 @@ EOF
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 = $_streaming
STREAMING_LIB = $_ld_streaming
VIDIX = $_vidix
+OPENDIVX = $_opendivx
+
VO2 = $_vo2
EXTRA_LIB = $_ld_extra
@@ -2972,6 +2991,9 @@ $_def_dvdread
-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 @@ $_def_css
/* 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
diff --git a/dec_video.c b/dec_video.c
index 90980c5bb2..f47204d983 100644
--- a/dec_video.c
+++ b/dec_video.c
@@ -80,11 +80,13 @@ static DS_VideoDecoder* ds_vdec=NULL;
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 @@ int get_video_quality_max(sh_video_t *sh_video){
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 @@ int get_video_quality_max(sh_video_t *sh_video){
#else
return GET_PP_QUALITY_MAX; // for opendivx
#endif
+#endif
}
return 0;
}
@@ -262,6 +266,7 @@ void set_video_quality(sh_video_t *sh_video,int quality){
lavc_pp=getPpModeForQuality(quality);
break;
#endif
+#ifdef USE_DIVX
case VFM_DIVX4:
case VFM_ODIVX: {
DEC_SET dec_set;
@@ -274,6 +279,7 @@ void set_video_quality(sh_video_t *sh_video,int quality){
#endif
decore(0x123,DEC_OPT_SETPP,&dec_set,NULL);
}
+#endif
break;
}
}
@@ -403,10 +409,12 @@ void uninit_video(sh_video_t *sh_video){
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 @@ switch(sh_video->codec->driver){
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 @@ switch(sh_video->codec->driver){
}
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 @@ switch(sh_video->codec->driver){
break;
}
#endif
+#ifdef USE_DIVX
case VFM_ODIVX: {
// OpenDivX
DEC_FRAME dec_frame;
@@ -861,6 +875,7 @@ switch(sh_video->codec->driver){
break;
}
+#endif
#ifdef NEW_DECORE
case VFM_DIVX4: {
// DivX4Linux