[FFmpeg-devel] [PATCH] Allow linking to an external libpostproc

Michael Niedermayer michael at niedermayer.cc
Mon Oct 28 02:24:48 EET 2024


Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 Makefile             |  3 +--
 configure            | 18 ++++++++----------
 fftools/ffprobe.c    |  1 -
 fftools/opt_common.c |  1 -
 4 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index b350d7748f5..54125ebac75 100644
--- a/Makefile
+++ b/Makefile
@@ -19,14 +19,13 @@ vpath %/fate_config.sh.template $(SRC_PATH)
 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
 HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
 
-ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample
+ALLFFLIBS = avcodec avdevice avfilter avformat avutil swscale swresample
 
 # $(FFLIBS-yes) needs to be in linking order
 FFLIBS-$(CONFIG_AVDEVICE)   += avdevice
 FFLIBS-$(CONFIG_AVFILTER)   += avfilter
 FFLIBS-$(CONFIG_AVFORMAT)   += avformat
 FFLIBS-$(CONFIG_AVCODEC)    += avcodec
-FFLIBS-$(CONFIG_POSTPROC)   += postproc
 FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
 FFLIBS-$(CONFIG_SWSCALE)    += swscale
 
diff --git a/configure b/configure
index 9f508a2527d..9fdcd352be3 100755
--- a/configure
+++ b/configure
@@ -130,7 +130,6 @@ Component options:
   --disable-avformat       disable libavformat build
   --disable-swresample     disable libswresample build
   --disable-swscale        disable libswscale build
-  --disable-postproc       disable libpostproc build
   --disable-avfilter       disable libavfilter build
   --disable-pthreads       disable pthreads [autodetect]
   --disable-w32threads     disable Win32 threads [autodetect]
@@ -260,6 +259,7 @@ External library support:
                            for DNN based filters like dnn_processing [no]
   --enable-libopus         enable Opus de/encoding via libopus [no]
   --enable-libplacebo      enable libplacebo library [no]
+  --disable-libpostproc    disable libpostproc library [autodetect]
   --enable-libpulse        enable Pulseaudio input via libpulse [no]
   --enable-libqrencode     enable QR encode generation via libqrencode [no]
   --enable-libquirc        enable QR decoding via libquirc [no]
@@ -1845,6 +1845,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
     bzlib
     coreimage
     iconv
+    libpostproc
     libxcb
     libxcb_shm
     libxcb_shape
@@ -2055,7 +2056,6 @@ LIBRARY_LIST="
     avdevice
     avfilter
     swscale
-    postproc
     avformat
     avcodec
     swresample
@@ -3933,7 +3933,7 @@ pan_filter_deps="swresample"
 perspective_filter_deps="gpl"
 phase_filter_deps="gpl"
 pp7_filter_deps="gpl"
-pp_filter_deps="gpl postproc"
+pp_filter_deps="gpl libpostproc"
 prewitt_opencl_filter_deps="opencl"
 procamp_vaapi_filter_deps="vaapi"
 program_opencl_filter_deps="opencl"
@@ -4048,8 +4048,8 @@ avfilter_suggest="libm stdatomic spirv_compiler"
 avformat_deps="avcodec avutil"
 avformat_suggest="libm network zlib stdatomic"
 avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
-postproc_deps="avutil gpl"
-postproc_suggest="libm stdatomic"
+libpostproc_deps="avutil gpl"
+libpostproc_suggest="libm stdatomic"
 swresample_deps="avutil"
 swresample_suggest="libm libsoxr stdatomic"
 swscale_deps="avutil"
@@ -6989,6 +6989,7 @@ enabled libopus           && {
     }
 }
 enabled libplacebo        && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
+enabled libpostproc       && check_pkg_config libpostproc libpostproc libpostproc/postprocess.h pp_postprocess
 enabled libpulse          && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
 enabled libqrencode       && require_pkg_config libqrencode libqrencode qrencode.h QRcode_encodeString
 enabled libquirc          && require libquirc quirc.h quirc_decode -lquirc
@@ -7470,7 +7471,7 @@ void (^block)(void);
 EOF
 
 # add some linker flags
-check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
+check_ldflags -Wl,-rpath-link=:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
 enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
 
@@ -7822,7 +7823,6 @@ enabled fsync_filter        && prepend avfilter_deps "avformat"
 enabled mcdeint_filter      && prepend avfilter_deps "avcodec"
 enabled movie_filter        && prepend avfilter_deps "avformat avcodec"
 enabled pan_filter          && prepend avfilter_deps "swresample"
-enabled pp_filter           && prepend avfilter_deps "postproc"
 enabled qrencode_filter     && prepend avfilter_deps "swscale"
 enabled qrencodesrc_filter  && prepend avfilter_deps "swscale"
 enabled removelogo_filter   && prepend avfilter_deps "avformat avcodec swscale"
@@ -7879,7 +7879,7 @@ expand_deps(){
 }
 
 #we have to remove gpl from the deps here as some code assumes all lib deps are libs
-postproc_deps="$(filter_out 'gpl' $postproc_deps)"
+libpostproc_deps="$(filter_out 'gpl' $libpostproc_deps)"
 
 map 'expand_deps $v' $LIBRARY_LIST
 
@@ -7970,7 +7970,6 @@ echo "optimize for size         ${small-no}"
 echo "optimizations             ${optimizations-no}"
 echo "static                    ${static-no}"
 echo "shared                    ${shared-no}"
-echo "postprocessing support    ${postproc-no}"
 echo "network support           ${network-no}"
 echo "threading support         ${thread_type-no}"
 echo "safe bitstream reader     ${safe_bitstream_reader-no}"
@@ -8346,7 +8345,6 @@ extralibs_avcodec="$avcodec_extralibs"
 extralibs_avformat="$avformat_extralibs"
 extralibs_avdevice="$avdevice_extralibs"
 extralibs_avfilter="$avfilter_extralibs"
-extralibs_postproc="$postproc_extralibs"
 extralibs_swscale="$swscale_extralibs"
 extralibs_swresample="$swresample_extralibs"
 EOF
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 14b98d22a19..b02242aceb1 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -4132,7 +4132,6 @@ static void ffprobe_show_library_versions(WriterContext *w)
     SHOW_LIB_VERSION(avfilter,   AVFILTER);
     SHOW_LIB_VERSION(swscale,    SWSCALE);
     SHOW_LIB_VERSION(swresample, SWRESAMPLE);
-    SHOW_LIB_VERSION(postproc,   POSTPROC);
     writer_print_section_footer(w);
 }
 
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 34da2cee7d8..ed9446b73f0 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -191,7 +191,6 @@ static void print_all_libs_info(int flags, int level)
     PRINT_LIB_INFO(avfilter,   AVFILTER,   flags, level);
     PRINT_LIB_INFO(swscale,    SWSCALE,    flags, level);
     PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level);
-    PRINT_LIB_INFO(postproc,   POSTPROC,   flags, level);
 }
 
 static void print_program_info(int flags, int level)
-- 
2.47.0



More information about the ffmpeg-devel mailing list