Mercurial > mplayer.hg
changeset 17463:b56f34ba3f2f
proper support for shared libpostproc
patch by Nico Sabbi, fixes and consistency cleanups by me
author | diego |
---|---|
date | Sun, 22 Jan 2006 18:11:35 +0000 |
parents | 18c4f5105fe6 |
children | 6770c410f4f3 |
files | cfg-common.h configure libmpcodecs/Makefile libmpcodecs/vd_ffmpeg.c libmpcodecs/vf.c libmpcodecs/vf_pp.c |
diffstat | 6 files changed, 64 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/cfg-common.h Sun Jan 22 16:32:04 2006 +0000 +++ b/cfg-common.h Sun Jan 22 18:11:35 2006 +0000 @@ -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
--- a/configure Sun Jan 22 16:32:04 2006 +0000 +++ b/configure Sun Jan 22 18:11:35 2006 +0000 @@ -240,8 +240,10 @@ --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 @@ _libavcodec_so=auto _libavformat=auto _libavformat_so=auto +_libpostproc=auto +_libpostproc_so=auto _fame=auto _mp1e=no _mencoder=yes @@ -1818,6 +1822,10 @@ --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 @@ 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' -fi + _libpostproc='yes' +fi +fi +echores "$_libpostproc" + if test "$_libavcodec" != yes ; then echocheck "FFmpeg libavcodec (dynamic)" @@ -6059,7 +6072,6 @@ _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 <ffmpeg/avcodec.h> int main(void) { avcodec_find_encoder_by_name(""); @@ -6087,14 +6099,32 @@ 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 <inttypes.h> + #include <postproc/postprocess.h> + 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 @@ 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 @@ 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 @@ MUSEPACK = $_musepack UNRARLIB = $_unrarlib -HAVE_FFPOSTPROCESS = $_def_haveffpostprocess PNG = $_mkf_png JPEG = $_mkf_jpg GIF = $_mkf_gif @@ -7215,12 +7254,14 @@ 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 @@ #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
--- a/libmpcodecs/Makefile Sun Jan 22 16:32:04 2006 +0000 +++ b/libmpcodecs/Makefile Sun Jan 22 18:11:35 2006 +0000 @@ -139,7 +139,10 @@ 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
--- a/libmpcodecs/vd_ffmpeg.c Sun Jan 22 16:32:04 2006 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Sun Jan 22 18:11:35 2006 +0000 @@ -74,7 +74,7 @@ int b_count; } vd_ffmpeg_ctx; -//#ifdef FF_POSTPROCESS +//#ifdef USE_LIBPOSTPROC //unsigned int lavc_pp=0; //#endif
--- a/libmpcodecs/vf.c Sun Jan 22 16:32:04 2006 +0000 +++ b/libmpcodecs/vf.c Sun Jan 22 18:11:35 2006 +0000 @@ -30,7 +30,7 @@ #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 @@ #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,
--- a/libmpcodecs/vf_pp.c Sun Jan 22 16:32:04 2006 +0000 +++ b/libmpcodecs/vf_pp.c Sun Jan 22 18:11:35 2006 +0000 @@ -16,15 +16,17 @@ #include "mp_image.h" #include "vf.h" -#ifdef USE_LIBAVCODEC +#ifdef USE_LIBPOSTPROC_SO +#include <postproc/postprocess.h> +#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 @@ //===========================================================================// -#endif // USE_LIBAVCODEC