X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=22eeca22a52dffe4baf2608890bcfd7671f1c3a1;hb=5420c8f76e70f5b390c8df07ab70e8b1e6d7fb75;hp=dad19f0106a77d4ebf3d4f2721b6e1b85878ecba;hpb=3c56d6734186336723150d3bcaf3405538710c53;p=ffmpeg diff --git a/configure b/configure index dad19f0106a..22eeca22a52 100755 --- a/configure +++ b/configure @@ -213,10 +213,11 @@ External library support: --enable-gmp enable gmp, needed for rtmp(t)e support if openssl or librtmp is not used [no] --enable-gnutls enable gnutls, needed for https support - if openssl or libtls is not used [no] + if openssl, libtls or mbedtls is not used [no] --disable-iconv disable iconv [autodetect] --enable-jni enable JNI support [no] --enable-ladspa enable LADSPA audio filtering [no] + --enable-libaom enable AV1 video encoding/decoding via libaom [no] --enable-libass enable libass subtitles rendering, needed for subtitles and ass filter [no] --enable-libbluray enable BluRay reading using libbluray [no] @@ -256,11 +257,12 @@ External library support: --enable-libsnappy enable Snappy compression, needed for hap encoding [no] --enable-libsoxr enable Include libsoxr resampling [no] --enable-libspeex enable Speex de/encoding via libspeex [no] + --enable-libsrt enable Haivision SRT protocol via libsrt [no] --enable-libssh enable SFTP protocol via libssh [no] --enable-libtesseract enable Tesseract, needed for ocr filter [no] --enable-libtheora enable Theora encoding via libtheora [no] --enable-libtls enable LibreSSL (via libtls), needed for https support - if openssl or gnutls is not used [no] + if openssl, gnutls or mbedtls is not used [no] --enable-libtwolame enable MP2 encoding via libtwolame [no] --enable-libv4l2 enable libv4l2/v4l-utils [no] --enable-libvidstab enable video stabilization using vid.stab [no] @@ -280,7 +282,8 @@ External library support: --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect] --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] - --enable-libxml2 enable XML parsing using the C library libxml2 [no] + --enable-libxml2 enable XML parsing using the C library libxml2, needed + for dash demuxing support [no] --enable-libzimg enable z.lib, needed for zscale filter [no] --enable-libzmq enable message passing via libzmq [no] --enable-libzvbi enable teletext support via libzvbi [no] @@ -288,19 +291,22 @@ External library support: --disable-lzma disable lzma [autodetect] --enable-decklink enable Blackmagic DeckLink I/O support [no] --enable-libndi_newtek enable Newteck NDI I/O support [no] + --enable-mbedtls enable mbedTLS, needed for https support + if openssl, gnutls or libtls is not used [no] --enable-mediacodec enable Android MediaCodec support [no] --enable-libmysofa enable libmysofa, needed for sofalizer filter [no] --enable-openal enable OpenAL 1.1 capture support [no] --enable-opencl enable OpenCL processing [no] --enable-opengl enable OpenGL rendering [no] --enable-openssl enable openssl, needed for https support - if gnutls or libtls is not used [no] + if gnutls, libtls or mbedtls is not used [no] --disable-sndio disable sndio support [autodetect] --disable-schannel disable SChannel SSP, needed for TLS support on Windows if openssl and gnutls are not used [autodetect] --disable-sdl2 disable sdl2 [autodetect] --disable-securetransport disable Secure Transport, needed for TLS support on OSX if openssl and gnutls are not used [autodetect] + --enable-vapoursynth enable VapourSynth demuxer [no] --disable-xlib disable xlib [autodetect] --disable-zlib disable zlib [autodetect] @@ -341,6 +347,10 @@ Toolchain options: --target-samples=DIR path to samples directory on target --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks --toolchain=NAME set tool defaults according to NAME + (gcc-asan, clang-asan, gcc-msan, clang-msan, + gcc-tsan, clang-tsan, gcc-usan, clang-usan, + valgrind-massif, valgrind-memcheck, + msvc, icl, gcov, llvm-cov, hardened) --nm=NM use nm tool NM [$nm_default] --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] @@ -910,13 +920,13 @@ add_compat(){ map 'add_cppflags -D$v' "$@" } -check_cmd(){ +test_cmd(){ log "$@" "$@" >> $logfile 2>&1 } -check_stat(){ - log check_stat "$@" +test_stat(){ + log test_stat "$@" stat "$1" >> $logfile 2>&1 } @@ -928,43 +938,74 @@ cc_e(){ eval printf '%s\\n' $CC_E } -check_cc(){ - log check_cc "$@" +test_cc(){ + log test_cc "$@" cat > $TMPC log_file $TMPC - check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC + test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC } -check_cxx(){ - log check_cxx "$@" +test_cxx(){ + log test_cxx "$@" cat > $TMPCPP log_file $TMPCPP - check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP + test_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP } -check_objcc(){ - log check_objcc "$@" +test_objcc(){ + log test_objcc "$@" cat > $TMPM log_file $TMPM - check_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM + test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM } -check_cpp(){ - log check_cpp "$@" +test_cpp(){ + log test_cpp "$@" cat > $TMPC log_file $TMPC - check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC + test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC } as_o(){ eval printf '%s\\n' $AS_O } -check_as(){ - log check_as "$@" +test_as(){ + log test_as "$@" cat > $TMPS log_file $TMPS - check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS + test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS +} + +x86asm_o(){ + eval printf '%s\\n' $X86ASM_O +} + +test_x86asm(){ + log test_x86asm "$@" + echo "$1" > $TMPASM + log_file $TMPASM + shift + test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" $(x86asm_o $TMPO) $TMPASM +} + +check_cmd(){ + log check_cmd "$@" + cmd=$1 + disabled $cmd && return + disable $cmd + test_cmd $@ && enable $cmd +} + +check_as(){ + log check_as "$@" + name=$1 + code=$2 + shift 2 + disable $name + test_as $@ < $TMPS - log_file $TMPS - shift 1 - check_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" -o $TMPO $TMPS + name=$1 + shift + disable $name + test_x86asm "$@" && enable $name } ld_o(){ eval printf '%s\\n' $LD_O } -check_ld(){ - log check_ld "$@" +test_ld(){ + log test_ld "$@" type=$1 shift 1 flags=$(filter_out '-l*|*.so' $@) libs=$(filter '-l*|*.so' $@) - check_$type $($cflags_filter $flags) || return + test_$type $($cflags_filter $flags) || return flags=$($ldflags_filter $flags) libs=$($ldflags_filter $libs) - check_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs + test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs +} + +check_ld(){ + log check_ld "$@" + type=$1 + name=$2 + shift 2 + disable $name + test_ld $type $@ && enable $name } print_include(){ @@ -1034,8 +1084,8 @@ print_include(){ echo "#include <$hdr>" } -check_code(){ - log check_code "$@" +test_code(){ + log test_code "$@" check=$1 headers=$2 code=$3 @@ -1045,12 +1095,12 @@ check_code(){ print_include $hdr done echo "int main(void) { $code; return 0; }" - } | check_$check "$@" + } | test_$check "$@" } check_cppflags(){ log check_cppflags "$@" - check_cpp "$@" < EOF } @@ -1058,7 +1108,7 @@ EOF test_cflags(){ log test_cflags "$@" set -- $($cflags_filter "$@") - check_cc "$@" <" echo "int main(void) { return 0; }" - } | check_objcc && check_stat "$TMPO" && enable_sanitized $header + } | test_objcc && test_stat "$TMPO" && enable_sanitized $header } check_apple_framework(){ @@ -1156,7 +1206,7 @@ check_func(){ func=$1 shift disable $func - check_ld "cc" "$@" < #include float foo(complex float f, complex float g) { return $func($args); } @@ -1184,7 +1234,7 @@ check_mathfunc(){ shift 2 test $narg = 2 && args="f, g" || args="f" disable $func - check_ld "cc" "$@" < float foo(float f, float g) { return $func($args); } int main(void){ return (int) foo; } @@ -1210,7 +1260,7 @@ check_func_headers(){ echo " ret |= ((intptr_t)check_$func) & 0xFFFF;" done echo "return ret; }" - } | check_ld "cc" "$@" && enable $funcs && enable_sanitized $headers + } | test_ld "cc" "$@" && enable $funcs && enable_sanitized $headers } check_class_headers_cpp(){ @@ -1229,15 +1279,15 @@ check_class_headers_cpp(){ i=$(expr $i + 1) done echo "return 0; }" - } | check_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers + } | test_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers } -check_cpp_condition(){ - log check_cpp_condition "$@" +test_cpp_condition(){ + log test_cpp_condition "$@" header=$1 condition=$2 shift 2 - check_cpp "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -1245,6 +1295,14 @@ check_cpp_condition(){ EOF } +check_cpp_condition(){ + log check_cpp_condition "$@" + name=$1 + shift 1 + disable $name + test_cpp_condition "$@" && enable $name +} + test_cflags_cc(){ log test_cflags_cc "$@" flags=$1 @@ -1252,7 +1310,7 @@ test_cflags_cc(){ condition=$3 shift 3 set -- $($cflags_filter "$flags") - check_cc "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -1291,7 +1349,7 @@ test_pkg_config(){ funcs="$4" shift 4 disable $name - check_cmd $pkg_config --exists --print-errors $pkg_version || return + test_cmd $pkg_config --exists --print-errors $pkg_version || return pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg) pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg) check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && @@ -1307,8 +1365,8 @@ check_pkg_config(){ eval add_cflags \$${name}_cflags } -check_exec(){ - check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } +test_exec(){ + test_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } } check_exec_crash(){ @@ -1321,7 +1379,7 @@ check_exec_crash(){ # can redirect the "Terminated" message from the shell. SIGBUS # is not defined by standard C so it is used conditionally. - (check_exec "$@") >> $logfile 2>&1 <> $logfile 2>&1 < static void sighandler(int sig){ raise(SIGTERM); @@ -1348,7 +1406,7 @@ check_type(){ type=$2 shift 2 disable_sanitized "$type" - check_code cc "$headers" "$type v" "$@" && enable_sanitized "$type" + test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type" } check_struct(){ @@ -1358,7 +1416,7 @@ check_struct(){ member=$3 shift 3 disable_sanitized "${struct}_${member}" - check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && + test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && enable_sanitized "${struct}_${member}" } @@ -1369,7 +1427,7 @@ check_builtin(){ builtin=$3 shift 3 disable "$name" - check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name" + test_code ld "$headers" "$builtin" "cc" "$@" && enable "$name" } check_compile_assert(){ @@ -1379,7 +1437,15 @@ check_compile_assert(){ condition=$3 shift 3 disable "$name" - check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name" + test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name" +} + +check_cc(){ + log check_cc "$@" + name=$1 + shift + disable "$name" + test_code cc "$@" && enable "$name" } require(){ @@ -1390,6 +1456,13 @@ require(){ check_lib $name "$@" || die "ERROR: $name_version not found" } +require_cc(){ + log require_cc "$@" + name="$1" + shift + test_code cc "$@" || die "ERROR: $name failed" +} + require_cpp(){ name="$1" headers="$2" @@ -1407,7 +1480,7 @@ require_header(){ require_cpp_condition(){ log require_cpp_condition "$@" condition="$2" - check_cpp_condition "$@" || die "ERROR: $condition not satisfied" + test_cpp_condition "$@" || die "ERROR: $condition not satisfied" } require_pkg_config(){ @@ -1424,23 +1497,23 @@ hostcc_o(){ eval printf '%s\\n' $HOSTCC_O } -check_host_cc(){ - log check_host_cc "$@" +test_host_cc(){ + log test_host_cc "$@" cat > $TMPC log_file $TMPC - check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC + test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC } -check_host_cpp(){ - log check_host_cpp "$@" +test_host_cpp(){ + log test_host_cpp "$@" cat > $TMPC log_file $TMPC - check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC + test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC } check_host_cppflags(){ log check_host_cppflags "$@" - check_host_cpp "$@" < EOF } @@ -1448,17 +1521,17 @@ EOF check_host_cflags(){ log check_host_cflags "$@" set -- $($host_cflags_filter "$@") - check_host_cc "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -1466,6 +1539,14 @@ check_host_cpp_condition(){ EOF } +check_host_cpp_condition(){ + log check_host_cpp_condition "$@" + name=$1 + shift 1 + disable $name + test_host_cpp_condition "$@" && enable $name +} + cp_if_changed(){ cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return mkdir -p "$(dirname $2)" @@ -1577,6 +1658,7 @@ EXTERNAL_LIBRARY_VERSION3_LIST=" libopencore_amrwb libvmaf libvo_amrwbenc + mbedtls rkmpp " @@ -1594,6 +1676,7 @@ EXTERNAL_LIBRARY_LIST=" gnutls jni ladspa + libaom libass libbluray libbs2b @@ -1628,6 +1711,7 @@ EXTERNAL_LIBRARY_LIST=" libsnappy libsoxr libspeex + libsrt libssh libtesseract libtheora @@ -1645,6 +1729,7 @@ EXTERNAL_LIBRARY_LIST=" mediacodec openal opengl + vapoursynth " HWACCEL_AUTODETECT_LIBRARY_LIST=" @@ -1937,6 +2022,7 @@ HEADERS_LIST=" ES2_gl_h gsm_h io_h + linux_perf_event_h machine_ioctl_bt848_h machine_ioctl_meteor_h malloc_h @@ -2062,14 +2148,15 @@ SYSTEM_FUNCS=" " SYSTEM_LIBRARIES=" + bcrypt vaapi_drm vaapi_x11 vdpau_x11 - wincrypt " TOOLCHAIN_FEATURES=" as_arch_directive + as_dn_directive as_fpu_directive as_func as_object_arch @@ -2132,6 +2219,7 @@ HAVE_LIST=" makeinfo_html opencl_d3d11 opencl_drm_arm + opencl_drm_beignet opencl_dxva2 opencl_vaapi_beignet opencl_vaapi_intel_media @@ -2154,6 +2242,7 @@ CONFIG_EXTRA=" cbs_h264 cbs_h265 cbs_mpeg2 + cbs_vp9 dirac_parse dvprofile exif @@ -2290,6 +2379,7 @@ CMDLINE_SET=" malloc_prefix nm optflags + nvcc nvccflags pkg_config pkg_config_flags @@ -2397,6 +2487,7 @@ simd_align_32_if_any="avx" simd_align_64_if_any="avx512" # system capabilities +linux_perf_deps="linux_perf_event_h" symver_if_any="symver_asm_label symver_gnu_asm" valgrind_backtrace_conflict="optimizations" valgrind_backtrace_deps="valgrind_valgrind_h" @@ -2413,6 +2504,7 @@ threads_if_any="$THREADS_LIST" cbs_h264_select="cbs golomb" cbs_h265_select="cbs golomb" cbs_mpeg2_select="cbs" +cbs_vp9_select="cbs" dct_select="rdft" dirac_parse_select="golomb" error_resilience_select="me_cmp" @@ -2437,7 +2529,7 @@ rdft_select="fft" # decoders / encoders aac_decoder_select="adts_header mdct15 mdct sinewin" -aac_fixed_decoder_select="mdct sinewin" +aac_fixed_decoder_select="adts_header mdct sinewin" aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin" aac_latm_decoder_select="aac_decoder aac_latm_parser" ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct" @@ -2792,7 +2884,7 @@ qsvdec_select="qsv" qsvenc_select="qsv" qsvvpp_select="qsv" vaapi_encode_deps="vaapi" -v4l2_m2m_deps_any="linux_videodev2_h" +v4l2_m2m_deps="linux_videodev2_h sem_timedwait" hwupload_cuda_filter_deps="ffnvcodec" scale_npp_filter_deps="ffnvcodec libnpp" @@ -2895,12 +2987,15 @@ vc1_parser_select="vc1dsp" # bitstream_filters aac_adtstoasc_bsf_select="adts_header" +filter_units_bsf_select="cbs" +h264_metadata_bsf_deps="const_nan" h264_metadata_bsf_select="cbs_h264" h264_redundant_pps_bsf_select="cbs_h264" hevc_metadata_bsf_select="cbs_h265" mjpeg2jpeg_bsf_select="jpegtables" mpeg2_metadata_bsf_select="cbs_mpeg2" -trace_headers_bsf_select="cbs_h264 cbs_h265 cbs_mpeg2" +trace_headers_bsf_select="cbs" +vp9_metadata_bsf_select="cbs_vp9" # external libraries aac_at_decoder_deps="audiotoolbox" @@ -2942,6 +3037,8 @@ h264_videotoolbox_encoder_deps="pthreads" h264_videotoolbox_encoder_select="videotoolbox_encoder" hevc_videotoolbox_encoder_deps="pthreads" hevc_videotoolbox_encoder_select="videotoolbox_encoder" +libaom_av1_decoder_deps="libaom" +libaom_av1_encoder_deps="libaom" libcelt_decoder_deps="libcelt" libcodec2_decoder_deps="libcodec2" libcodec2_encoder_deps="libcodec2" @@ -3000,6 +3097,7 @@ libx265_encoder_deps="libx265" libxavs_encoder_deps="libxavs" libxvid_encoder_deps="libxvid" libzvbi_teletext_decoder_deps="libzvbi" +vapoursynth_demuxer_deps="vapoursynth" videotoolbox_suggest="coreservices" videotoolbox_deps="corefoundation coremedia corevideo" videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames" @@ -3134,14 +3232,13 @@ v4l2_outdev_suggest="libv4l2" vfwcap_indev_deps="vfw32 vfwcap_defines" xcbgrab_indev_deps="libxcb" xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes" -xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute" -xv_outdev_extralibs="-lXv -lX11 -lXext" +xv_outdev_deps="xlib" # protocols async_protocol_deps="threads" bluray_protocol_deps="libbluray" ffrtmpcrypt_protocol_conflict="librtmp_protocol" -ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl" +ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls" ffrtmpcrypt_protocol_select="tcp_protocol" ffrtmphttp_protocol_conflict="librtmp_protocol" ffrtmphttp_protocol_select="http_protocol" @@ -3161,9 +3258,11 @@ librtmpt_protocol_deps="librtmp" librtmpte_protocol_deps="librtmp" libsmbclient_protocol_deps="libsmbclient gplv3" libssh_protocol_deps="libssh" -libtls_conflict="openssl gnutls" +libtls_conflict="openssl gnutls mbedtls" mmsh_protocol_select="http_protocol" mmst_protocol_select="network" +libsrt_protocol_deps="libsrt" +libsrt_protocol_select="network" rtmp_protocol_conflict="librtmp_protocol" rtmp_protocol_select="tcp_protocol" rtmp_protocol_suggest="zlib" @@ -3179,13 +3278,13 @@ rtmpte_protocol_suggest="zlib" rtmpts_protocol_select="ffrtmphttp_protocol https_protocol" rtmpts_protocol_suggest="zlib" rtp_protocol_select="udp_protocol" -schannel_conflict="openssl gnutls libtls" +schannel_conflict="openssl gnutls libtls mbedtls" sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags" sctp_protocol_select="network" -securetransport_conflict="openssl gnutls libtls" +securetransport_conflict="openssl gnutls libtls mbedtls" srtp_protocol_select="rtp_protocol srtp" tcp_protocol_select="network" -tls_protocol_deps_any="gnutls openssl schannel securetransport libtls" +tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls" tls_protocol_select="tcp_protocol" udp_protocol_select="network" udplite_protocol_select="network" @@ -3202,11 +3301,13 @@ aresample_filter_deps="swresample" ass_filter_deps="libass" atempo_filter_deps="avcodec" atempo_filter_select="rdft" +avgblur_opencl_filter_deps="opencl" azmq_filter_deps="libzmq" blackframe_filter_deps="gpl" boxblur_filter_deps="gpl" bs2b_filter_deps="libbs2b" colormatrix_filter_deps="gpl" +convolution_opencl_filter_deps="opencl" convolve_filter_deps="avcodec" convolve_filter_select="fft" coreimage_filter_deps="coreimage appkit" @@ -3228,6 +3329,8 @@ elbg_filter_deps="avcodec" eq_filter_deps="gpl" fftfilt_filter_deps="avcodec" fftfilt_filter_select="rdft" +fftdnoiz_filter_deps="avcodec" +fftdnoiz_filter_select="fft" find_rect_filter_deps="avcodec avformat gpl" firequalizer_filter_deps="avcodec" firequalizer_filter_select="rdft" @@ -3292,6 +3395,7 @@ spectrumsynth_filter_deps="avcodec" spectrumsynth_filter_select="fft" spp_filter_deps="gpl avcodec" spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp" +srcnn_filter_deps="avformat" stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" @@ -3354,7 +3458,7 @@ avformat_deps="avcodec avutil" avformat_suggest="libm network zlib" avresample_deps="avutil" avresample_suggest="libm" -avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia wincrypt" +avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia bcrypt" postproc_deps="avutil gpl" postproc_suggest="libm" swresample_deps="avutil" @@ -3367,7 +3471,7 @@ avfilter_extralibs="pthreads_extralibs" avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs" # programs -ffmpeg_deps="avcodec avfilter avformat swresample" +ffmpeg_deps="avcodec avfilter avformat" ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter null_filter trim_filter" @@ -3533,15 +3637,6 @@ for v in "$@"; do FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}" done -find_things(){ - thing=$1 - pattern=$2 - file=$source_path/$3 - sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file" -} - -FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c) - find_things_extern(){ thing=$1 pattern=$2 @@ -3550,6 +3645,13 @@ find_things_extern(){ sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file" } +find_filters_extern(){ + file=$source_path/$1 + #sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(\w\+\);/\2_filter/p" $file + sed -E -n "s/^extern AVFilter ff_([avfsinkrc]{2,5})_([a-zA-Z0-9_]+);/\2_filter/p" $file +} + +FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c) OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev) INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev) MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c) @@ -3817,6 +3919,12 @@ fi enabled_all gnutls openssl && die "GnuTLS and OpenSSL must not be enabled at the same time." +enabled_all gnutls mbedtls && + die "GnuTLS and mbedTLS must not be enabled at the same time." + +enabled_all openssl mbedtls && + die "OpenSSL and mbedTLS must not be enabled at the same time." + # Disable all the library-specific components if the library itself # is disabled, see AVCODEC_LIST and following _LIST variables. @@ -3834,7 +3942,7 @@ set >> $logfile test -n "$valgrind" && toolchain="valgrind-memcheck" -enabled ossfuzz && { +enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" &&{ 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 } @@ -3889,8 +3997,7 @@ case "$toolchain" in cc_default="cl" cxx_default="cl" else - cc_default="c99wrap cl" - cxx_default="c99wrap cl" + die "Unsupported MSVC version (2013 or newer required)" fi ld_default="$source_path/compat/windows/mslink" nm_default="dumpbin -symbols" @@ -3998,7 +4105,7 @@ if [ -n "$tempprefix" ] ; then echo "$tmpname" mkdir "$tmpname" } -elif ! check_cmd mktemp -u XXXXXX; then +elif ! test_cmd mktemp -u XXXXXX; then # simple replacement for missing mktemp # NOT SAFE FOR GENERAL USE mktemp(){ @@ -4250,7 +4357,7 @@ probe_cc(){ _depflags='-MMD' _cflags_speed='-O3' _cflags_size='-Os' - elif $_cc -v 2>&1 | grep -q clang; then + elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then _type=clang _ident=$($_cc --version 2>/dev/null | head -n1) _depflags='-MMD -MF $(@:.o=.d) -MT $@' @@ -4321,7 +4428,7 @@ probe_cc(){ _flags_filter=msvc_flags _ld_lib='lib%.a' _ld_path='-libpath:' - elif $_cc -nologo- 2>&1 | grep -q Microsoft; then + elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then _type=msvc _ident=$($_cc 2>&1 | head -n1 | tr -d '\r') _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)' @@ -4548,7 +4655,7 @@ elif enabled alpha; then elif enabled arm; then check_arm_arch() { - check_cpp_condition stddef.h \ + test_cpp_condition stddef.h \ "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \ $cpuflags } @@ -4838,7 +4945,7 @@ if [ "$cpu" != generic ]; then fi # compiler sanity check -check_exec < 4'} - check_code cc "" "int test[2*($expr) - 1]" && + test_code cc "" "int test[2*($expr) - 1]" && subarch=$arch64 || subarch=$arch32 enable $subarch } @@ -4904,7 +5011,7 @@ case "$arch" in x86) check_64bit x86_32 x86_64 # Treat x32 as x64 for now. Note it also needs pic if shared - test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' && + test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' && subarch=x86_64 && enable x86_64 && disable x86_32 if enabled x86_64; then enabled shared && enable_weak pic @@ -4920,6 +5027,7 @@ case $target_os in add_cppflags '-I\$(SRC_PATH)/compat/aix' enabled shared && add_ldflags -Wl,-brtl arflags='-Xany -r -c' + striptype="" ;; android) disable symver @@ -4958,6 +5066,7 @@ case $target_os in ;; openbsd|bitrig) disable symver + striptype="" SHFLAGS='-shared' SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)' SLIB_INSTALL_LINKS= @@ -5013,14 +5122,14 @@ case $target_os in # Cannot build both shared and static libs when using dllimport. disable static fi - enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres + enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres enabled x86_32 && check_ldflags -Wl,--large-address-aware shlibdir_default="$bindir_default" SLIBPREF="" SLIBSUF=".dll" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' - if check_cmd lib.exe -list; then + if test_cmd lib.exe -list; then SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)' if enabled x86_64; then LIBTARGET=x64 @@ -5092,7 +5201,7 @@ case $target_os in SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' enabled x86_64 && objformat="win64" || objformat="win32" enable dos_paths - enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres + enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 ;; *-dos|freedos|opendos) @@ -5190,44 +5299,44 @@ probe_libc(){ pfx=$1 pfx_no_=${pfx%_} # uclibc defines __GLIBC__, so it needs to be checked before glibc. - if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then + if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then eval ${pfx}libc_type=uclibc add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 - elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then + elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then eval ${pfx}libc_type=glibc add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 # MinGW headers can be installed on Cygwin, so check for newlib first. - elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then eval ${pfx}libc_type=newlib add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600 # MinGW64 is backwards compatible with MinGW32, so check for it first. - elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then + elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then eval ${pfx}libc_type=mingw64 - if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then + if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then add_compat msvcrt/snprintf.o add_cflags "-include $source_path/compat/msvcrt/snprintf.h" fi add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 eval test \$${pfx_no_}cc_type = "gcc" && add_${pfx}cppflags -D__printf__=__gnu_printf__ - check_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && + test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && add_${pfx}cppflags -D_WIN32_WINNT=0x0600 - elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" || - check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then + elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" || + test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then eval ${pfx}libc_type=mingw32 - check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \ + test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || die "ERROR: MinGW32 runtime version must be >= 3.15." add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 - check_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" && + test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" && add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700 - check_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && + test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && add_${pfx}cppflags -D_WIN32_WINNT=0x0600 eval test \$${pfx_no_}cc_type = "gcc" && add_${pfx}cppflags -D__printf__=__gnu_printf__ - elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then + elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then eval ${pfx}libc_type=msvcrt - if check_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then + if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then if [ "$pfx" = host_ ]; then add_host_cppflags -Dsnprintf=_snprintf else @@ -5248,8 +5357,8 @@ probe_libc(){ # family. For these cases, configure is free to use any functions # found in the SDK headers by default. (Alternatively, we could force # _WIN32_WINNT to 0x0602 in that case.) - check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" || - { check_${pfx}cpp < #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) @@ -5261,19 +5370,19 @@ EOF check_func strtoll || add_cflags -Dstrtoll=_strtoi64 check_func strtoull || add_cflags -Dstrtoull=_strtoui64 fi - elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then + elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then eval ${pfx}libc_type=klibc - elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then + elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then eval ${pfx}libc_type=bionic - elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then + elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then eval ${pfx}libc_type=solaris add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 fi - check_${pfx}cc < void *v = localtime_r; EOF -test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 < void *v = localtime_r; EOF @@ -5295,7 +5404,7 @@ esac check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" || add_cppflags '-I\$(SRC_PATH)/compat/float' -check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic +test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic set_default libdir : ${shlibdir_default:="$libdir"} @@ -5322,7 +5431,7 @@ enable_weak_pic() { enabled pic && enable_weak_pic -check_cc < -void foo(void) { struct { double d; } static const bar[] = { { NAN } }; } -EOF +check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }" if ! enabled ppc64 || enabled bigendian; then disable vsx @@ -5357,18 +5460,13 @@ fi check_gas() { log "check_gas using '$as' as AS" # :vararg is used on aarch64, arm and ppc altivec - check_as <= 30"; then - enable vfp_args - elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then + if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then + : + elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then + : + elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then case "${cross_prefix:-$cc}" in - *hardfloat*) enable vfp_args; fpabi=vfp ;; - *) check_ld "cc" <= 8.0.14.1" \ - "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" + check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.2" \ + "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" || \ + { test_pkg_config ffnvcodec_tmp "ffnvcodec < 8.1" "" "" && check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.2" \ + "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""; } fi -check_cpp_condition windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" && enable winrt || disable winrt +check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" if ! disabled w32threads && ! enabled pthreads; then check_func_headers "windows.h process.h" _beginthreadex && check_type "windows.h" CONDITION_VARIABLE && + check_type "windows.h" INIT_ONCE && enable w32threads || disable w32threads if ! enabled w32threads && enabled winrt; then check_func_headers "windows.h" CreateThread && @@ -5846,7 +5938,7 @@ if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; 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 + check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" if enabled pthreads; then check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs @@ -5854,7 +5946,8 @@ if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then fi fi -enabled zlib && check_lib zlib zlib.h zlibVersion -lz +enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || + check_lib zlib zlib.h zlibVersion -lz; } enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma @@ -5881,14 +5974,15 @@ done enabled cuda_sdk && require cuda_sdk cuda.h cuCtxCreate -lcuda enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint enabled decklink && { require_header DeckLinkAPI.h && - { check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } } + { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } } enabled libndi_newtek && require_header Processing.NDI.Lib.h enabled frei0r && require_header frei0r.h enabled gmp && require gmp gmp.h mpz_export -lgmp enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled ladspa && require_header ladspa.h -enabled lv2 && require_pkg_config lv2 lilv-0 "lilv-0/lilv/lilv.h" lilv_world_new +enabled libaom && require_pkg_config libaom "aom >= 0.1.0" aom/aom_codec.h aom_codec_version +enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 enabled libass && require_pkg_config libass libass ass/ass.h ass_library_init enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open @@ -5926,7 +6020,8 @@ enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" M { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs -enabled libmysofa && require libmysofa "mysofa.h" mysofa_load -lmysofa $zlib_extralibs +enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load || + require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; } enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc || check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppc || die "ERROR: libnpp not found"; } @@ -5959,6 +6054,7 @@ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnap enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init +enabled libsrt && require_pkg_config libsrt "srt >= 1.2.0" srt/srt.h srt_socket enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg enabled libtls && require_pkg_config libtls libtls tls.h tls_configure @@ -6004,8 +6100,7 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && warn "using libx264 without pkg-config"; } } && require_cpp_condition x264.h "X264_BUILD >= 118" && - { check_cpp_condition x264.h "X264_MPEG2" && - enable libx262; } + check_cpp_condition libx262 x264.h "X264_MPEG2" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && require_cpp_condition x265.h "X265_BUILD >= 68" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" @@ -6013,9 +6108,13 @@ enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version enabled libzmq && require_pkg_config libzmq libzmq zmq.h zmq_ctx_new enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new && - { check_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" || + { test_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 libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion +enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init || + check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init || + check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto || + die "ERROR: mbedTLS not found"; } enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; } enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host || { ! enabled cross_compile && @@ -6027,13 +6126,13 @@ enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_co enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do 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)" || + { test_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 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)" || + { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || + test_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 opengl GL/glx.h glXGetProcAddress "-lGL" || check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" || @@ -6056,6 +6155,8 @@ enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/r { enabled libdrm || die "ERROR: rkmpp requires --enable-libdrm"; } } +enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init + if enabled gcrypt; then GCRYPT_CONFIG="${cross_prefix}libgcrypt-config" @@ -6076,8 +6177,8 @@ if enabled sdl2; then if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then sdl2_cflags=$("${SDL2_CONFIG}" --cflags) sdl2_extralibs=$("${SDL2_CONFIG}" --libs) - check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && - check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && + test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && + test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags && enable sdl2 fi @@ -6105,7 +6206,7 @@ enabled securetransport && enabled schannel && check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 && - check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && + test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && schannel_extralibs="-lsecur32" || disable schannel @@ -6121,26 +6222,26 @@ rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || d # check V4L2 codecs available in the API check_header linux/fb.h check_header linux/videodev2.h -check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete -check_code cc linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" || disable v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;" && enable vc1_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;" && enable mpeg1_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;" && enable mpeg2_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;" && enable mpeg4_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;" && enable hevc_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_H263;" && enable h263_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_H264;" && enable h264_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;" && enable vp8_v4l2_m2m -check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;" && enable vp9_v4l2_m2m +test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete +check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" +check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;" +check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;" +check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;" +check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;" +check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;" +check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;" +check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;" +check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;" +check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;" check_header sys/videoio.h -check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete +test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete 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 +check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" check_type "dshow.h" IBaseFilter @@ -6153,7 +6254,7 @@ check_header "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" if check_struct sys/soundcard.h audio_buf_info bytes; then enable_sanitized sys/soundcard.h else - check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE < audio_buf_info abc; EOF @@ -6188,7 +6289,7 @@ check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs" # d3d11va requires linking directly to dxgi and d3d11 if not building for # the desktop api partition -check_cpp < #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) @@ -6205,22 +6306,25 @@ enabled 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 + check_cc vaapi "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" -enabled vaapi && +if enabled vaapi; then check_lib vaapi_drm "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm - -enabled vaapi && check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 +fi enabled vaapi && - check_cpp_condition "va/va.h" "VA_CHECK_VERSION(1, 0, 0)" && - enable vaapi_1 + check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)" -if enabled_all opencl vaapi ; then +if enabled_all opencl libdrm ; then check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" && - enable opencl_vaapi_beignet + enable opencl_drm_beignet + check_func_headers "CL/cl_ext.h" clImportMemoryARM && + enable opencl_drm_arm +fi + +if enabled_all opencl vaapi ; then + enabled opencl_drm_beignet && enable opencl_vaapi_beignet if enabled libmfx ; then check_type "CL/cl.h CL/va_ext.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" && enable opencl_vaapi_intel_media @@ -6237,14 +6341,8 @@ if enabled_all opencl d3d11va ; then enable opencl_d3d11 fi -if enabled_all opencl libdrm ; then - check_func_headers "CL/cl_ext.h" clImportMemoryARM && - enable opencl_drm_arm -fi - enabled vdpau && - check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || - disable vdpau + check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" enabled vdpau && check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 @@ -6266,7 +6364,7 @@ fi enabled ffnvcodec && enable cuda enabled nvenc && - check_cc -I$source_path < NV_ENCODE_API_FUNCTION_LIST flist; void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; } @@ -6274,9 +6372,8 @@ int main(void) { return 0; } EOF enabled amf && - check_cpp_condition "AMF/core/Version.h" \ - "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001" || - disable amf + check_cpp_condition amf "AMF/core/Version.h" \ + "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001" # Funny iconv installations are not unusual, so check it after all flags have been set if enabled libc_iconv; then @@ -6332,7 +6429,7 @@ check_disable_warning_headers(){ check_disable_warning_headers -Wno-deprecated-declarations check_disable_warning_headers -Wno-unused-variable -check_cc <= 1400" && + test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" && add_cflags -Qansi-alias # Some inline asm is not compilable in debug if enabled debug; then @@ -6522,7 +6647,7 @@ elif enabled_any msvc icl; then fi fi # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2. - check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2 + check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" # The CRT headers contain __declspec(restrict) in a few places, but if redefining # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict) # (as it ends up if the restrict redefine is done before including stdlib.h), while @@ -6530,16 +6655,16 @@ elif enabled_any msvc icl; then # If this declspec fails, force including stdlib.h before the restrict redefinition # happens in config.h. if [ $restrict_keyword != restrict ]; then - check_cc <= 190024218" || + test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" || check_cflags -d2SSAOptimizer- # enable utf-8 source processing on VS2015 U2 and newer - check_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" && + test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" && add_cflags -utf-8 fi @@ -6547,7 +6672,7 @@ for pfx in "" host_; do varname=${pfx%_}cc_type eval "type=\$$varname" if [ "$type" = "msvc" ]; then - check_${pfx}cc <> $TMPH cp_if_changed $TMPH libavutil/avconfig.h +full_filter_name(){ + sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_$1;/\1_$1/p" $source_path/libavfilter/allfilters.c +} + # generate the lists of enabled components print_enabled_components(){ file=$1 @@ -7075,6 +7205,9 @@ print_enabled_components(){ for c in $*; do if enabled $c; then case $name in + filter_list) + c=$(full_filter_name $(remove_suffix _filter $c)) + ;; indev_list) c=$(add_suffix _demuxer $(remove_suffix _indev $c)) ;; @@ -7085,17 +7218,23 @@ print_enabled_components(){ printf " &ff_%s,\n" $c >> $TMPH fi done + if [ "$name" = "filter_list" ]; then + for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do + printf " &ff_%s,\n" $c >> $TMPH + done + fi echo " NULL };" >> $TMPH cp_if_changed $TMPH $file } +print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST -print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST -print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST +print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST +print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST # Settings for pkg-config files