changeset 34671:77e737045fbf

build: Separate libpostproc check from FFmpeg check. Unless GPL has been enabled, libpostproc may not be available or it may not be available at all.
author diego
date Wed, 22 Feb 2012 14:19:45 +0000
parents 9b1849ac4ef7
children ed17a153a918
files Makefile cfg-common.h configure libmpcodecs/vf.c
diffstat 4 files changed, 37 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Wed Feb 22 14:17:00 2012 +0000
+++ b/Makefile	Wed Feb 22 14:19:45 2012 +0000
@@ -78,7 +78,6 @@
                                         libmpcodecs/vf_geq.c        \
                                         libmpcodecs/vf_lavc.c       \
                                         libmpcodecs/vf_lavcdeint.c  \
-                                        libmpcodecs/vf_pp.c         \
                                         libmpcodecs/vf_screenshot.c \
                                         libmpdemux/demux_lavf.c     \
                                         stream/stream_ffmpeg.c      \
@@ -210,6 +209,7 @@
                                         stream/realrtsp/xbuffer.c \
 
 SRCS_COMMON-$(PNG)                   += libmpcodecs/vd_mpng.c
+SRCS_COMMON-$(POSTPROC)              += libmpcodecs/vf_pp.c
 SRCS_COMMON-$(PRIORITY)              += osdep/priority.c
 SRCS_COMMON-$(PVR)                   += stream/stream_pvr.c
 SRCS_COMMON-$(QTX_CODECS)            += libmpcodecs/ad_qtaudio.c \
--- a/cfg-common.h	Wed Feb 22 14:17:00 2012 +0000
+++ b/cfg-common.h	Wed Feb 22 14:19:45 2012 +0000
@@ -525,7 +525,7 @@
     {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
 
     // postprocessing:
-#ifdef CONFIG_FFMPEG
+#ifdef CONFIG_POSTPROC
     {"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL},
     {"pphelp", pp_help, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
 #endif
--- a/configure	Wed Feb 22 14:17:00 2012 +0000
+++ b/configure	Wed Feb 22 14:19:45 2012 +0000
@@ -416,6 +416,7 @@
   --disable-libnut          disable libnut [autodetect]
   --disable-ffmpeg_a        disable static FFmpeg [autodetect]
   --disable-ffmpeg_so       disable shared FFmpeg [autodetect]
+  --disable-postproc        disable libpostproc [autodetect]
   --enable-vf-lavfi         enable libavfilter wrapper [disabled]
   --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
                                     in libavcodec [enabled]
@@ -650,6 +651,7 @@
 _prefix="/usr/local"
 ffmpeg_a=auto
 ffmpeg_so=auto
+postproc=auto
 _vf_lavfi=no
 _libavcodec_mpegaudio_hp=yes
 _libopencore_amrnb=auto
@@ -1284,6 +1286,8 @@
   --disable-ffmpeg_a)   ffmpeg_a=no     ;;
   --enable-ffmpeg_so)   ffmpeg_so=yes   ;;
   --disable-ffmpeg_so)  ffmpeg_so=no    ;;
+  --enable-postproc)    postproc=yes    ;;
+  --disable-postproc)   postproc=no     ;;
   --enable-vf-lavfi)    _vf_lavfi=yes   ;;
   --disable-vf-lavfi)   _vf_lavfi=no    ;;
   --enable-libavcodec_mpegaudio_hp)     _libavcodec_mpegaudio_hp=yes    ;;
@@ -6718,12 +6722,12 @@
 elif test "$ffmpeg_so" = auto ; then
   ffmpeg_so=no
   if $_pkg_config --exists libavutil ; then
-    inc_ffmpeg=$($_pkg_config --cflags libpostproc libswscale libavformat libavcodec libavutil)
-    ld_tmp=$($_pkg_config --libs libpostproc libswscale libavformat libavcodec libavutil)
+    inc_ffmpeg=$($_pkg_config --cflags libswscale libavformat libavcodec libavutil)
+    ld_tmp=$($_pkg_config --libs libswscale libavformat libavcodec libavutil)
     header_check libavutil/avutil.h $inc_ffmpeg $ld_tmp &&
       extra_ldflags="$extra_ldflags $ld_tmp" && ffmpeg_so=yes && ffmpeg=yes
-  elif header_check libavutil/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil ; then
-    extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil"
+  elif header_check libavutil/avutil.h -lswscale -lavformat -lavcodec -lavutil ; then
+    extra_ldflags="$extra_ldflags -lswscale -lavformat -lavcodec -lavutil"
     ffmpeg_so=yes
     ffmpeg=yes
   fi
@@ -6752,6 +6756,28 @@
 echores "$ffmpeg"
 
 
+echocheck "libpostproc"
+if test "$postproc" = auto ; then
+  postproc=no
+  if test "$ffmpeg_a" = yes ; then
+    postproc=yes
+  elif $_pkg_config --exists libpostproc ; then
+    inc_postproc=$($_pkg_config --cflags libpostproc)
+    ld_tmp=$($_pkg_config --libs libpostproc)
+    header_check libpostproc/postprocess.h $inc_postproc $ld_tmp &&
+      extra_ldflags="$extra_ldflags $ld_tmp" && postproc=yes
+  elif header_check libpostproc/postprocess.h -lpostproc ; then
+    extra_ldflags="$extra_ldflags -lpostproc"
+    postproc=yes
+  fi
+fi
+if test "$postproc" = yes; then
+  def_postproc='#define CONFIG_POSTPROC 1'
+else
+  def_postproc='#undef CONFIG_POSTPROC'
+fi
+echores "$postproc"
+
 
 echocheck "libopencore_amr narrowband"
 if test "$_libopencore_amrnb" = auto ; then
@@ -8081,6 +8107,7 @@
 PE_EXECUTABLE = $_pe_executable
 PNG = $_png
 PNM = $_pnm
+POSTPROC = $postproc
 PRIORITY = $_priority
 PULSE = $_pulse
 PVR = $_pvr
@@ -8582,6 +8609,7 @@
 $def_md5sum
 $def_mga
 $def_mng
+$def_postproc
 $def_png
 $def_pnm
 $def_quartz
--- a/libmpcodecs/vf.c	Wed Feb 22 14:17:00 2012 +0000
+++ b/libmpcodecs/vf.c	Wed Feb 22 14:19:45 2012 +0000
@@ -140,7 +140,6 @@
     &vf_info_palette,
     &vf_info_pp7,
 #ifdef CONFIG_FFMPEG
-    &vf_info_pp,
     &vf_info_lavc,
     &vf_info_lavcdeint,
 #ifdef CONFIG_VF_LAVFI
@@ -149,6 +148,9 @@
     &vf_info_screenshot,
     &vf_info_geq,
 #endif
+#ifdef CONFIG_POSTPROC
+    &vf_info_pp,
+#endif
 #ifdef CONFIG_ZR
     &vf_info_zrmjpeg,
 #endif