done
}
+request(){
+ for var in $*; do
+ eval ${var}_requested=yes
+ eval $var=
+ done
+}
+
enable(){
set_all yes $*
}
done
}
+requested(){
+ test "${1#!}" = "$1" && op='=' || op=!=
+ eval test "x\$${1#!}_requested" $op "xyes"
+}
+
enabled(){
test "${1#!}" = "$1" && op='=' || op=!=
eval test "x\$${1#!}" $op "xyes"
[ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
[ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
- enabled_all $dep_all || disable $cfg
- enabled_any $dep_any || disable $cfg
- disabled_any $dep_sel && disable $cfg
+ enabled_all $dep_all || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not all dependencies are satisfied: $dep_all"; }
+ enabled_any $dep_any || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not any dependency is satisfied: $dep_any"; }
+ disabled_any $dep_sel && { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some selected dependency is unsatisfied: $dep_sel"; }
if enabled $cfg; then
enable_deep $dep_sel
EOF
}
-test_cflags_cpp(){
- log test_cflags_cpp "$@"
+test_cflags_cc(){
+ log test_cflags_cc "$@"
flags=$1
- condition=$2
- shift 2
+ header=$2
+ condition=$3
+ shift 3
set -- $($cflags_filter "$flags")
- check_cpp "$@" <<EOF
+ check_cc "$@" <<EOF
+#include <$header>
#if !($condition)
#error "unsatisfied condition: $condition"
#endif
transcode_aac_example
transcoding_example
"
+EXTERNAL_AUTODETECT_LIBRARY_LIST="
+ bzlib
+ iconv
+ libxcb
+ libxcb_shm
+ libxcb_shape
+ libxcb_xfixes
+ lzma
+ schannel
+ sdl
+ sdl2
+ securetransport
+ xlib
+ zlib
+"
EXTERNAL_LIBRARY_LIST="
+ $EXTERNAL_AUTODETECT_LIBRARY_LIST
avisynth
- bzlib
chromaprint
crystalhd
decklink
gcrypt
gmp
gnutls
- iconv
jni
ladspa
libass
libx264
libx265
libxavs
- libxcb
- libxcb_shm
- libxcb_shape
- libxcb_xfixes
libxvid
libzimg
libzmq
libzvbi
- lzma
mediacodec
netcdf
openal
opencl
opengl
openssl
- schannel
- sdl
- sdl2
- securetransport
videotoolbox
x11grab
- xlib
- zlib
"
-
-HWACCEL_LIBRARY_LIST="
+HWACCEL_AUTODETECT_LIBRARY_LIST="
audiotoolbox
cuda
cuvid
d3d11va
dxva2
- libmfx
- libnpp
- mmal
nvenc
- omx
vaapi
vda
vdpau
xvmc
"
+HWACCEL_LIBRARY_LIST="
+ $HWACCEL_AUTODETECT_LIBRARY_LIST
+ libmfx
+ libnpp
+ mmal
+ omx
+"
+
DOCUMENT_LIST="
doc
htmlpages
atomics_win32
"
+AUTODETECT_LIBS="
+ $EXTERNAL_AUTODETECT_LIBRARY_LIST
+ $HWACCEL_AUTODETECT_LIBRARY_LIST
+ $THREADS_LIST
+"
+
ARCH_LIST="
aarch64
alpha
lagarith_decoder_select="huffyuvdsp"
ljpeg_encoder_select="aandcttables idctdsp jpegtables"
loco_decoder_select="golomb"
-magicyuv_decoder_select="huffyuvdsp"
+magicyuv_decoder_select="huffyuvdsp llviddsp"
mdec_decoder_select="blockdsp idctdsp mpegvideo"
metasound_decoder_select="lsp mdct sinewin"
mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
tscc_decoder_select="zlib"
twinvq_decoder_select="mdct lsp sinewin"
txd_decoder_select="texturedsp"
-utvideo_decoder_select="bswapdsp"
+utvideo_decoder_select="bswapdsp huffyuvdsp"
utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
vble_decoder_select="huffyuvdsp"
vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideo vc1dsp"
vp9_dxva2_hwaccel_select="vp9_decoder"
vp9_mediacodec_decoder_deps="mediacodec"
vp9_mediacodec_hwaccel_deps="mediacodec"
-vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9"
+vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
vp9_vaapi_hwaccel_select="vp9_decoder"
wmv3_crystalhd_decoder_select="crystalhd"
wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
opus_muxer_select="ogg_muxer"
psp_muxer_select="mov_muxer"
rtp_demuxer_select="sdp_demuxer"
+rtp_muxer_select="golomb"
rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
rtsp_demuxer_select="http_protocol rtpdec"
rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
sws_max_filter_size_default=256
set_default sws_max_filter_size
-# Enable platform codecs by default.
-enable audiotoolbox
-
-# Enable hwaccels by default.
-enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
-enable xlib
-
-enable cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
-
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
LIBPREF="lib"
eval "export $e"
done
+# Mark specifically enabled, but normally autodetected libraries as requested.
+for lib in $AUTODETECT_LIBS; do
+ enabled $lib && request $lib
+done
+
+# Enable platform codecs by default.
+enable_weak audiotoolbox
+
+# Enable hwaccels by default.
+enable_weak d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
+enable_weak xlib
+
+enable_weak cuda cuvid nvenc vda_framework videotoolbox videotoolbox_encoder
+
disabled logging && logfile=/dev/null
# Disable all the library-specific components if the library itself
;;
*-tsan)
cc_default="${toolchain%-tsan}"
- add_cflags -fsanitize=thread -pie
+ add_cflags -fsanitize=thread -fPIE
add_ldflags -fsanitize=thread -pie
case "$toolchain" in
gcc-tsan)
# some compilers silently accept -std=c11, so we also need to check that the
# version macro is defined properly
-if test_cflags_cpp -std=c11 "__STDC_VERSION__ >= 201112L"; then
+if test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L"; then
add_cflags -std=c11
else
check_cflags -std=c99
# it seems there are versions of clang in some distros that try to use the
# gcc headers, which explodes for stdatomic
# so we also check that atomics actually work here
-check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
+check_builtin stdatomic_h stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)"
check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
check_type "va/va.h" "VAPictureParameterBufferHEVC"
-check_type "va/va.h" "VADecPictureParameterBufferVP9"
+check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
check_type "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer"
check_type "va/va.h va/va_enc_h264.h" "VAEncPictureParameterBufferH264"
check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
sdl2_libs="$sdl2_libs -mconsole"
fi
fi
-enabled sdl2 && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs
+enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs
disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
EOF
fi
check_func strtoll || add_cflags -Dstrtoll=_strtoi64
+ check_func strtoull || add_cflags -Dstrtoull=_strtoui64
# the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
# this flag should be re-checked on newer compiler releases and put under a
# version check once its fixed
fi
fi
+# Check if requested libraries were found.
+for lib in $AUTODETECT_LIBS; do
+ requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
+done
+
enabled zlib && add_cppflags -DZLIB_CONST
# conditional library dependencies, in linking order
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
#define FFMPEG_LICENSE "$(c_escape $license)"
-#define CONFIG_THIS_YEAR 2016
+#define CONFIG_THIS_YEAR 2017
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"