diff --git a/cfg-common.h b/cfg-common.h index 8e3cebc4fa..5d6b360f90 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -192,7 +192,7 @@ {"oldpp", "MPlayer was compiled without the OpenDivX library.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif {"npp", "-npp has been removed, use -vf pp and read the fine manual.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#ifdef FF_POSTPROCESS +#if defined(USE_LIBPOSTPROC) || defined(USE_LIBPOSTPROC_SO) {"pphelp", &pp_help, CONF_TYPE_PRINT_INDIRECT, CONF_NOCFG, 0, 0, NULL}, #endif diff --git a/configure b/configure index 0008e377a3..2c38d36103 100755 --- a/configure +++ b/configure @@ -240,8 +240,10 @@ Codecs: --enable-opendivx enable _old_ OpenDivx codec [disable] --disable-libavcodec disable libavcodec [autodetect] --disable-libavformat disable libavformat [autodetect] + --disable-libpostproc disable libpostproc [autodetect] --disable-libavcodec_so disable shared libavcodec [autodetect] --disable-libavformat_so disable shared libavformat [autodetect] + --disable-libpostproc_so disable shared libpostproc [autodetect] --enable-libfame enable libfame realtime encoder [autodetect] --disable-internal-tremor do not build internal OggVorbis support [enabled] --enable-tremor-low build with lower accuracy internal tremor [disabled] @@ -1468,6 +1470,8 @@ _libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.* _libavcodec_so=auto _libavformat=auto _libavformat_so=auto +_libpostproc=auto +_libpostproc_so=auto _fame=auto _mp1e=no _mencoder=yes @@ -1818,6 +1822,10 @@ for ac_option do --disable-libavformat) _libavformat=no ;; --enable-libavformat_so) _libavformat_so=yes ;; --disable-libavformat_so) _libavformat_so=no ;; + --enable-libpostproc) _libpostproc=yes ;; + --disable-libpostproc) _libpostproc=no ;; + --enable-libpostproc_so) _libpostproc_so=yes ;; + --disable-libpostproc_so) _libpostproc_so=no ;; --enable-libfame) _fame=yes ;; --disable-libfame) _fame=no ;; --enable-lirc) _lirc=yes ;; @@ -6047,10 +6055,15 @@ if test "$_libavformat" = auto ; then fi echores "$_libavformat" -_def_haveffpostprocess='no' +echocheck "FFmpeg libpostproc (static)" +if test "$_libpostproc" = auto ; then +_libpostproc=no if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then - _def_haveffpostprocess='yes' + _libpostproc='yes' fi +fi +echores "$_libpostproc" + if test "$_libavcodec" != yes ; then echocheck "FFmpeg libavcodec (dynamic)" @@ -6059,7 +6072,6 @@ if test "$_libavcodec_so" = auto ; then _res_comment="libavcodec.so is broken/obsolete" # FIXME : check for avcodec_find_encoder_by_name() for mencoder cat > $TMPC << EOF -#define FF_POSTPROCESS 1 #include int main(void) { avcodec_find_encoder_by_name(""); @@ -6087,14 +6099,32 @@ fi echores "$_libavformat_so" fi +if test "$_libpostproc" != yes ; then +echocheck "FFmpeg libpostproc (dynamic)" +if test "$_libpostproc_so" = auto ; then + _libpostproc_so=no + cat > $TMPC << EOF + #define USE_LIBPOSTPROC 1 + #include + #include + int main(void) { + pp_get_mode_by_name_and_quality("de", 0); + return 0;} +EOF + if cc_check -lpostproc $_ld_lm ; then + _libpostproc_so=yes + _res_comment="using libpostproc.so, but static libpostproc is recommended" + fi +fi +echores "$_libpostproc_so" +fi + _def_libavcodec='#undef USE_LIBAVCODEC' _def_libavcodec_so='#undef USE_LIBAVCODEC_SO' -_def_ffpostprocess='#undef FF_POSTPROCESS' if test "$_libavcodec" = yes ; then _def_libavcodec='#define USE_LIBAVCODEC 1' _ld_libavcodec='libavcodec/libavcodec.a' _dep_libavcodec='libavcodec/libavcodec.a' - _def_ffpostprocess='#define FF_POSTPROCESS 1' _codecmodules="libavcodec $_codecmodules" if test "$_libavutil" = yes; then _ld_libavutil='libavutil/libavutil.a' @@ -6103,7 +6133,6 @@ if test "$_libavcodec" = yes ; then elif test "$_libavcodec_so" = yes ; then _def_libavcodec='#define USE_LIBAVCODEC 1' _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1' - _def_ffpostprocess='#define FF_POSTPROCESS 1' _ld_libavcodec='-lavcodec' _codecmodules="libavcodec.so $_codecmodules" else @@ -6130,6 +6159,17 @@ else fi fi +_def_libpostproc='#undef USE_LIBPOSTPROC' +_def_libpostproc_so='#undef USE_LIBPOSTPROC_SO' +if test "$_libpostproc" = yes ; then + _def_libpostproc='#define USE_LIBPOSTPROC 1' +else + if test "$_libpostproc_so" = yes ; then + _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1' + _ld_libpostproc='-lpostproc' + fi +fi + echocheck "amr narrowband" if test "$_amr_nb" = auto ; then _amr_nb=no @@ -7143,7 +7183,6 @@ SPEEX = $_speex MUSEPACK = $_musepack UNRARLIB = $_unrarlib -HAVE_FFPOSTPROCESS = $_def_haveffpostprocess PNG = $_mkf_png JPEG = $_mkf_jpg GIF = $_mkf_gif @@ -7215,12 +7254,14 @@ W32_LIB = $_ld_win32 DS_DEP = $_dep_dshow DS_LIB = $_ld_dshow AV_DEP = $_dep_libavutil $_dep_libavcodec $_dep_libavformat -AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil +AV_LIB = $_ld_libavutil $_ld_libavcodec $_ld_libavformat $_ld_libpostproc CONFIG_LIBAVUTIL = $_libavutil CONFIG_LIBAVCODEC = $_libavcodec CONFIG_LIBAVCODEC_SO = $_libavcodec_so CONFIG_LIBAVFORMAT = $_libavformat CONFIG_LIBAVFORMAT_SO = $_libavformat_so +CONFIG_LIBPOSTPROC = $_libpostproc +CONFIG_LIBPOSTPROC_SO = $_libpostproc_so ZORAN = $_zr FAME = $_fame FAME_LIB = $_ld_fame @@ -7587,7 +7628,8 @@ $_def_dvdnav_version #define MPEG12_POSTPROC 1 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */ -$_def_ffpostprocess +$_def_libpostproc +$_def_libpostproc_so /* Define to include support for OpenDivx postprocessing */ $_def_odivx_postprocess diff --git a/libmpcodecs/Makefile b/libmpcodecs/Makefile index bc89a7c8cb..494d27bd34 100644 --- a/libmpcodecs/Makefile +++ b/libmpcodecs/Makefile @@ -139,7 +139,10 @@ VFILTER_SRCS=vf.c \ vf_yvu9.c \ vf_screenshot.c \ -ifeq ($(HAVE_FFPOSTPROCESS),yes) +ifeq ($(CONFIG_LIBPOSTPROC),yes) +VFILTER_SRCS += vf_pp.c +endif +ifeq ($(CONFIG_LIBPOSTPROC_SO),yes) VFILTER_SRCS += vf_pp.c endif diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 76615ee4af..faf7b6a33f 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -74,7 +74,7 @@ typedef struct { int b_count; } vd_ffmpeg_ctx; -//#ifdef FF_POSTPROCESS +//#ifdef USE_LIBPOSTPROC //unsigned int lavc_pp=0; //#endif diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 52a5227b84..6b997cb114 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -30,7 +30,7 @@ extern vf_info_t vf_info_bmovl; #endif extern vf_info_t vf_info_crop; extern vf_info_t vf_info_expand; -#ifdef FF_POSTPROCESS +#if defined(USE_LIBPOSTPROC) || defined(USE_LIBPOSTPROC_SO) extern vf_info_t vf_info_pp; #endif extern vf_info_t vf_info_scale; @@ -109,7 +109,7 @@ static vf_info_t* filter_list[]={ #endif &vf_info_crop, &vf_info_expand, -#ifdef FF_POSTPROCESS +#if defined(USE_LIBPOSTPROC) || defined(USE_LIBPOSTPROC_SO) &vf_info_pp, #endif &vf_info_scale, diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c index f2fee138f0..5b623c8102 100644 --- a/libmpcodecs/vf_pp.c +++ b/libmpcodecs/vf_pp.c @@ -16,15 +16,17 @@ #include "mp_image.h" #include "vf.h" -#ifdef USE_LIBAVCODEC +#ifdef USE_LIBPOSTPROC_SO +#include +#elif defined(USE_LIBPOSTPROC) #define EMU_OLD - #include "libavcodec/libpostproc/postprocess.h" #ifdef EMU_OLD #include "libavcodec/libpostproc/postprocess_internal.h" #endif +#endif struct vf_priv_s { int pp; @@ -226,4 +228,3 @@ vf_info_t vf_info_pp = { //===========================================================================// -#endif // USE_LIBAVCODEC