--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]
--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]
--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]
--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]
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
check_as ${1}_external "$2"
}
-test_x86asm(){
- log test_x86asm "$@"
- echo "$1" > $TMPS
- log_file $TMPS
- shift 1
- test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" -o $TMPO $TMPS
+check_x86asm(){
+ log check_x86asm "$@"
+ name=$1
+ shift
+ disable $name
+ test_x86asm "$@" && enable $name
}
ld_o(){
gnutls
jni
ladspa
+ libaom
libass
libbluray
libbs2b
libsnappy
libsoxr
libspeex
+ libsrt
libssh
libtesseract
libtheora
mediacodec
openal
opengl
+ vapoursynth
"
HWACCEL_AUTODETECT_LIBRARY_LIST="
ES2_gl_h
gsm_h
io_h
+ linux_perf_event_h
machine_ioctl_bt848_h
machine_ioctl_meteor_h
malloc_h
"
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
cbs_h264
cbs_h265
cbs_mpeg2
+ cbs_vp9
dirac_parse
dvprofile
exif
malloc_prefix
nm
optflags
+ nvcc
nvccflags
pkg_config
pkg_config_flags
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"
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"
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"
mjpeg2jpeg_bsf_select="jpegtables"
mpeg2_metadata_bsf_select="cbs_mpeg2"
trace_headers_bsf_select="cbs"
+vp9_metadata_bsf_select="cbs_vp9"
# external libraries
aac_at_decoder_deps="audiotoolbox"
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"
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"
libtls_conflict="openssl gnutls"
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"
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"
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"
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
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)
_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 $@'
_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)'
add_cppflags '-I\$(SRC_PATH)/compat/aix'
enabled shared && add_ldflags -Wl,-brtl
arflags='-Xany -r -c'
+ striptype=""
;;
android)
disable symver
;;
openbsd|bitrig)
disable symver
+ striptype=""
SHFLAGS='-shared'
SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
SLIB_INSTALL_LINKS=
check_gas() {
log "check_gas using '$as' as AS"
# :vararg is used on aarch64, arm and ppc altivec
- test_as <<EOF || return 1
+ check_as vararg "
.macro m n, y:vararg=0
\n: .int \y
.endm
-m x
-EOF
+m x" || return 1
# .altmacro is only used in arm asm
! enabled arm || check_as gnu_as ".altmacro"
}
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
check_as as_arch_directive ".arch armv7-a"
+ check_as as_dn_directive "ra .dn d0.i16"
check_as as_fpu_directive ".fpu neon"
# llvm's integrated assembler supports .object_arch from llvm 3.5
X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
X86ASM_DEPFLAGS=
fi
- test_x86asm "movbe ecx, [5]" && enable x86asm
+ check_x86asm x86asm "movbe ecx, [5]"
}
if ! disabled_any asm mmx x86asm; then
elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
esac
- test_x86asm "vmovdqa32 [eax]{k1}{z}, zmm0" || disable avx512_external
- test_x86asm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
- test_x86asm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
- test_x86asm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
- test_x86asm "CPU amdnop" || disable cpunop
+ check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
+ check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
+ check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
+ check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
+ check_x86asm cpunop "CPU amdnop"
fi
case "$cpu" in
check_header dxva.h
check_header dxva2api.h -D_WIN32_WINNT=0x0600
check_header io.h
+check_header linux/perf_event.h
check_header libcrystalhd/libcrystalhd_if.h
check_header malloc.h
check_header net/udplite.h
# 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 stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)"
+check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"
check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
+check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
+ check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
check_lib ole32 "windows.h" CoTaskMemFree -lole32
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 android android/native_window.h ANativeWindow_acquire -landroid
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 &&
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 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-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 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
{ 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"
check_cflags -Wformat
check_cflags -fdiagnostics-color=auto
enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
+ if enabled x86_32; then
+ case $target_os in
+ *bsd*)
+ # BSDs don't guarantee a 16 byte aligned stack, but we can
+ # request GCC to try to maintain 16 byte alignment throughout
+ # function calls. Library entry points that might call assembly
+ # functions align the stack. (The parameter means 2^4 bytes.)
+ check_cflags -mpreferred-stack-boundary=4
+ ;;
+ esac
+ fi
elif enabled llvm_gcc; then
check_cflags -mllvm -stack-alignment=16
elif enabled clang; then
- check_cflags -mllvm -stack-alignment=16
- check_cflags -mstack-alignment=16
+ if enabled x86_32; then
+ # Clang doesn't support maintaining alignment without assuming the
+ # same alignment in every function. If 16 byte alignment would be
+ # enabled, one would also have to either add attribute_align_arg on
+ # every single entry point into the libraries or enable -mstackrealign
+ # (doing stack realignment in every single function).
+ case $target_os in
+ mingw32|win32|*bsd*)
+ disable aligned_stack
+ ;;
+ *)
+ check_cflags -mllvm -stack-alignment=16
+ check_cflags -mstack-alignment=16
+ ;;
+ esac
+ else
+ check_cflags -mllvm -stack-alignment=16
+ check_cflags -mstack-alignment=16
+ fi
check_cflags -Qunused-arguments
check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes
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
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))
;;
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