mirror of https://github.com/mpv-player/mpv
proper support for shared libpostproc
patch by Nico Sabbi, fixes and consistency cleanups by me git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17464 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
062bf105c0
commit
65f186f4d0
|
@ -192,7 +192,7 @@
|
||||||
{"oldpp", "MPlayer was compiled without the OpenDivX library.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
|
{"oldpp", "MPlayer was compiled without the OpenDivX library.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
{"npp", "-npp has been removed, use -vf pp and read the fine manual.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
|
{"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},
|
{"pphelp", &pp_help, CONF_TYPE_PRINT_INDIRECT, CONF_NOCFG, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -240,8 +240,10 @@ Codecs:
|
||||||
--enable-opendivx enable _old_ OpenDivx codec [disable]
|
--enable-opendivx enable _old_ OpenDivx codec [disable]
|
||||||
--disable-libavcodec disable libavcodec [autodetect]
|
--disable-libavcodec disable libavcodec [autodetect]
|
||||||
--disable-libavformat disable libavformat [autodetect]
|
--disable-libavformat disable libavformat [autodetect]
|
||||||
|
--disable-libpostproc disable libpostproc [autodetect]
|
||||||
--disable-libavcodec_so disable shared libavcodec [autodetect]
|
--disable-libavcodec_so disable shared libavcodec [autodetect]
|
||||||
--disable-libavformat_so disable shared libavformat [autodetect]
|
--disable-libavformat_so disable shared libavformat [autodetect]
|
||||||
|
--disable-libpostproc_so disable shared libpostproc [autodetect]
|
||||||
--enable-libfame enable libfame realtime encoder [autodetect]
|
--enable-libfame enable libfame realtime encoder [autodetect]
|
||||||
--disable-internal-tremor do not build internal OggVorbis support [enabled]
|
--disable-internal-tremor do not build internal OggVorbis support [enabled]
|
||||||
--enable-tremor-low build with lower accuracy internal tremor [disabled]
|
--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
|
_libavcodec_so=auto
|
||||||
_libavformat=auto
|
_libavformat=auto
|
||||||
_libavformat_so=auto
|
_libavformat_so=auto
|
||||||
|
_libpostproc=auto
|
||||||
|
_libpostproc_so=auto
|
||||||
_fame=auto
|
_fame=auto
|
||||||
_mp1e=no
|
_mp1e=no
|
||||||
_mencoder=yes
|
_mencoder=yes
|
||||||
|
@ -1818,6 +1822,10 @@ for ac_option do
|
||||||
--disable-libavformat) _libavformat=no ;;
|
--disable-libavformat) _libavformat=no ;;
|
||||||
--enable-libavformat_so) _libavformat_so=yes ;;
|
--enable-libavformat_so) _libavformat_so=yes ;;
|
||||||
--disable-libavformat_so) _libavformat_so=no ;;
|
--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 ;;
|
--enable-libfame) _fame=yes ;;
|
||||||
--disable-libfame) _fame=no ;;
|
--disable-libfame) _fame=no ;;
|
||||||
--enable-lirc) _lirc=yes ;;
|
--enable-lirc) _lirc=yes ;;
|
||||||
|
@ -6047,10 +6055,15 @@ if test "$_libavformat" = auto ; then
|
||||||
fi
|
fi
|
||||||
echores "$_libavformat"
|
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
|
if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
|
||||||
_def_haveffpostprocess='yes'
|
_libpostproc='yes'
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
echores "$_libpostproc"
|
||||||
|
|
||||||
|
|
||||||
if test "$_libavcodec" != yes ; then
|
if test "$_libavcodec" != yes ; then
|
||||||
echocheck "FFmpeg libavcodec (dynamic)"
|
echocheck "FFmpeg libavcodec (dynamic)"
|
||||||
|
@ -6059,7 +6072,6 @@ if test "$_libavcodec_so" = auto ; then
|
||||||
_res_comment="libavcodec.so is broken/obsolete"
|
_res_comment="libavcodec.so is broken/obsolete"
|
||||||
# FIXME : check for avcodec_find_encoder_by_name() for mencoder
|
# FIXME : check for avcodec_find_encoder_by_name() for mencoder
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
#define FF_POSTPROCESS 1
|
|
||||||
#include <ffmpeg/avcodec.h>
|
#include <ffmpeg/avcodec.h>
|
||||||
int main(void) {
|
int main(void) {
|
||||||
avcodec_find_encoder_by_name("");
|
avcodec_find_encoder_by_name("");
|
||||||
|
@ -6087,14 +6099,32 @@ fi
|
||||||
echores "$_libavformat_so"
|
echores "$_libavformat_so"
|
||||||
fi
|
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='#undef USE_LIBAVCODEC'
|
||||||
_def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
|
_def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
|
||||||
_def_ffpostprocess='#undef FF_POSTPROCESS'
|
|
||||||
if test "$_libavcodec" = yes ; then
|
if test "$_libavcodec" = yes ; then
|
||||||
_def_libavcodec='#define USE_LIBAVCODEC 1'
|
_def_libavcodec='#define USE_LIBAVCODEC 1'
|
||||||
_ld_libavcodec='libavcodec/libavcodec.a'
|
_ld_libavcodec='libavcodec/libavcodec.a'
|
||||||
_dep_libavcodec='libavcodec/libavcodec.a'
|
_dep_libavcodec='libavcodec/libavcodec.a'
|
||||||
_def_ffpostprocess='#define FF_POSTPROCESS 1'
|
|
||||||
_codecmodules="libavcodec $_codecmodules"
|
_codecmodules="libavcodec $_codecmodules"
|
||||||
if test "$_libavutil" = yes; then
|
if test "$_libavutil" = yes; then
|
||||||
_ld_libavutil='libavutil/libavutil.a'
|
_ld_libavutil='libavutil/libavutil.a'
|
||||||
|
@ -6103,7 +6133,6 @@ if test "$_libavcodec" = yes ; then
|
||||||
elif test "$_libavcodec_so" = yes ; then
|
elif test "$_libavcodec_so" = yes ; then
|
||||||
_def_libavcodec='#define USE_LIBAVCODEC 1'
|
_def_libavcodec='#define USE_LIBAVCODEC 1'
|
||||||
_def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
|
_def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
|
||||||
_def_ffpostprocess='#define FF_POSTPROCESS 1'
|
|
||||||
_ld_libavcodec='-lavcodec'
|
_ld_libavcodec='-lavcodec'
|
||||||
_codecmodules="libavcodec.so $_codecmodules"
|
_codecmodules="libavcodec.so $_codecmodules"
|
||||||
else
|
else
|
||||||
|
@ -6130,6 +6159,17 @@ else
|
||||||
fi
|
fi
|
||||||
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"
|
echocheck "amr narrowband"
|
||||||
if test "$_amr_nb" = auto ; then
|
if test "$_amr_nb" = auto ; then
|
||||||
_amr_nb=no
|
_amr_nb=no
|
||||||
|
@ -7143,7 +7183,6 @@ SPEEX = $_speex
|
||||||
MUSEPACK = $_musepack
|
MUSEPACK = $_musepack
|
||||||
|
|
||||||
UNRARLIB = $_unrarlib
|
UNRARLIB = $_unrarlib
|
||||||
HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
|
|
||||||
PNG = $_mkf_png
|
PNG = $_mkf_png
|
||||||
JPEG = $_mkf_jpg
|
JPEG = $_mkf_jpg
|
||||||
GIF = $_mkf_gif
|
GIF = $_mkf_gif
|
||||||
|
@ -7215,12 +7254,14 @@ W32_LIB = $_ld_win32
|
||||||
DS_DEP = $_dep_dshow
|
DS_DEP = $_dep_dshow
|
||||||
DS_LIB = $_ld_dshow
|
DS_LIB = $_ld_dshow
|
||||||
AV_DEP = $_dep_libavutil $_dep_libavcodec $_dep_libavformat
|
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_LIBAVUTIL = $_libavutil
|
||||||
CONFIG_LIBAVCODEC = $_libavcodec
|
CONFIG_LIBAVCODEC = $_libavcodec
|
||||||
CONFIG_LIBAVCODEC_SO = $_libavcodec_so
|
CONFIG_LIBAVCODEC_SO = $_libavcodec_so
|
||||||
CONFIG_LIBAVFORMAT = $_libavformat
|
CONFIG_LIBAVFORMAT = $_libavformat
|
||||||
CONFIG_LIBAVFORMAT_SO = $_libavformat_so
|
CONFIG_LIBAVFORMAT_SO = $_libavformat_so
|
||||||
|
CONFIG_LIBPOSTPROC = $_libpostproc
|
||||||
|
CONFIG_LIBPOSTPROC_SO = $_libpostproc_so
|
||||||
ZORAN = $_zr
|
ZORAN = $_zr
|
||||||
FAME = $_fame
|
FAME = $_fame
|
||||||
FAME_LIB = $_ld_fame
|
FAME_LIB = $_ld_fame
|
||||||
|
@ -7587,7 +7628,8 @@ $_def_dvdnav_version
|
||||||
#define MPEG12_POSTPROC 1
|
#define MPEG12_POSTPROC 1
|
||||||
|
|
||||||
/* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
|
/* 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 */
|
/* Define to include support for OpenDivx postprocessing */
|
||||||
$_def_odivx_postprocess
|
$_def_odivx_postprocess
|
||||||
|
|
|
@ -139,7 +139,10 @@ VFILTER_SRCS=vf.c \
|
||||||
vf_yvu9.c \
|
vf_yvu9.c \
|
||||||
vf_screenshot.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
|
VFILTER_SRCS += vf_pp.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ typedef struct {
|
||||||
int b_count;
|
int b_count;
|
||||||
} vd_ffmpeg_ctx;
|
} vd_ffmpeg_ctx;
|
||||||
|
|
||||||
//#ifdef FF_POSTPROCESS
|
//#ifdef USE_LIBPOSTPROC
|
||||||
//unsigned int lavc_pp=0;
|
//unsigned int lavc_pp=0;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern vf_info_t vf_info_bmovl;
|
||||||
#endif
|
#endif
|
||||||
extern vf_info_t vf_info_crop;
|
extern vf_info_t vf_info_crop;
|
||||||
extern vf_info_t vf_info_expand;
|
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;
|
extern vf_info_t vf_info_pp;
|
||||||
#endif
|
#endif
|
||||||
extern vf_info_t vf_info_scale;
|
extern vf_info_t vf_info_scale;
|
||||||
|
@ -109,7 +109,7 @@ static vf_info_t* filter_list[]={
|
||||||
#endif
|
#endif
|
||||||
&vf_info_crop,
|
&vf_info_crop,
|
||||||
&vf_info_expand,
|
&vf_info_expand,
|
||||||
#ifdef FF_POSTPROCESS
|
#if defined(USE_LIBPOSTPROC) || defined(USE_LIBPOSTPROC_SO)
|
||||||
&vf_info_pp,
|
&vf_info_pp,
|
||||||
#endif
|
#endif
|
||||||
&vf_info_scale,
|
&vf_info_scale,
|
||||||
|
|
|
@ -16,15 +16,17 @@
|
||||||
#include "mp_image.h"
|
#include "mp_image.h"
|
||||||
#include "vf.h"
|
#include "vf.h"
|
||||||
|
|
||||||
#ifdef USE_LIBAVCODEC
|
|
||||||
|
|
||||||
|
#ifdef USE_LIBPOSTPROC_SO
|
||||||
|
#include <postproc/postprocess.h>
|
||||||
|
#elif defined(USE_LIBPOSTPROC)
|
||||||
#define EMU_OLD
|
#define EMU_OLD
|
||||||
|
|
||||||
#include "libavcodec/libpostproc/postprocess.h"
|
#include "libavcodec/libpostproc/postprocess.h"
|
||||||
|
|
||||||
#ifdef EMU_OLD
|
#ifdef EMU_OLD
|
||||||
#include "libavcodec/libpostproc/postprocess_internal.h"
|
#include "libavcodec/libpostproc/postprocess_internal.h"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
struct vf_priv_s {
|
struct vf_priv_s {
|
||||||
int pp;
|
int pp;
|
||||||
|
@ -226,4 +228,3 @@ vf_info_t vf_info_pp = {
|
||||||
|
|
||||||
//===========================================================================//
|
//===========================================================================//
|
||||||
|
|
||||||
#endif // USE_LIBAVCODEC
|
|
||||||
|
|
Loading…
Reference in New Issue