From 64060df2c73a4db6c1cda20deb8d49ed0d77646f Mon Sep 17 00:00:00 2001 From: iive Date: Wed, 12 Nov 2003 00:43:42 +0000 Subject: [PATCH] XviD Api4 support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11437 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common.h | 4 ++-- cfg-mencoder.h | 6 +++--- configure | 31 +++++++++++++++++++++---------- libmpcodecs/Makefile | 4 ++-- libmpcodecs/vd.c | 2 +- libmpcodecs/vd_xvid.c | 2 +- libmpcodecs/ve.c | 2 +- libmpcodecs/ve_xvid.c | 2 +- 8 files changed, 32 insertions(+), 21 deletions(-) diff --git a/cfg-common.h b/cfg-common.h index a7b236a928..7201f847bc 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -200,7 +200,7 @@ #ifdef USE_LIBAVCODEC {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif -#ifdef HAVE_XVID +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) {"xvidopts", xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif // ------------------------- subtitles options -------------------- @@ -437,7 +437,7 @@ m_option_t audio_filter_conf[]={ extern m_option_t lavc_decode_opts_conf[]; #endif -#ifdef HAVE_XVID +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) extern m_option_t xvid_dec_opts[]; #endif diff --git a/cfg-mencoder.h b/cfg-mencoder.h index 658f244bf5..54f93fd147 100644 --- a/cfg-mencoder.h +++ b/cfg-mencoder.h @@ -52,7 +52,7 @@ extern m_option_t lavcopts_conf[]; extern m_option_t vfwopts_conf[]; #endif -#ifdef HAVE_XVID +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) extern m_option_t xvidencopts_conf[]; #endif @@ -93,7 +93,7 @@ m_option_t ovc_conf[]={ #ifdef HAVE_LIBDV095 " libdv - DV encoding using libdv v0.9.5\n" #endif -#ifdef HAVE_XVID +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) " xvid - xvid encoding\n" #endif "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, @@ -216,7 +216,7 @@ m_option_t mencoder_opts[]={ #ifdef USE_WIN32DLL {"vfwopts", vfwopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif -#ifdef HAVE_XVID +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) {"xvidencopts", xvidencopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif diff --git a/configure b/configure index 1ca296ec59..c64fd7cbd0 100755 --- a/configure +++ b/configure @@ -1076,6 +1076,7 @@ fi _prefix="/usr/local" _xvmclib="XvMCNVIDIA" +_xvidcore="xvidcore" # GOTCHA: the variables below defines the default behavior for autodetection # and have - unless stated otherwise - at least 2 states : yes no @@ -4932,21 +4933,30 @@ cat > $TMPC << EOF #include int main(void) { xvid_init(0, 0, 0, 0); return 0; } EOF -if test "$_xvid" != no && cc_check "$_xvidcore" -lm ; then +if test "$_xvid" != no && cc_check -l$_xvidcore -lm ; then _xvid=yes - _ld_xvid="$_xvidcore" - _def_xvid='#define HAVE_XVID 1' - _codecmodules="xvid $_codecmodules" -elif test "$_xvid" != no && cc_check -lxvidcore -lm ; then - _xvid=yes - _ld_xvid='-lxvidcore' - _def_xvid='#define HAVE_XVID 1' + _ld_xvid="-l$_xvidcore" + _def_xvid3='#define HAVE_XVID3 1' + _def_xvid4='#undef HAVE_XVID4' _codecmodules="xvid $_codecmodules" else +cat > $TMPC << EOF +#include +int main(void) { xvid_global(0, 0, 0, 0); return 0; } +EOF + if test "$_xvid" != no && cc_check -l$_xvidcore -lm ; then + _xvid=yes + _ld_xvid="-l$_xvidcore" + _def_xvid3='#undef HAVE_XVID3' + _def_xvid4='#define HAVE_XVID4 1' + _codecmodules="xvid $_codecmodules" + else _xvid=no _ld_xvid='' - _def_xvid='#undef HAVE_XVID' + _def_xvid3='#undef HAVE_XVID3' + _def_xvid4='#undef HAVE_XVID4' _nocodecmodules="xvid $_nocodecmodules" + fi fi echores "$_xvid" @@ -5930,7 +5940,8 @@ $_def_decore $_def_divx5 /* Define if you are using XviD library */ -$_def_xvid +$_def_xvid3 +$_def_xvid4 $_def_decore_xvid $_def_encore_xvid diff --git a/libmpcodecs/Makefile b/libmpcodecs/Makefile index cabdbe05b3..e772f26dd8 100644 --- a/libmpcodecs/Makefile +++ b/libmpcodecs/Makefile @@ -11,7 +11,7 @@ AUDIO_SRCS=dec_audio.c ad.c $(AUDIO_SRCS_LIB) $(AUDIO_SRCS_NAT) $(AUDIO_SRCS_OPT VIDEO_SRCS_LIB=vd_libmpeg2.c vd_nuv.c vd_lzo.c VIDEO_SRCS_NAT=vd_null.c vd_cinepak.c vd_qtrpza.c vd_raw.c vd_hmblck.c vd_msvidc.c vd_fli.c vd_qtrle.c vd_qtsmc.c vd_roqvideo.c vd_cyuv.c vd_msrle.c vd_mpegpes.c vd_lcl.c vd_mtga.c vd_sgi.c vd_qt8bps.c -VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_dmo.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_zrmjpeg.c vd_xanim.c vd_xvid.c vd_libdv.c vd_qtvideo.c vd_theora.c +VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_dmo.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_zrmjpeg.c vd_xanim.c vd_xvid.c vd_xvid4.c vd_libdv.c vd_qtvideo.c vd_theora.c VIDEO_SRCS=dec_video.c vd.c $(VIDEO_SRCS_NAT) $(VIDEO_SRCS_LIB) $(VIDEO_SRCS_OPT) VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_field.c vf_denoise3d.c vf_hqdn3d.c vf_detc.c vf_telecine.c vf_tfields.c vf_ivtc.c vf_ilpack.c vf_dsize.c vf_decimate.c vf_softpulldown.c vf_tinterlace.c vf_pullup.c pullup.c vf_framestep.c vf_tile.c vf_delogo.c vf_fil.c vf_hue.c vf_spp.c @@ -19,7 +19,7 @@ ifeq ($(HAVE_FFPOSTPROCESS),yes) VFILTER_SRCS += vf_pp.c endif -ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c ve_xvid.c ve_qtvideo.c ve_nuv.c +ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c ve_xvid.c ve_xvid4.c ve_qtvideo.c ve_nuv.c NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/fli.c native/minilzo.c native/msvidc.c native/nuppelvideo.c native/qtrle.c native/qtrpza.c native/qtsmc.c native/roqav.c native/xa_gsm.c native/decode144.c native/decode288.c diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index a6a4366b9c..396620b602 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -120,7 +120,7 @@ vd_functions_t* mpcodecs_vd_drivers[] = { #ifdef USE_REALCODECS &mpcodecs_vd_realvid, #endif -#ifdef HAVE_XVID +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) &mpcodecs_vd_xvid, #endif #ifdef HAVE_LIBDV095 diff --git a/libmpcodecs/vd_xvid.c b/libmpcodecs/vd_xvid.c index a3d64337f1..f2ca6a152b 100644 --- a/libmpcodecs/vd_xvid.c +++ b/libmpcodecs/vd_xvid.c @@ -4,7 +4,7 @@ #include "config.h" #include "mp_msg.h" -#ifdef HAVE_XVID +#ifdef HAVE_XVID3 #include "vd_internal.h" #include "m_option.h" diff --git a/libmpcodecs/ve.c b/libmpcodecs/ve.c index 6c950f6ac8..1e9dd3dfe9 100644 --- a/libmpcodecs/ve.c +++ b/libmpcodecs/ve.c @@ -33,7 +33,7 @@ static vf_info_t* encoder_list[]={ &ve_info_libdv, #endif &ve_info_rawrgb, -#if defined(HAVE_XVID) +#if defined(HAVE_XVID3) || defined(HAVE_XVID4) &ve_info_xvid, #endif &ve_info_nuv, diff --git a/libmpcodecs/ve_xvid.c b/libmpcodecs/ve_xvid.c index 2b1d801321..2beab7e43f 100644 --- a/libmpcodecs/ve_xvid.c +++ b/libmpcodecs/ve_xvid.c @@ -12,7 +12,7 @@ #include "../config.h" #include "../mp_msg.h" -#ifdef HAVE_XVID +#ifdef HAVE_XVID3 #include "codec-cfg.h" #include "stream.h"