--disable-filters disable all filters
External library support:
+ --disable-audiotoolbox enable AudioToolbox decoders and encoders [autodetect]
--enable-avisynth enable reading of AviSynth script files [no]
--disable-bzlib disable bzlib [autodetect]
--enable-cuda enable dynamically linked CUDA [no]
--enable-gnutls enable gnutls, needed for https support
if openssl is not used [no]
--disable-iconv disable iconv [autodetect]
+ --enable-jni enable JNI support [no]
--enable-ladspa enable LADSPA audio filtering [no]
--enable-libass enable libass subtitles rendering,
needed for subtitles and ass filter [no]
--enable-libcdio enable audio CD grabbing with libcdio [no]
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
- --enable-libdcadec enable DCA decoding via libdcadec [no]
--enable-libfaac enable AAC encoding via libfaac [no]
--enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
--enable-libflite enable flite (voice synthesis) support via libflite [no]
--enable-libzvbi enable teletext support via libzvbi [no]
--disable-lzma disable lzma [autodetect]
--enable-decklink enable Blackmagic DeckLink I/O support [no]
+ --enable-mediacodec enable Android MediaCodec support [no]
--enable-mmal enable decoding via MMAL [no]
--enable-netcdf enable NetCDF, needed for sofalizer filter [no]
--enable-nvenc enable NVIDIA NVENC support [no]
EOF
}
+check_inline_asm_flags(){
+ log check_inline_asm_flags "$@"
+ name="$1"
+ code="$2"
+ flags=''
+ shift 2
+ while [ "$1" != "" ]; do
+ append flags $1
+ shift
+ done;
+ disable $name
+ cat > $TMPC <<EOF
+void foo(void){ __asm__ volatile($code); }
+EOF
+ log_file $TMPC
+ check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
+ enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
+}
+
check_insn(){
log check_insn "$@"
check_inline_asm ${1}_inline "\"$2\""
"
EXTERNAL_LIBRARY_LIST="
+ audiotoolbox
avisynth
bzlib
chromaprint
gmp
gnutls
iconv
+ jni
ladspa
libass
libbluray
libcdio
libcelt
libdc1394
- libdcadec
libfaac
libfdk_aac
libflite
libzmq
libzvbi
lzma
+ mediacodec
mmal
netcdf
nvenc
ARCH_EXT_LIST_MIPS="
mipsfpu
mips32r2
+ mips32r5
mips64r2
mips32r6
mips64r6
struct_group_source_req
struct_ip_mreq_source
struct_ipv6_mreq
+ struct_msghdr_msg_flags
struct_pollfd
struct_rusage_ru_maxrss
struct_sctp_event_subscribe
mipsdsp_deps="mips"
mipsdspr2_deps="mips"
mips32r2_deps="mips"
+mips32r5_deps="mips"
mips32r6_deps="mips"
mips64r2_deps="mips"
mips64r6_deps="mips"
-msa_deps="mips"
+msa_deps="mipsfpu"
mmi_deps="mips"
altivec_deps="ppc"
zmbv_decoder_select="zlib"
zmbv_encoder_select="zlib"
+# platform codecs
+audiotoolbox_deps="AudioToolbox_AudioToolbox_h"
+audiotoolbox_extralibs="-framework CoreFoundation -framework AudioToolbox -framework CoreMedia"
+
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
h264_d3d11va_hwaccel_select="h264_decoder"
h264_dxva2_hwaccel_deps="dxva2"
h264_dxva2_hwaccel_select="h264_decoder"
+h264_mediacodec_decoder_deps="mediacodec"
+h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
h264_mmal_decoder_deps="mmal"
h264_mmal_decoder_select="mmal"
h264_mmal_hwaccel_deps="mmal"
mjpeg2jpeg_bsf_select="jpegtables"
# external libraries
+aac_at_decoder_deps="audiotoolbox"
+ac3_at_decoder_deps="audiotoolbox"
+adpcm_ima_qt_at_decoder_deps="audiotoolbox"
+alac_at_decoder_deps="audiotoolbox"
+amr_nb_at_decoder_deps="audiotoolbox"
+eac3_at_decoder_deps="audiotoolbox"
+gsm_ms_at_decoder_deps="audiotoolbox"
+ilbc_at_decoder_deps="audiotoolbox"
+mp1_at_decoder_deps="audiotoolbox"
+mp2_at_decoder_deps="audiotoolbox"
+mp3_at_decoder_deps="audiotoolbox"
+pcm_alaw_at_decoder_deps="audiotoolbox"
+pcm_mulaw_at_decoder_deps="audiotoolbox"
+qdmc_at_decoder_deps="audiotoolbox"
+qdm2_at_decoder_deps="audiotoolbox"
+aac_at_encoder_deps="audiotoolbox"
+aac_at_encoder_select="audio_frame_queue"
+alac_at_encoder_deps="audiotoolbox"
+alac_at_encoder_select="audio_frame_queue"
+ilbc_at_encoder_deps="audiotoolbox"
+ilbc_at_encoder_select="audio_frame_queue"
+pcm_alaw_at_encoder_deps="audiotoolbox"
+pcm_alaw_at_encoder_select="audio_frame_queue"
+pcm_mulaw_at_encoder_deps="audiotoolbox"
+pcm_mulaw_at_encoder_select="audio_frame_queue"
chromaprint_muxer_deps="chromaprint"
h264_videotoolbox_encoder_deps="videotoolbox_encoder pthreads"
-h264_videotoolbox_encoder_select="bzlib zlib iconv"
libcelt_decoder_deps="libcelt"
-libdcadec_decoder_deps="libdcadec"
libfaac_encoder_deps="libfaac"
libfaac_encoder_select="audio_frame_queue"
libfdk_aac_decoder_deps="libfdk_aac"
rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
rtp_protocol_select="udp_protocol"
-sctp_protocol_deps="struct_sctp_event_subscribe"
+sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
sctp_protocol_select="network"
srtp_protocol_select="rtp_protocol"
tcp_protocol_select="network"
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
cpuflags="-march=$cpu"
- case $cpu in
- 24kc)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsfpu
- disable mipsdsp
- disable mipsdspr2
- disable msa
- ;;
- 24kf*)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsdsp
- disable mipsdspr2
- disable msa
- ;;
- 24kec|34kc|1004kc)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsfpu
- disable mipsdspr2
- disable msa
- ;;
- 24kef*|34kf*|1004kf*)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsdspr2
- disable msa
- ;;
- 74kc)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsfpu
- disable msa
- ;;
- 74kf)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable msa
- ;;
- p5600)
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsdsp
- disable mipsdspr2
- check_cflags "-mtune=p5600" &&
- check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
- add_asflags "-mfp64"
- ;;
- i6400)
- disable mips32r2
- disable mips32r6
- disable mips64r2
- disable mipsdsp
- disable mipsdspr2
- check_cflags "-mtune=i6400 -mabi=64" &&
- check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
- check_ldflags "-mabi=64" &&
- add_asflags "-mfp64"
- ;;
- loongson*)
- disable mips32r2
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsfpu
- disable mipsdsp
- disable mipsdspr2
- disable msa
- enable local_aligned_8 local_aligned_16 local_aligned_32
- enable simd_align_16
- enable fast_64bit
- enable fast_clz
- enable fast_cmov
- enable fast_unaligned
- disable aligned_stack
- case $cpu in
- loongson3*)
- cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
- ;;
- loongson2e)
- cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
- ;;
- loongson2f)
- cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
- ;;
- esac
- ;;
- generic)
- # We do not disable anything. Is up to the user to disable
- # the unwanted features.
- ;;
- *)
- # Unknown CPU. Disable everything.
- warn "unknown CPU. Disabling all MIPS optimizations."
- disable mipsfpu
- disable mips32r2
- disable mips32r6
- disable mips64r2
- disable mips64r6
- disable mipsdsp
- disable mipsdspr2
- disable msa
- ;;
- esac
+ if [ "$cpu" != "generic" ]; then
+ disable mips32r2
+ disable mips32r5
+ disable mips64r2
+ disable mips32r6
+ disable mips64r6
+ disable loongson2
+ disable loongson3
+
+ case $cpu in
+ 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
+ enable mips32r2
+ disable msa
+ ;;
+ p5600|i6400)
+ disable mipsdsp
+ disable mipsdspr2
+ ;;
+ loongson*)
+ enable loongson2
+ enable loongson3
+ enable local_aligned_8 local_aligned_16 local_aligned_32
+ enable simd_align_16
+ enable fast_64bit
+ enable fast_clz
+ enable fast_cmov
+ enable fast_unaligned
+ disable aligned_stack
+ case $cpu in
+ loongson3*)
+ cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
+ ;;
+ loongson2e)
+ cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
+ ;;
+ loongson2f)
+ cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
+ ;;
+ esac
+ ;;
+ *)
+ # Unknown CPU. Disable everything.
+ warn "unknown CPU. Disabling all MIPS optimizations."
+ disable mipsfpu
+ disable mipsdsp
+ disable mipsdspr2
+ disable msa
+ disable mmi
+ ;;
+ esac
+
+ case $cpu in
+ 24kc)
+ disable mipsfpu
+ disable mipsdsp
+ disable mipsdspr2
+ ;;
+ 24kf*)
+ disable mipsdsp
+ disable mipsdspr2
+ ;;
+ 24kec|34kc|1004kc)
+ disable mipsfpu
+ disable mipsdspr2
+ ;;
+ 24kef*|34kf*|1004kf*)
+ disable mipsdspr2
+ ;;
+ 74kc)
+ disable mipsfpu
+ ;;
+ p5600)
+ enable mips32r5
+ check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
+ ;;
+ i6400)
+ enable mips64r6
+ check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
+ ;;
+ esac
+ else
+ # We do not disable anything. Is up to the user to disable the unwanted features.
+ warn 'generic cpu selected'
+ fi
elif enabled ppc; then
# however ld then forgets what the entry point should be (oops) so we
# have to manually (re)set it.
if enabled x86_32; then
- add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
+ disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
elif enabled x86_64; then
- add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
+ disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
check_ldflags -Wl,--high-entropy-va # binutils 2.25
# Set image base >4GB for extra entropy with HEASLR
add_ldexeflags -Wl,--image-base,0x140000000
# Enable minimum ISA based on selected options
if enabled mips64; then
- if enabled mips64r6; then
- check_ldflags "-mips64r6" &&
- add_cflags "-mips64r6" &&
- add_asflags "-mips64r6" &&
- check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' ||
- disable mips64r6
- fi
- if disabled mips64r6 && enabled mips64r2; then
- check_ldflags "-mips64r2" &&
- add_cflags "-mips64r2" &&
- add_asflags "-mips64r2" &&
- check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' ||
- disable mips64r2
- fi
- if disabled mips64r6 && disabled mips64r2; then
- check_ldflags "-mips64" &&
- add_cflags "-mips64" &&
- add_asflags "-mips64" &&
- check_inline_asm mips64r1 '"daddi $0, $0, 0"' ||
- disable mips64r1
- fi
+ enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
+ enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
+ disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
else
- if enabled mips32r6; then
- check_ldflags "-mips32r6" &&
- add_cflags "-mips32r6" &&
- add_asflags "-mips32r6" &&
- check_inline_asm mips32r6 '"aui $0, $0, 0"' ||
- disable mips32r6
- fi
- if disabled mips32r6 && enabled mips32r2; then
- check_ldflags "-mips32r2" &&
- add_cflags "-mips32r2" &&
- add_asflags "-mips32r2" &&
- check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' ||
- disable mips32r2
- fi
- if disabled mips32r6 && disabled mips32r2; then
- check_ldflags "-mips32" &&
- add_cflags "-mips32" &&
- add_asflags "-mips32" &&
- check_inline_asm mips32r1 '"addi $0, $0, 0"' ||
- disable mips32r1
- fi
- fi
-
- # MIPS FPU
- if enabled mipsfpu; then
- check_ldflags "-mhard-float" &&
- add_cflags "-mhard-float" &&
- add_asflags "-mhard-float" &&
- check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"' ||
- disable mipsfpu
+ enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
+ enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
+ enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
+ disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
fi
- # MSA and DSP support require ISA revision level 2 or greater
- if enabled mips32r2 || enabled mips64r2 || enabled mips32r6 || enabled mips64r6; then
- # MSA must be used with -mfp64 and -mhard-float
- if enabled mipsfpu; then
- if enabled msa; then
- check_ldflags "-mfp64 -mmsa" &&
- add_cflags "-mfp64 -mmsa" &&
- add_asflags "-mfp64 -mmsa" &&
- check_inline_asm msa '"addvi.b $w0, $w1, 1"' &&
- check_header msa.h ||
- disable msa
- fi
- else
- disable msa
- fi
-
- if enabled mipsdsp; then
- check_ldflags "-mdsp" &&
- add_cflags "-mdsp" &&
- add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"' ||
- disable mipsdsp
- fi
- if enabled mipsdspr2; then
- check_ldflags "-mdspr2" &&
- add_cflags "-mdspr2" &&
- add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"' ||
- disable mipsdspr2
- fi
- fi
+ enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
+ enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
+ enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa
+ enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
+ enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
elif enabled parisc; then
frei0r_src_filter_extralibs='$ldl'
ladspa_filter_extralibs='$ldl'
nvenc_encoder_extralibs='$ldl'
+coreimage_filter_extralibs="-framework QuartzCore -framework AppKit -framework OpenGL"
+coreimagesrc_filter_extralibs="-framework QuartzCore -framework AppKit -framework OpenGL"
if ! disabled network; then
check_func getaddrinfo $network_extralibs
check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
check_type poll.h "struct pollfd"
check_type netinet/sctp.h "struct sctp_event_subscribe"
+ check_struct "sys/socket.h" "struct msghdr" msg_flags
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_type netinet/in.h "struct sockaddr_in6"
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
enabled xlib &&
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
+check_header AudioToolbox/AudioToolbox.h
check_header direct.h
check_header dirent.h
check_header dlfcn.h
enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
{ check_lib2 "dlfcn.h" dlopen -ldl; } ||
die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
-enabled cuda && check_lib cuda.h cuInit -lcuda
+enabled cuda && { check_lib cuda.h cuInit -lcuda ||
+ die "ERROR: CUDA not found"; }
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
+enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimage_filter; }
+enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
enabled decklink && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
enabled gmp && require2 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_lib2 "dlfcn.h" dlopen -ldl; }
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
{ check_lib 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 libdcadec && require_pkg_config "dcadec >= 0.1.0" libdcadec/dca_context.h dcadec_context_create
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
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 &&
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 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 ;
enabled netcdf && require_pkg_config netcdf netcdf.h nc_inq_libvers
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"; } &&
+ { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" ||
+ die "ERROR: NVENC API version 5 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 } ||
check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
enable securetransport; }
-disabled schannel || { check_func_headers "windows.h Security.h" InitializeSecurityContext -DSECURITY_WIN32 -lSecur32 &&
- enable schannel && add_extralibs -lSecur32; }
+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; }
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
enabled makeinfo \
echo "safe bitstream reader ${safe_bitstream_reader-no}"
echo "SDL support ${sdl-no}"
echo "opencl enabled ${opencl-no}"
+echo "JNI support ${jni-no}"
echo "texi2html enabled ${texi2html-no}"
echo "perl enabled ${perl-no}"
echo "pod2man enabled ${pod2man-no}"