--disable-lzma disable lzma [autodetect]
--enable-decklink enable Blackmagick DeckLink I/O support [no]
--enable-mmal enable decoding via MMAL [no]
- --enable-nvenc enable encoding via NVENC [no]
+ --enable-nvenc enable NVIDIA NVENC support [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL code
--enable-opengl enable OpenGL rendering [no]
--enable-pic build position-independent code
--enable-thumb compile for Thumb instruction set
--enable-lto use link-time optimization
+ --env="ENV=override" override the environment variables
Advanced options (experts only):
--malloc-prefix=PREFIX prefix malloc and related names with PREFIX
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 "$@" &&
- set_safe ${pkg}_cflags $pkg_cflags &&
- set_safe ${pkg}_libs $pkg_libs
+ set_safe "${pkg}_cflags" $pkg_cflags &&
+ set_safe "${pkg}_libs" $pkg_libs
}
check_exec(){
use_pkg_config(){
pkg="$1"
check_pkg_config "$@" || return 1
- add_cflags $(get_safe ${pkg}_cflags)
- add_extralibs $(get_safe ${pkg}_libs)
+ add_cflags $(get_safe "${pkg}_cflags")
+ add_extralibs $(get_safe "${pkg}_libs")
}
require_pkg_config(){
echo "long check_func(void) { return (long) FT_Init_FreeType; }"
echo "int main(void) { return 0; }"
} | check_ld "cc" $pkg_cflags $pkg_libs \
- && set_safe ${pkg}_cflags $pkg_cflags \
- && set_safe ${pkg}_libs $pkg_libs \
+ && set_safe "${pkg}_cflags" $pkg_cflags \
+ && set_safe "${pkg}_libs" $pkg_libs \
|| die "ERROR: $pkg not found"
- add_cflags $(get_safe ${pkg}_cflags)
- add_extralibs $(get_safe ${pkg}_libs)
+ add_cflags $(get_safe "${pkg}_cflags")
+ add_extralibs $(get_safe "${pkg}_libs")
}
hostcc_e(){
asm_types_h
cdio_paranoia_h
cdio_paranoia_paranoia_h
- cuda_h
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
dev_ic_bt8xx_h
isatty
jack_port_get_latency_range
kbhit
- LoadLibrary
localtime_r
lzo1x_999_compress
mach_absolute_time
TYPES_LIST="
CONDITION_VARIABLE_Ptr
- DXVA_PicParams_HEVC
- ID3D11VideoDecoder
socklen_t
struct_addrinfo
struct_group_source_req
$TYPES_LIST
atomics_native
dos_paths
- d3d11_cobj
- d3d11va_lib
dxva2api_cobj
dxva2_lib
libc_msvcrt
fmtconvert
frame_thread_encoder
gcrypt
+ gmp
golomb
gplv3
h263dsp
mpegaudiodsp
mpegvideo
mpegvideoenc
- nettle
pixblockdsp
qpeldsp
qsv
cxx
dep_cc
doxygen
+ env
extra_version
gas
host_cc
mpegaudiodsp_select="dct"
mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp"
mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
-nvenc_deps_any="dlopen LoadLibrary"
-nvenc_extralibs='$ldl'
qsvdec_select="qsv"
qsvenc_select="qsv"
h263p_encoder_select="h263_encoder"
h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
h264_decoder_suggest="error_resilience"
-h264_nvenc_encoder_deps="nvenc cuda_h"
h264_qsv_decoder_deps="libmfx"
h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
h264_qsv_encoder_deps="libmfx"
h264_qsv_encoder_select="qsvenc"
hevc_decoder_select="bswapdsp cabac golomb videodsp"
-hevc_nvenc_encoder_deps="nvenc cuda_h"
huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
iac_decoder_select="imc_decoder"
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
-dxva2_deps="dxva2api_h"
+dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
vaapi_deps="va_va_h"
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
libutvideo_encoder_deps="libutvideo"
libzvbi_teletext_decoder_deps="libzvbi"
nvenc_encoder_deps="nvenc"
-nvenc_h265_encoder_deps="nvenc"
+nvenc_h264_encoder_deps="nvenc"
+nvenc_hevc_encoder_deps="nvenc"
# demuxers / muxers
ac3_demuxer_select="ac3_parser"
# protocols
bluray_protocol_deps="libbluray"
ffrtmpcrypt_protocol_deps="!librtmp_protocol"
-ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
+ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
ffrtmpcrypt_protocol_select="tcp_protocol"
ffrtmphttp_protocol_deps="!librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
sctp_protocol_select="network"
srtp_protocol_select="rtp_protocol"
tcp_protocol_select="network"
-tls_securetransport_protocol_deps="securetransport"
tls_gnutls_protocol_deps="gnutls !tls_securetransport_protocol"
+tls_gnutls_protocol_select="tcp_protocol"
tls_openssl_protocol_deps="openssl !tls_securetransport_protocol !tls_gnutls_protocol"
+tls_openssl_protocol_select="tcp_protocol"
+tls_securetransport_protocol_deps="securetransport"
+tls_securetransport_protocol_select="tcp_protocol"
tls_protocol_deps_any="tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol"
-tls_protocol_select="tcp_protocol"
udp_protocol_select="network"
udplite_protocol_select="network"
unix_protocol_deps="sys_un_h"
esac
done
+for e in $env; do
+ eval "export $e"
+done
+
disabled logging && logfile=/dev/null
echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
# -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
# with MSVC which enables it by default.
_cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
- if [ $pfx = hostcc ]; then
- append _cflags -Dsnprintf=_snprintf
- fi
disable stripping
elif $_cc 2>&1 | grep -q Microsoft; then
_type=msvc
_ld_path='-libpath:'
_flags='-nologo'
_cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
- if [ $pfx = hostcc ]; then
- if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
- append _cflags -Dsnprintf=_snprintf
- fi
- fi
disable stripping
elif $_cc --version 2>/dev/null | grep -q ^cparser; then
_type=cparser
elif enabled ppc; then
disable ldbrx
- disable vsx
case $(tolower $cpu) in
601|ppc601|powerpc601)
add_${pfx}cppflags -D__printf__=__gnu_printf__
elif check_${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 [ "$pfx" = host_ ]; then
+ add_host_cppflags -Dsnprintf=_snprintf
+ else
+ add_compat strtod.o strtod=avpriv_strtod
+ add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
+ _snprintf=avpriv_snprintf \
+ vsnprintf=avpriv_vsnprintf
+ fi
+ fi
# The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
# 0x601 by default unless something else is set by the user.
# This can easily lead to us detecting functions only present
bionic)
add_compat strtod.o strtod=avpriv_strtod
;;
- msvcrt)
- if [ -z "$cl_major_ver" ] || [ $cl_major_ver -le 18 ]; then
- add_compat strtod.o strtod=avpriv_strtod
- add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
- _snprintf=avpriv_snprintf \
- vsnprintf=avpriv_vsnprintf
- fi
- ;;
esac
# hacks for compiler/libc/os combinations
EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
-if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
- if ! enabled bigendian && enabled altivec ;then
- enable vsx
- fi
+if ! enabled ppc64 || enabled bigendian; then
+ disable vsx
fi
check_gas() {
check_builtin MemoryBarrier windows.h "MemoryBarrier()"
check_builtin sarestart signal.h "SA_RESTART"
check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
+check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
+check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
check_func ${malloc_prefix}memalign && enable memalign
check_func getopt
check_func getrusage
check_func gettimeofday
-check_func gmtime_r
check_func isatty
-check_func localtime_r
check_func mach_absolute_time
check_func mkstemp
check_func mmap
check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes
check_func_headers windows.h GetSystemTimeAsFileTime
-check_func_headers windows.h LoadLibrary
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h PeekNamedPipe
check_func_headers windows.h SetConsoleTextAttribute
enabled xlib &&
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
-check_header cuda.h
check_header direct.h
check_header dlfcn.h
check_header d3d11.h
check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"
check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
+check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0600
if ! disabled w32threads && ! enabled pthreads; then
check_func_headers "windows.h process.h" _beginthreadex &&
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
enabled libdcadec && require_pkg_config dcadec libdcadec/dca_context.h dcadec_context_create
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
-enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
+enabled libfdk_aac && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
+ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
+ warn "using libfdk without pkg-config"; } }
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
enabled fontconfig && enable libfontconfig
enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
+
enabled libvpx && {
- enabled libvpx_vp8_decoder && { check_lib2 "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 && { check_lib2 "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 && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
- enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
+ enabled libvpx_vp8_decoder && {
+ use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
+ check_lib2 "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_lib2 "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_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
+ disable libvpx_vp9_decoder;
+ }
+ enabled libvpx_vp9_encoder && {
+ use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
+ check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
+ disable libvpx_vp9_encoder;
+ }
+ if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
+ die "libvpx enabled but no supported decoders found"
+ fi
+}
+
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
check_lib interface/mmal/mmal.h mmal_port_connect ; }
check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
die "ERROR: mmal not found"; }
+enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
+ { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
+ die "ERROR: NVENC API version 4 or older is not supported"; } &&
+ { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
die "ERROR: openal not found"; } &&
enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
if enabled gnutls; then
- { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
+ { check_lib2 gmp.h mpz_export -lgmp && enable gmp; } ||
{ check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
fi
enable libdc1394_1; } ||
die "ERROR: No version of libdc1394 found "
fi
-
-if enabled nvenc; then
- check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found.";
- check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
- die "ERROR: NVENC API version 4 or older is not supported";
- { [ $target_os != cygwin ] || die "ERROR: NVENC is not supported on Cygwin currently."; }
-fi
-
if ! disabled sdl; then
SDL_CONFIG="${cross_prefix}sdl-config"
if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
enable securetransport; }
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
-enabled makeinfo && (makeinfo --version | \
- grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
+enabled makeinfo \
+ && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
&& enable makeinfo_html || disable makeinfo_html
disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
perl -v > /dev/null 2>&1 && enable perl || disable perl
int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
EOF
-enabled d3d11_h &&
- check_cc <<EOF && enable d3d11_cobj
-#define _WIN32_WINNT 0x0600
-#define COBJMACROS
-#include <windows.h>
-#include <d3d11.h>
-int main(void) { ID3D11VideoDecoder *o = NULL; ID3D11VideoDecoder_Release(o); return 0; }
-EOF
-
enabled vaapi &&
check_lib va/va.h vaInitialize -lva ||
disable vaapi
disable posix_memalign
fi
-enabled_all d3d11va d3d11_cobj CoTaskMemFree &&
- prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
- enable d3d11va_lib
-
enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
enable dxva2_lib