X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=18fbb73045118661efa458bfe7d95c1383313a17;hb=52a4004d8b5f308b3fc83e825dcd9052332eaeef;hp=2e2571493ad7442afb8da764bc246e00872a0c68;hpb=a96db6be06cfc7f179ed05f077e06bd1fa9d41ca;p=ffmpeg diff --git a/configure b/configure index 2e2571493ad..18fbb730451 100755 --- a/configure +++ b/configure @@ -77,7 +77,7 @@ Help options: --list-filters show all available filters Standard options: - --logfile=FILE log tests and output to FILE [config.log] + --logfile=FILE log tests and output to FILE [ffbuild/config.log] --disable-logging do not log configure debug information --fatal-warnings fail if any configure warning is generated --prefix=PREFIX install in PREFIX [$prefix_default] @@ -109,7 +109,6 @@ Configuration options: --enable-gray enable full grayscale support (slower color) --disable-swscale-alpha disable alpha channel support in swscale --disable-all disable building components, libraries and programs - --enable-raise-major increase major version numbers in sonames [no] Program options: --disable-programs do not build command line programs @@ -245,6 +244,7 @@ External library support: --enable-libopenmpt enable decoding tracked files via libopenmpt [no] --enable-libopus enable Opus de/encoding via libopus [no] --enable-libpulse enable Pulseaudio input via libpulse [no] + --enable-librsvg enable SVG rasterization via librsvg [no] --enable-librubberband enable rubberband needed for rubberband filter [no] --enable-librtmp enable RTMP[E] support via librtmp [no] --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no] @@ -297,6 +297,7 @@ External library support: The following libraries provide various hardware acceleration features: --disable-audiotoolbox disable Apple AudioToolbox code [autodetect] --disable-cuda disable dynamically linked Nvidia CUDA code [autodetect] + --enable-cuda-sdk enable CUDA features that require the CUDA SDK [no] --disable-cuvid disable Nvidia CUVID support [autodetect] --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect] --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect] @@ -337,6 +338,7 @@ Toolchain options: --cxx=CXX use C compiler CXX [$cxx_default] --objcc=OCC use ObjC compiler OCC [$cc_default] --dep-cc=DEPCC use dependency generator DEPCC [$cc_default] + --nvcc=NVCC use Nvidia CUDA compiler NVCC [$nvcc_default] --ld=LD use linker LD [$ld_default] --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default] --pkg-config-flags=FLAGS pass additional flags to pkgconf [] @@ -358,6 +360,7 @@ Toolchain options: --extra-libs=ELIBS add ELIBS [$ELIBS] --extra-version=STRING version string suffix [] --optflags=OPTFLAGS override optimization-related compiler flags + --nvccflags=NVCCFLAGS override nvcc flags [$nvccflags_default] --build-suffix=SUFFIX library name suffix [] --enable-pic build position-independent code --enable-thumb compile for Thumb instruction set @@ -438,6 +441,10 @@ Developer options (useful when working on FFmpeg itself): --random-seed=VALUE seed value for --enable/disable-random --disable-valgrind-backtrace do not print a backtrace under Valgrind (only applies to --disable-optimizations builds) + --enable-osfuzz Enable building fuzzer tool + --libfuzzer=PATH path to libfuzzer + --ignore-tests=TESTS comma-separated list (without "fate-" prefix + in the name) of tests whose result is ignored NOTE: Object files are built at the place where configure is launched. EOF @@ -1221,10 +1228,13 @@ EOF check_lib(){ log check_lib "$@" - headers="$1" - funcs="$2" - shift 2 - check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" + name="$1" + headers="$2" + funcs="$3" + shift 3 + disable $name + check_func_headers "$headers" "$funcs" "$@" && + enable $name && add_extralibs "$@" } check_lib_cpp(){ @@ -1328,10 +1338,11 @@ check_compile_assert(){ require(){ log require "$@" name_version="$1" + name="${1%% *}" headers="$2" func="$3" shift 3 - check_lib "$headers" $func "$@" || die "ERROR: $name_version not found" + check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not found" } require_cpp(){ @@ -1549,6 +1560,7 @@ EXTERNAL_LIBRARY_LIST=" libopenmpt libopus libpulse + librsvg librtmp libschroedinger libshine @@ -1590,6 +1602,7 @@ HWACCEL_AUTODETECT_LIBRARY_LIST=" " HWACCEL_LIBRARY_NONFREE_LIST=" + cuda_sdk libnpp " @@ -1676,8 +1689,8 @@ CONFIG_LIST=" fontconfig memory_poisoning neon_clobber_test + ossfuzz pic - raise_major thumb valgrind_backtrace xmm_clobber_test @@ -1841,6 +1854,7 @@ HEADERS_LIST=" cdio_paranoia_h cdio_paranoia_paranoia_h cuda_h + d3d11_h dispatch_dispatch_h dev_bktr_ioctl_bt848_h dev_bktr_ioctl_meteor_h @@ -1850,7 +1864,6 @@ HEADERS_LIST=" direct_h dirent_h dlfcn_h - d3d11_h dxva_h ES2_gl_h gsm_h @@ -2202,6 +2215,7 @@ CMDLINE_SET=" host_ld host_ldflags host_os + ignore_tests install ld ln_s @@ -2209,6 +2223,7 @@ CMDLINE_SET=" malloc_prefix nm optflags + nvccflags pkg_config pkg_config_flags progs_suffix @@ -2448,6 +2463,7 @@ mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables" mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc" mjpegb_decoder_select="mjpeg_decoder" mlp_decoder_select="mlp_parser" +mlp_encoder_select="lpc" motionpixels_decoder_select="bswapdsp" mp1_decoder_select="mpegaudio" mp1float_decoder_select="mpegaudio" @@ -2514,6 +2530,7 @@ sonic_decoder_select="golomb rangecoder" sonic_encoder_select="golomb rangecoder" sonic_ls_encoder_select="golomb rangecoder" sp5x_decoder_select="mjpeg_decoder" +srgc_decoder_select="zlib" svq1_decoder_select="hpeldsp" svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc" svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp" @@ -2525,6 +2542,7 @@ thp_decoder_select="mjpeg_decoder" tiff_decoder_suggest="zlib lzma" tiff_encoder_suggest="zlib" truehd_decoder_select="mlp_parser" +truehd_encoder_select="lpc" truemotion2_decoder_select="bswapdsp" truespeech_decoder_select="bswapdsp" tscc_decoder_select="zlib" @@ -2703,7 +2721,8 @@ qsvenc_select="qsv" vaapi_encode_deps="vaapi" hwupload_cuda_filter_deps="cuda" -scale_npp_filter_deps="cuda libnpp" +scale_npp_filter_deps="cuda_sdk libnpp" +scale_cuda_filter_deps="cuda_sdk" nvenc_deps="cuda" nvenc_deps_any="dlopen LoadLibrary" @@ -2856,6 +2875,7 @@ libopenmpt_demuxer_deps="libopenmpt" libopus_decoder_deps="libopus" libopus_encoder_deps="libopus" libopus_encoder_select="audio_frame_queue" +librsvg_decoder_deps="librsvg" libschroedinger_decoder_deps="libschroedinger" libschroedinger_encoder_deps="libschroedinger" libshine_encoder_deps="libshine" @@ -3012,8 +3032,7 @@ sndio_outdev_deps="sndio" v4l_indev_deps="linux_videodev_h" v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h" -vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines" -vfwcap_indev_extralibs="-lavicap32" +vfwcap_indev_deps="vfw32 vfwcap_defines" xcbgrab_indev_deps="libxcb" xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute" xv_outdev_extralibs="-lXv -lX11 -lXext" @@ -3071,6 +3090,8 @@ unix_protocol_select="network" # filters afftfilt_filter_deps="avcodec" afftfilt_filter_select="fft" +afir_filter_deps="avcodec" +afir_filter_select="fft" amovie_filter_deps="avcodec avformat" aresample_filter_deps="swresample" ass_filter_deps="libass" @@ -3088,6 +3109,7 @@ deinterlace_vaapi_filter_deps="vaapi" delogo_filter_deps="gpl" deshake_filter_select="pixelutils" drawtext_filter_deps="libfreetype" +elbg_filter_deps="avcodec" eq_filter_deps="gpl" fftfilt_filter_deps="avcodec" fftfilt_filter_select="rdft" @@ -3186,6 +3208,7 @@ transcoding_example_deps="avfilter avcodec avformat avutil" # libraries, in linking order avcodec_deps="avutil" +avcodec_select="null_bsf" avdevice_deps="avformat avcodec avutil" avfilter_deps="avutil" avformat_deps="avcodec avutil" @@ -3216,7 +3239,7 @@ doc_deps_any="manpages htmlpages podpages txtpages" # default parameters -logfile="config.log" +logfile="ffbuild/config.log" # installation paths prefix_default="/usr/local" @@ -3243,6 +3266,8 @@ strip_default="strip" version_script='--version-script' yasmexe_default="yasm" windres_default="windres" +nvcc_default="nvcc" +nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2" # OS target_os_default=$(tolower $(uname -s)) @@ -3316,6 +3341,8 @@ HOSTCC_C='-c' HOSTCC_E='-E -o $@' HOSTCC_O='-o $@' HOSTLD_O='-o $@' +NVCC_C='-c' +NVCC_O='-o $@' host_extralibs='-lm' host_cflags_filter=echo @@ -3507,6 +3534,9 @@ for opt do ;; --fatal-warnings) enable fatal_warnings ;; + --libfuzzer=*) + libfuzzer_path="$optval" + ;; *) optname="${opt%%=*}" optname="${optname#--}" @@ -3570,11 +3600,17 @@ disable_components(){ map 'disable_components $v' $LIBRARY_LIST +mkdir -p ffbuild echo "# $0 $FFMPEG_CONFIGURATION" > $logfile set >> $logfile test -n "$valgrind" && toolchain="valgrind-memcheck" +enabled ossfuzz && { + add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer + add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp +} + case "$toolchain" in *-asan) cc_default="${toolchain%-asan}" @@ -3694,7 +3730,7 @@ windres_default="${cross_prefix}${windres_default}" sysinclude_default="${sysroot}/usr/include" set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \ - target_exec target_os yasmexe + target_exec target_os yasmexe nvcc enabled cross_compile || host_cc_default=$cc set_default host_cc @@ -3835,7 +3871,6 @@ msvc_common_flags(){ -mthumb) ;; -march=*) ;; -lz) echo zlib.lib ;; - -lavicap32) echo vfw32.lib user32.lib ;; -lx264) echo libx264.lib ;; -lstdc++) ;; -l*) echo ${flag#-l}.lib ;; @@ -4136,6 +4171,7 @@ probe_cc(){ _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed="-O2" _cflags_size="-O1" + _cflags_noopt="-O1" if $_cc -nologo- 2>&1 | grep -q Linker; then _ld_o='-out:$@' else @@ -4830,8 +4866,6 @@ case $target_os in else target_os=mingw32 fi - decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32" - decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32" LIBTARGET=i386 if enabled x86_64; then LIBTARGET="i386:x86-64" @@ -5136,7 +5170,7 @@ esc(){ echo "$*" | sed 's/%/%25/g;s/:/%3a/g' } -echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate +echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic @@ -5158,7 +5192,7 @@ EOF exit 1 fi -disabled optimizations || check_cflags -fomit-frame-pointer +disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer enable_weak_pic() { disabled pic && return @@ -5560,7 +5594,7 @@ check_func ${malloc_prefix}posix_memalign && enable posix_memalign check_func access check_func_headers stdlib.h arc4random check_func_headers time.h clock_gettime || - { check_lib time.h clock_gettime -lrt && LIBRT="-lrt"; } + { check_lib clock_gettime time.h clock_gettime -lrt && LIBRT="-lrt"; } check_func fcntl check_func fork check_func gethrtime @@ -5574,7 +5608,7 @@ check_func mmap check_func mprotect # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that check_func_headers time.h nanosleep || - { check_lib time.h nanosleep -lrt && LIBRT="-lrt"; } + { check_lib nanosleep time.h nanosleep -lrt && LIBRT="-lrt"; } check_func sched_getaffinity check_func setrlimit check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE @@ -5605,10 +5639,10 @@ enabled xlib && check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext check_header AudioToolbox/AudioToolbox.h +check_header d3d11.h check_header direct.h check_header dirent.h check_header dlfcn.h -check_header d3d11.h check_header dxva.h check_header dxva2api.h -D_WIN32_WINNT=0x0600 check_header io.h @@ -5639,11 +5673,11 @@ check_header asm/types.h # so we also check that atomics actually work here check_builtin stdatomic_h stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)" -check_lib "windows.h shellapi.h" CommandLineToArgvW -lshell32 -check_lib "windows.h wincrypt.h" CryptGenRandom -ladvapi32 -check_lib "windows.h psapi.h" GetProcessMemoryInfo -lpsapi +check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32 +check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom -ladvapi32 +check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi -check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices" +check_lib coreservices "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices" check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss @@ -5678,22 +5712,23 @@ fi # check for some common methods of building with pthread support # do this before the optional library checks as some of them require pthreads if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then - enable pthreads - if check_func pthread_join -pthread && check_func pthread_create -pthread; then + if check_lib pthreads pthread.h pthread_join -pthread && + check_lib pthreads pthread.h pthread_create -pthread; then add_cflags -pthread - add_extralibs -pthread - elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then + elif check_lib pthreads pthread.h pthread_join -pthreads && + check_lib pthreads pthread.h pthread_create -pthreads; then add_cflags -pthreads - add_extralibs -pthreads - elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then + elif check_lib pthreads pthread.h pthread_join -ldl -pthread && + check_lib pthreads pthread.h pthread_create -ldl -pthread; then add_cflags -ldl -pthread - add_extralibs -ldl -pthread - elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then - add_extralibs -lpthreadGC2 - elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then + elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 && + check_lib pthreads pthread.h pthread_create -lpthreadGC2; then : - elif ! check_func pthread_join && ! check_func pthread_create; then - disable pthreads + elif check_lib pthreads pthread.h pthread_join -lpthread && + check_lib pthreads pthread.h pthread_create -lpthread; then + : + elif check_func pthread_join && check_func pthread_create; then + enable pthreads fi check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads fi @@ -5706,12 +5741,12 @@ fi enabled pthreads && check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" -disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib -disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib -disabled lzma || check_lib lzma.h lzma_version_number -llzma || disable lzma +disabled zlib || check_lib zlib zlib.h zlibVersion -lz +disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 +disabled lzma || check_lib lzma lzma.h lzma_version_number -llzma -check_lib math.h sin -lm && LIBM="-lm" -disabled crystalhd || check_lib "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd || disable crystalhd +check_lib libm math.h sin -lm && LIBM="-lm" +disabled crystalhd || check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd atan2f_args=2 copysign_args=2 @@ -5729,9 +5764,9 @@ done # these are off by default, so fail if requested and not available enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; } -enabled avfoundation_indev && { check_lib CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics || - check_lib ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; } -enabled cuda && check_header cuda.h # this is not a dependency +enabled avfoundation_indev && { check_lib avfoundation_indev CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics || + check_lib avfoundation_indev ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; } +enabled cuda_sdk && require cuda_sdk cuda.h cuCtxCreate -lcuda enabled cuvid && { enabled cuda || die "ERROR: CUVID requires CUDA"; } enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint @@ -5742,15 +5777,14 @@ enabled decklink && { { check_header DeckLinkAPI.h || die "ERROR: DeckL enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } enabled gmp && require gmp gmp.h mpz_export -lgmp enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init -enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads && - check_lib "dlfcn.h" dlopen -ldl || die "ERROR: jni not found"; } +enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; } enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 enabled libass && require_pkg_config libass ass/ass.h ass_library_init enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && - { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 || + { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 || die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config caca caca.h caca_create_canvas enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new @@ -5765,11 +5799,18 @@ enabled libfreetype && require_pkg_config freetype2 "ft2build.h FT_FREETYP enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++ enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do - check_lib "${gsm_hdr}" gsm_create -lgsm && break; + check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break; done || die "ERROR: libgsm not found"; } enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc enabled libkvazaar && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get -enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit +# While it may appear that require is being used as a pkg-config +# fallback for libmfx, it is actually being used to detect a different +# installation route altogether. If libmfx is installed via the Intel +# Media SDK or Intel Media Server Studio, these don't come with +# pkg-config support. Instead, users should make sure that the build +# can find the libraries and headers through other means. +enabled libmfx && { use_pkg_config libmfx "mfx/mfxvideo.h" MFXInit || + { require libmfx "mfx/mfxvideo.h" MFXInit -llibmfx && warn "using libmfx without pkg-config"; } } enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libnut && require libnut libnut.h nut_demuxer_init -lnut @@ -5781,15 +5822,23 @@ enabled libopencv && { check_header opencv2/core/core_c.h && require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; } enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion -enabled libopenjpeg && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || - check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 || - { check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || - { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || - { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || +enabled libopenjpeg && { { check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || + check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 || + { check_lib libopenjpeg openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || + { check_lib libopenjpeg openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || + { check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || die "ERROR: libopenjpeg not found"; } enabled libopenmpt && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create +enabled libopus && { + enabled libopus_decoder && { + require_pkg_config opus opus_multistream.h opus_multistream_decoder_create + } + enabled libopus_encoder && { + require_pkg_config opus opus_multistream.h opus_multistream_surround_encoder_create + } +} enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new +enabled librsvg && require_pkg_config librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket enabled librubberband && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init @@ -5803,7 +5852,7 @@ enabled libspeex && require_pkg_config speex speex/speex.h speex_decode enabled libtesseract && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && - { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || + { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit @@ -5813,23 +5862,21 @@ enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_in enabled libvpx && { enabled libvpx_vp8_decoder && { use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx || - check_lib "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || + check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || die "ERROR: libvpx decoder version must be >=0.9.1"; } enabled libvpx_vp8_encoder && { use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx || - check_lib "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx || + check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx || die "ERROR: libvpx encoder version must be >=0.9.7"; } enabled libvpx_vp9_decoder && { use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx || - check_lib "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || - disable libvpx_vp9_decoder; + check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx } enabled libvpx_vp9_encoder && { use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx || - check_lib "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || - disable libvpx_vp9_encoder; + check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx } if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then die "libvpx enabled but no supported decoders found" @@ -5858,29 +5905,29 @@ enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi && { check_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" || enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; } enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; } -enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host || +enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host || { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline && add_ldflags -L/opt/vc/lib/ && - check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } || + check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } || die "ERROR: mmal not found" && check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; } enabled netcdf && require_pkg_config netcdf netcdf.h nc_inq_libvers enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do - check_lib 'AL/al.h' alGetError "${al_extralibs}" && break; done } || + check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } || die "ERROR: openal not found"; } && { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" || die "ERROR: openal must be installed and version must be 1.1 or compatible"; } -enabled opencl && { check_lib OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || - check_lib CL/cl.h clEnqueueNDRangeKernel -lOpenCL || +enabled opencl && { check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || + check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL || die "ERROR: opencl not found"; } && { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" || die "ERROR: opencl must be installed and version must be 1.2 or compatible"; } -enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" || - check_lib windows.h wglGetProcAddress "-lopengl32 -lgdi32" || - check_lib OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" || - check_lib ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" || +enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" || + check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" || + check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" || + check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" || die "ERROR: opengl not found." } enabled omx_rpi && { check_header OMX_Core.h || @@ -5889,9 +5936,9 @@ enabled omx_rpi && { check_header OMX_Core.h || enabled omx && { check_header OMX_Core.h || die "ERROR: OpenMAX IL headers not found"; } enabled openssl && { use_pkg_config openssl openssl/ssl.h OPENSSL_init_ssl || use_pkg_config openssl openssl/ssl.h SSL_library_init || - check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || - check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || - check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || die "ERROR: openssl not found"; } enabled qtkit_indev && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; } @@ -5930,9 +5977,17 @@ if ! disabled sdl2; then fi enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs $sdl2_extralibs +if enabled decklink; then + case $target_os in + mingw32*|mingw64*|win32|win64) + decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32" + decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32" + ;; + esac +fi + disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" && - check_lib "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" && - enable securetransport; } + check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security"; } disabled schannel || { check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 && check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lsecur32; } @@ -5954,7 +6009,8 @@ check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.wid check_header sys/videoio.h check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete -check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs" +check_lib user32 "windows.h winuser.h" GetShellWindow -luser32 +check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32 # check that WM_CAP_DRIVER_CONNECT is defined to the proper value # w32api 3.12 had it defined wrong check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines @@ -5981,16 +6037,16 @@ fi check_header soundcard.h enabled_any alsa_indev alsa_outdev && - check_lib alsa/asoundlib.h snd_pcm_htimestamp -lasound && enable alsa + check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound -enabled jack_indev && check_lib jack/jack.h jack_client_open -ljack && enable jack && +enabled jack_indev && check_lib jack jack/jack.h jack_client_open -ljack && check_func jack_port_get_latency_range -ljack -enabled_any sndio_indev sndio_outdev && check_lib sndio.h sio_open -lsndio && enable sndio +enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open -lsndio if enabled libcdio; then - check_lib "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || - check_lib "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || + check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || + check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || die "ERROR: No usable libcdio/cdparanoia found" fi @@ -6033,32 +6089,27 @@ int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o) EOF enabled dxva2 && - check_lib windows.h CoTaskMemFree -lole32 && - enable dxva2_lib + check_lib dxva2_lib windows.h CoTaskMemFree -lole32 enabled vaapi && - check_lib va/va.h vaInitialize -lva || - disable vaapi + check_lib vaapi va/va.h vaInitialize -lva enabled vaapi && check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" || disable vaapi enabled vaapi && - check_lib "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm && - enable vaapi_drm + check_lib vaapi_drm "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm enabled vaapi && - check_lib "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 && - enable vaapi_x11 + check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 enabled vdpau && check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || disable vdpau enabled vdpau && - check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 && - enable vdpau_x11 + check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 if enabled x86; then case $target_os in @@ -6081,7 +6132,7 @@ int main(void) { return 0; } EOF # Funny iconv installations are not unusual, so check it after all flags have been set -disabled iconv || check_func_headers iconv.h iconv || check_lib iconv.h iconv -liconv || disable iconv +disabled iconv || check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" @@ -6199,6 +6250,16 @@ if [ -z "$optflags" ]; then fi fi +if [ -z "$nvccflags" ]; then + nvccflags=$nvccflags_default +fi + +if enabled x86_64 || enabled ppc64 || enabled aarch64; then + nvccflags="$nvccflags -m64" +else + nvccflags="$nvccflags -m32" +fi + check_optflags(){ check_cflags "$@" enabled lto && check_ldflags "$@" @@ -6438,6 +6499,7 @@ enabled zlib && add_cppflags -DZLIB_CONST # conditional library dependencies, in linking order enabled afftfilt_filter && prepend avfilter_deps "avcodec" +enabled afir_filter && prepend avfilter_deps "avcodec" enabled amovie_filter && prepend avfilter_deps "avformat avcodec" enabled aresample_filter && prepend avfilter_deps "swresample" enabled atempo_filter && prepend avfilter_deps "avcodec" @@ -6446,6 +6508,7 @@ enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresampl enabled elbg_filter && prepend avfilter_deps "avcodec" enabled fftfilt_filter && prepend avfilter_deps "avcodec" enabled find_rect_filter && prepend avfilter_deps "avformat avcodec" +enabled firequalizer_filter && prepend avfilter_deps "avcodec" enabled mcdeint_filter && prepend avfilter_deps "avcodec" enabled movie_filter && prepend avfilter_deps "avformat avcodec" enabled pan_filter && prepend avfilter_deps "swresample" @@ -6459,10 +6522,13 @@ enabled sofalizer_filter && prepend avfilter_deps "avcodec" enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale" enabled showfreqs_filter && prepend avfilter_deps "avcodec" enabled showspectrum_filter && prepend avfilter_deps "avcodec" +enabled signature_filter && prepend avfilter_deps "avcodec avformat" enabled smartblur_filter && prepend avfilter_deps "swscale" enabled spectrumsynth_filter && prepend avfilter_deps "avcodec" +enabled spp_filter && prepend avfilter_deps "avcodec" enabled subtitles_filter && prepend avfilter_deps "avformat avcodec" enabled uspp_filter && prepend avfilter_deps "avcodec" +enabled zoompan_filter && prepend avfilter_deps "swscale" enabled lavfi_indev && prepend avdevice_deps "avfilter" @@ -6599,6 +6665,13 @@ for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf ind echo done +if test -n "$ignore_tests"; then + ignore_tests=$(echo $ignore_tests | tr ',' ' ') + echo "Ignored FATE tests:" + echo $ignore_tests | print_in_columns + echo +fi + echo "License: $license" echo "Creating configuration files ..." @@ -6609,9 +6682,9 @@ test -e Makefile || echo "include $source_path/Makefile" > Makefile enabled stripping || strip="echo skipping strip" -config_files="$TMPH config.mak doc/config.texi" +config_files="$TMPH ffbuild/config.mak doc/config.texi" -cat > config.mak < ffbuild/config.mak <> config.mak - eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak - eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak -} - -map 'get_version $v' $LIBRARY_LIST - -map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST +map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST print_program_extralibs(){ eval "program_extralibs=\$${1}_extralibs" - eval echo "EXTRALIBS-${1}=${program_extralibs}" >> config.mak + eval echo "EXTRALIBS-${1}=${program_extralibs}" >> ffbuild/config.mak } map 'print_program_extralibs $v' $PROGRAM_LIST @@ -6805,11 +6870,11 @@ print_config CONFIG_ "$config_files" $CONFIG_LIST \ $ALL_COMPONENTS \ echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH -echo "endif # FFMPEG_CONFIG_MAK" >> config.mak +echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak # Do not overwrite an unchanged config.h to avoid superfluous rebuilds. cp_if_changed $TMPH config.h -touch .config +touch ffbuild/.config enabled yasm && cp_if_changed $TMPASM config.asm @@ -6847,64 +6912,32 @@ if test -n "$WARNINGS"; then enabled fatal_warnings && exit 1 fi -# build pkg-config files +# Settings for pkg-config files -lib_version(){ - eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \"" -} - -pkgconfig_generate(){ - name=$1 - shortname=${name#lib}${build_suffix} - comment=$2 - version=$3 - libs=$4 - requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps)) - requires=${requires%, } - enabled ${name#lib} || return 0 - mkdir -p $name - cat < $name/$name${build_suffix}.pc +cat > ffbuild/config.sh < doc/examples/pc-uninstalled/${name}-uninstalled.pc -prefix= -exec_prefix= -libdir=\${pcfiledir}/../../../$name -includedir=${includedir} - -Name: $name -Description: $comment -Version: $version -Requires: $requires -Conflicts: -Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs) -Cflags: -I\${includedir} -EOF -} - -pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM" -pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" -pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" -pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" -pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" -pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" -pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM" -pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" -pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR" +for lib in $LIBRARY_LIST; do + lib_deps="$(eval echo \$${lib}_deps)" + echo ${lib}_deps=\"$lib_deps\" >> ffbuild/config.sh +done