--enable-filter=NAME enable filter NAME
--disable-filter=NAME disable filter NAME
--disable-filters disable all filters
+ --disable-v4l2_m2m disable V4L2 mem2mem code [autodetect]
External library support:
themselves, not all their features will necessarily be usable by FFmpeg.
--disable-alsa disable ALSA support [autodetect]
+ --disable-appkit disable Apple AppKit framework [autodetect]
+ --disable-avfoundation disable Apple AVFoundation framework [autodetect]
--enable-avisynth enable reading of AviSynth script files [no]
--disable-bzlib disable bzlib [autodetect]
+ --disable-coreimage disable Apple CoreImage framework [autodetect]
--enable-chromaprint enable audio fingerprinting with chromaprint [no]
--enable-frei0r enable frei0r video filtering [no]
--enable-gcrypt enable gcrypt, needed for rtmp(t)e 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-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]
--disable-cuvid disable Nvidia CUVID support [autodetect]
--disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
--disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
+ --enable-libdrm enable DRM code (Linux) [no]
--enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
--enable-libnpp enable Nvidia Performance Primitives-based code [no]
--enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
--disable-nvenc disable Nvidia video encoding code [autodetect]
--enable-omx enable OpenMAX IL code [no]
--enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
+ --enable-rkmpp enable Rockchip Media Process Platform code [no]
--disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
--disable-vda disable Apple Video Decode Acceleration code [autodetect]
--disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
--libfuzzer=PATH path to libfuzzer
--ignore-tests=TESTS comma-separated list (without "fate-" prefix
in the name) of tests whose result is ignored
+ --enable-linux-perf enable Linux Performance Monitor API
NOTE: Object files are built at the place where configure is launched.
EOF
do_check_deps(){
for cfg; do
- cfg="${cfg#!}"
enabled ${cfg}_checking && die "Circular dependency for $cfg."
disabled ${cfg}_checking && continue
enable ${cfg}_checking
eval dep_all="\$${cfg}_deps"
eval dep_any="\$${cfg}_deps_any"
+ eval dep_con="\$${cfg}_conflict"
eval dep_sel="\$${cfg}_select"
eval dep_sgs="\$${cfg}_suggest"
eval dep_ifa="\$${cfg}_if"
eval dep_ifn="\$${cfg}_if_any"
- pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
- do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
- popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
+ pushvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn
+ do_check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
+ popvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn
[ -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 && 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_all $dep_con || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some conflicting dependencies are unsatisfied: $dep_con"; }
disabled_any $dep_sel && { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some selected dependency is unsatisfied: $dep_sel"; }
if enabled $cfg; then
check_cppflags(){
log check_cppflags "$@"
check_cpp "$@" <<EOF && append CPPFLAGS "$@"
-int x;
+#include <stdlib.h>
EOF
}
{
echo "#include <$header>"
echo "int main(void) { return 0; }"
- } | check_objcc && check_stat "$TMPO" && enable_safe $headers
+ } | check_objcc && check_stat "$TMPO" && enable_safe $header
+}
+
+check_apple_framework(){
+ log check_apple_framework "$@"
+ framework="$1"
+ name="$(tolower $framework)"
+ header="${framework}/${framework}.h"
+ disable $name
+ check_header_objcc $header && enable $name && add_extralibs "-framework $framework"
}
check_func(){
check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
}
+require_header(){
+ log require "$@"
+ header="$1"
+ shift
+ check_header "$header" "$@" || die "ERROR: $header header not found"
+}
+
+require_cpp_condition(){
+ log require "$@"
+ header="$1"
+ condition="$2"
+ shift 2
+ check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition not satisfied"
+}
+
use_pkg_config(){
log use_pkg_config "$@"
- pkg="$1"
+ name="$1"
+ shift
+ pkg_version="$1"
+ pkg="${1%% *}"
check_pkg_config "$@" || return 1
add_cflags $(get_safe "${pkg}_cflags")
add_extralibs $(get_safe "${pkg}_extralibs")
}
require_pkg_config(){
- use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
+ use_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
}
hostcc_e(){
check_host_cppflags(){
log check_host_cppflags "$@"
check_host_cpp "$@" <<EOF && append host_cppflags "$@"
-int x;
+#include <stdlib.h>
EOF
}
indevs
outdevs
"
+
AVFILTER_COMPONENTS="
filters
"
+
AVFORMAT_COMPONENTS="
demuxers
muxers
"
AVRESAMPLE_COMPONENTS=""
+
AVUTIL_COMPONENTS=""
COMPONENT_LIST="
transcode_aac_example
transcoding_example
"
+
EXTERNAL_AUTODETECT_LIBRARY_LIST="
alsa
+ appkit
+ avfoundation
bzlib
+ coreimage
iconv
jack
libxcb
libopencore_amrnb
libopencore_amrwb
libvo_amrwbenc
+ rkmpp
"
EXTERNAL_LIBRARY_GPLV3_LIST="
libcaca
libcelt
libdc1394
+ libdrm
libflite
libfontconfig
libfreetype
libvpx
libwavpack
libwebp
+ libxml2
libzimg
libzmq
libzvbi
openal
opencl
opengl
- videotoolbox
"
+
HWACCEL_AUTODETECT_LIBRARY_LIST="
audiotoolbox
crystalhd
vaapi
vda
vdpau
- videotoolbox_hwaccel
+ videotoolbox
+ v4l2_m2m
xvmc
"
$SUBSYSTEM_LIST
autodetect
fontconfig
+ linux_perf
memory_poisoning
neon_clobber_test
ossfuzz
vp3dsp
vp56dsp
vp8dsp
- vt_bt2020
wma_freqs
wmv2dsp
"
# system capabilities
symver_if_any="symver_asm_label symver_gnu_asm"
-valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
+valgrind_backtrace_conflict="optimizations"
+valgrind_backtrace_deps="valgrind_valgrind_h"
# threading support
atomics_gcc_if="sync_val_compare_and_swap"
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"
cuda_deps_any="dlopen LoadLibrary"
qsvdec_select="qsv"
qsvenc_select="qsv"
vaapi_encode_deps="vaapi"
+v4l2_m2m_deps_any="linux_videodev2_h"
hwupload_cuda_filter_deps="cuda"
scale_npp_filter_deps="cuda libnpp"
scale_cuda_filter_deps="cuda_sdk"
+thumbnail_cuda_filter_deps="cuda_sdk"
nvenc_deps="cuda"
nvenc_deps_any="dlopen LoadLibrary"
nvenc_encoder_deps="nvenc"
+h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
+h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
h264_cuvid_decoder_deps="cuda cuvid"
h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
h264_qsv_encoder_deps="libmfx"
h264_qsv_encoder_select="qsvenc"
+h264_rkmpp_decoder_deps="rkmpp"
+h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
h264_vaapi_encoder_select="vaapi_encode golomb"
h264_vda_decoder_deps="vda"
h264_vda_decoder_select="h264_decoder"
h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
+h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
+h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
hevc_cuvid_decoder_deps="cuda cuvid"
hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
hevc_mediacodec_decoder_deps="mediacodec"
hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel"
hevc_qsv_encoder_deps="libmfx"
hevc_qsv_encoder_select="hevcparse qsvenc"
+hevc_rkmpp_decoder_deps="rkmpp"
+hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
hevc_vaapi_encoder_select="vaapi_encode golomb"
+hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
+hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
mjpeg_cuvid_decoder_deps="cuda cuvid"
mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
mpeg1_cuvid_decoder_deps="cuda cuvid"
mpeg1_vdpau_decoder_deps="vdpau"
mpeg1_vdpau_decoder_select="mpeg1video_decoder"
+mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_cuvid_decoder_deps="cuda cuvid"
mpeg2_mmal_decoder_deps="mmal"
mpeg2_qsv_encoder_select="qsvenc"
mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2"
mpeg2_vaapi_encoder_select="vaapi_encode"
+mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_cuvid_decoder_deps="cuda cuvid"
mpeg4_mediacodec_decoder_deps="mediacodec"
mpeg4_omx_encoder_deps="omx"
mpeg4_vdpau_decoder_deps="vdpau"
mpeg4_vdpau_decoder_select="mpeg4_decoder"
+mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
+mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
mpeg_vdpau_decoder_deps="vdpau"
mpeg_vdpau_decoder_select="mpeg2video_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
vc1_mmal_decoder_deps="mmal"
vc1_vdpau_decoder_deps="vdpau"
vc1_vdpau_decoder_select="vc1_decoder"
+vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
vp8_cuvid_decoder_deps="cuda cuvid"
vp8_mediacodec_decoder_deps="mediacodec"
vp8_qsv_decoder_deps="libmfx"
vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
+vp8_rkmpp_decoder_deps="rkmpp"
vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
vp8_vaapi_encoder_select="vaapi_encode"
+vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
+vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
vp9_cuvid_decoder_deps="cuda cuvid"
vp9_mediacodec_decoder_deps="mediacodec"
+vp9_rkmpp_decoder_deps="rkmpp"
vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
vp9_vaapi_encoder_select="vaapi_encode"
+vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
wmv3_crystalhd_decoder_select="crystalhd"
wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
libxavs_encoder_deps="libxavs"
libxvid_encoder_deps="libxvid"
libzvbi_teletext_decoder_deps="libzvbi"
-videotoolbox_deps="VideoToolbox_VideoToolbox_h"
videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework CoreVideo"
videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
-videotoolbox_encoder_suggest="vda_framework vt_bt2020"
-vt_bt2020_deps="kCVImageBufferColorPrimaries_ITU_R_2020"
+videotoolbox_encoder_suggest="vda_framework"
# demuxers / muxers
ac3_demuxer_select="ac3_parser"
caf_demuxer_select="iso_media riffdec"
caf_muxer_select="iso_media"
dash_muxer_select="mp4_muxer"
+dash_demuxer_deps="libxml2"
dirac_demuxer_select="dirac_parser"
dts_demuxer_select="dca_parser"
dtshd_demuxer_select="dca_parser"
# indevs / outdevs
alsa_indev_deps="alsa"
alsa_outdev_deps="alsa"
-avfoundation_indev_deps="pthreads"
-avfoundation_indev_extralibs="-framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia"
+avfoundation_indev_deps="avfoundation pthreads"
+avfoundation_indev_extralibs="-framework Foundation -framework CoreVideo -framework CoreMedia"
bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
caca_outdev_deps="libcaca"
decklink_indev_deps="decklink threads"
libndi_newtek_outdev_extralibs="-lndi"
dshow_indev_deps="IBaseFilter"
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
-dv1394_indev_deps="dv1394"
-dv1394_indev_select="dv_demuxer"
fbdev_indev_deps="linux_fb_h"
fbdev_outdev_deps="linux_fb_h"
gdigrab_indev_deps="CreateDIBSection"
iec61883_indev_deps="libiec61883"
jack_indev_deps="jack"
jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
+kmsgrab_indev_deps="libdrm"
lavfi_indev_deps="avfilter"
libcdio_indev_deps="libcdio"
libdc1394_indev_deps="libdc1394"
# protocols
async_protocol_deps="threads"
bluray_protocol_deps="libbluray"
-ffrtmpcrypt_protocol_deps="!librtmp_protocol"
+ffrtmpcrypt_protocol_conflict="librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
ffrtmpcrypt_protocol_select="tcp_protocol"
-ffrtmphttp_protocol_deps="!librtmp_protocol"
+ffrtmphttp_protocol_conflict="librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
ftp_protocol_select="tcp_protocol"
gopher_protocol_select="network"
libssh_protocol_deps="libssh"
mmsh_protocol_select="http_protocol"
mmst_protocol_select="network"
-rtmp_protocol_deps="!librtmp_protocol"
+rtmp_protocol_conflict="librtmp_protocol"
rtmp_protocol_select="tcp_protocol"
rtmpe_protocol_select="ffrtmpcrypt_protocol"
-rtmps_protocol_deps="!librtmp_protocol"
+rtmps_protocol_conflict="librtmp_protocol"
rtmps_protocol_select="tls_protocol"
rtmpt_protocol_select="ffrtmphttp_protocol"
rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
sctp_protocol_select="network"
srtp_protocol_select="rtp_protocol srtp"
tcp_protocol_select="network"
-tls_gnutls_protocol_deps="gnutls !tls_schannel_protocol !tls_securetransport_protocol"
+tls_gnutls_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol"
+tls_gnutls_protocol_deps="gnutls"
tls_gnutls_protocol_select="tcp_protocol"
-tls_openssl_protocol_deps="openssl !tls_schannel_protocol !tls_securetransport_protocol !tls_gnutls_protocol"
+tls_openssl_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol"
+tls_openssl_protocol_deps="openssl"
tls_openssl_protocol_select="tcp_protocol"
tls_schannel_protocol_deps="schannel"
tls_schannel_protocol_select="tcp_protocol"
boxblur_filter_deps="gpl"
bs2b_filter_deps="libbs2b"
colormatrix_filter_deps="gpl"
+coreimage_filter_deps="coreimage appkit"
+coreimage_filter_extralibs="-framework OpenGL"
+coreimagesrc_filter_deps="coreimage appkit"
+coreimagesrc_filter_extralibs="-framework OpenGL"
cover_rect_filter_deps="avcodec avformat gpl"
cropdetect_filter_deps="gpl"
deinterlace_qsv_filter_deps="libmfx"
tinterlace_filter_deps="gpl"
tinterlace_merge_test_deps="tinterlace_filter"
tinterlace_pad_test_deps="tinterlace_filter"
+tonemap_filter_deps="const_nan"
uspp_filter_deps="gpl avcodec"
vaguedenoiser_filter_deps="gpl"
vidstabdetect_filter_deps="libvidstab"
libvmaf_filter_deps="libvmaf"
zmq_filter_deps="libzmq"
zoompan_filter_deps="swscale"
-zscale_filter_deps="libzimg"
+zscale_filter_deps="libzimg const_nan"
scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
# examples
avdevice_deps="avformat avcodec avutil"
avfilter_deps="avutil"
avformat_deps="avcodec avutil"
+avformat_suggest="network"
avresample_deps="avutil"
postproc_deps="avutil gpl"
swresample_deps="avutil"
# some compilers silently accept -std=c11, so we also need to check that the
# version macro is defined properly
-if test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L"; then
- add_cflags -std=c11
-else
+check_cpp_condition ctype.h "__STDC_VERSION__ >= 201112L" -std=c11 &&
+ add_cflags -std=c11 ||
check_cflags -std=c99
-fi
-check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
-#include <stdlib.h>
-EOF
-check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
-#include <stdlib.h>
-EOF
+check_cppflags -D_FILE_OFFSET_BITS=64
+check_cppflags -D_LARGEFILE_SOURCE
add_host_cppflags -D_ISOC99_SOURCE
check_host_cflags -std=c99
add_cppflags -U__STRICT_ANSI__
;;
linux)
- enable dv1394
enable section_data_rel_ro
+ enabled_any arm aarch64 && enable_weak linux_perf
;;
irix*)
target_os=irix
probe_libc host_
test -n "$host_libc_type" && enable host_libc_$host_libc_type
+# hacks for compiler/libc/os combinations
+
case $libc_type in
bionic)
add_compat strtod.o strtod=avpriv_strtod
;;
+ glibc)
+ if enabled tms470; then
+ CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
+ add_cppflags -D__USER_LABEL_PREFIX__=
+ add_cppflags -D__builtin_memset=memset
+ add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
+ add_cflags -pds=48 # incompatible redefinition of macro
+ elif enabled ccc; then
+ add_ldflags -Wl,-z,now # calls to libots crash without this
+ fi
+ ;;
esac
-# hacks for compiler/libc/os combinations
-
-if enabled_all tms470 libc_glibc; then
- CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
- add_cppflags -D__USER_LABEL_PREFIX__=
- add_cppflags -D__builtin_memset=memset
- add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
- add_cflags -pds=48 # incompatible redefinition of macro
-fi
-
-if enabled_all ccc libc_glibc; then
- add_ldflags -Wl,-z,now # calls to libots crash without this
-fi
-
check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
add_cppflags '-I\$(SRC_PATH)/compat/float'
sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
extern_prefix=${sym%%ff_extern*}
-check_cc <<EOF && enable_weak inline_asm
-void foo(void) { __asm__ volatile ("" ::); }
-EOF
+check_inline_asm inline_asm '"" ::'
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
EOF
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
+check_cc <<EOF && enable const_nan
+#include <math.h>
+void foo(void) { struct { double d; } static const bar[] = { { NAN } }; }
+EOF
+
if ! enabled ppc64 || enabled bigendian; then
disable vsx
fi
frei0r_src_filter_extralibs='$ldl'
ladspa_filter_extralibs='$ldl'
nvenc_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
require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
;;
tcmalloc)
- require_pkg_config libtcmalloc gperftools/tcmalloc.h tc_malloc
+ require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
malloc_prefix=tc_
;;
esac
enabled xlib &&
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
-check_header AudioToolbox/AudioToolbox.h
check_header d3d11.h
check_header direct.h
check_header dirent.h
check_header unistd.h
check_header valgrind/valgrind.h
check_header VideoDecodeAcceleration/VDADecoder.h
-check_header VideoToolbox/VideoToolbox.h
check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
-enabled videotoolbox && check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 -framework CoreVideo
check_header windows.h
check_header X11/extensions/XvMClib.h
check_header asm/types.h
check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom -ladvapi32
check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
-check_lib coreservices "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices"
+enabled appkit && check_apple_framework AppKit
+enabled audiotoolbox && check_apple_framework AudioToolbox
+enabled avfoundation && check_apple_framework AVFoundation
+enabled coreimage && check_apple_framework CoreImage
+enabled videotoolbox && check_apple_framework VideoToolbox
+
+enabled avfoundation && {
+ check_lib avfoundation CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
+ check_lib avfoundation ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
+
+enabled videotoolbox &&
+ check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
done
# these are off by default, so fail if requested and not available
-enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
-enabled avfoundation_indev && { check_lib avfoundation_indev CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
- check_lib avfoundation_indev ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
enabled cuda_sdk && require cuda_sdk cuda.h cuCtxCreate -lcuda
enabled cuvid && { enabled cuda ||
die "ERROR: CUVID requires CUDA"; }
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 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."; } }
-enabled libndi_newtek && { check_header Processing.NDI.Lib.h || die "ERROR: Processing.NDI.Lib.h header not found"; }
-enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
+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.h gnutls_global_init
+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 && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
+enabled ladspa && require_header ladspa.h
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
-enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
-enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
+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
+enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib libcelt 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 libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
-enabled libfdk_aac && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
+enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
+enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
+enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
+enabled libfdk_aac && { use_pkg_config libfdk_aac 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_extralibs="-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 && require libflite "flite/flite.h" flite_init $flite_extralibs
enabled fontconfig && enable libfontconfig
-enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
-enabled libfreetype && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
-enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
-enabled libgme && { use_pkg_config libgme gme/gme.h gme_new_emu ||
+enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
+enabled libfreetype && require_pkg_config libfreetype2 freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
+enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
+enabled libgme && { use_pkg_config libgme libgme gme/gme.h gme_new_emu ||
require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
done || die "ERROR: libgsm not found"; }
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
-enabled libkvazaar && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
+enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
# While it may appear that require is being used as a pkg-config
# fallback for libmfx, it is actually being used to detect a different
# installation route altogether. If libmfx is installed via the Intel
# Media SDK or Intel Media Server Studio, these don't come with
# pkg-config support. Instead, users should make sure that the build
# can find the libraries and headers through other means.
-enabled libmfx && { use_pkg_config libmfx "mfx/mfxvideo.h" MFXInit ||
+enabled libmfx && { use_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit ||
{ require libmfx "mfx/mfxvideo.h" MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
-enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
+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
enabled libmysofa && require libmysofa "mysofa.h" mysofa_load -lmysofa
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc ||
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
enabled libopencv && { check_header opencv2/core/core_c.h &&
- { use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
+ { use_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
- require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
-enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
+ require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
+enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
enabled libopenjpeg && { { check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
{ check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
{ check_lib libopenjpeg openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
{ check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
die "ERROR: libopenjpeg not found"; }
-enabled libopenmpt && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
+enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
enabled libopus && {
enabled libopus_decoder && {
- require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
+ require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
}
enabled libopus_encoder && {
- require_pkg_config opus opus_multistream.h opus_multistream_surround_encoder_create
+ require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
}
}
-enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
-enabled librsvg && require_pkg_config librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
-enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
-enabled librubberband && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
-enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
-enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
+enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
+enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
+enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
+enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
+enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
+enabled libsmbclient && { use_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
-enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
-enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
-enabled libtesseract && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate
+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 -lspeex
+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 libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
{ check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
-enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
-enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
-enabled libvmaf && require_pkg_config libvmaf libvmaf.h compute_vmaf
+enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
+enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
+enabled libvmaf && require_pkg_config libvmaf libvmaf libvmaf.h compute_vmaf
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
-enabled libvorbis && require_pkg_config vorbis vorbis/codec.h vorbis_info_init &&
- require_pkg_config vorbisenc vorbis/vorbisenc.h vorbis_encode_init
+enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
+ require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
enabled libvpx && {
enabled libvpx_vp8_decoder && {
- use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
+ use_pkg_config libvpx "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
check_lib libvpx_vp8_decoder "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 ||
+ use_pkg_config libvpx "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
check_lib libvpx_vp8_encoder "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 ||
+ use_pkg_config libvpx "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx
}
enabled libvpx_vp9_encoder && {
- use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
+ use_pkg_config libvpx "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx
}
if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
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
- enabled libwebp_anim_encoder && { use_pkg_config "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
-enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
+ enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
+ enabled libwebp_anim_encoder && { use_pkg_config libwebpmux "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
+enabled libx264 && { use_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
{ require libx264 "stdint.h x264.h" x264_encoder_encode -lx264 &&
warn "using libx264 without pkg-config"; } } &&
- { check_cpp_condition x264.h "X264_BUILD >= 118" ||
- die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
+ require_cpp_condition x264.h "X264_BUILD >= 118" &&
{ check_cpp_condition x264.h "X264_MPEG2" &&
enable libx262; }
-enabled libx265 && require_pkg_config x265 x265.h x265_api_get &&
- { check_cpp_condition x265.h "X265_BUILD >= 68" ||
- die "ERROR: libx265 version must be >= 68."; }
+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
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
-enabled libzimg && require_pkg_config "zimg >= 2.3.0" zimg.h zimg_get_api_version
-enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
+enabled libzimg && require_pkg_config libzimg "zimg >= 2.3.0" zimg.h zimg_get_api_version
+enabled libzmq && require_pkg_config libzmq libzmq zmq.h zmq_ctx_new
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 libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
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 &&
enabled omx_rpi && { check_header OMX_Core.h ||
{ ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
die "ERROR: OpenMAX IL headers not found"; }
-enabled omx && { check_header OMX_Core.h || die "ERROR: OpenMAX IL headers not found"; }
-enabled openssl && { use_pkg_config openssl openssl/ssl.h OPENSSL_init_ssl ||
- use_pkg_config openssl openssl/ssl.h SSL_library_init ||
+enabled omx && require_header OMX_Core.h
+enabled openssl && { use_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
+ use_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
+enabled rkmpp && { { require_pkg_config rockchip_mpp rockchip_mpp rockchip/rk_mpi.h mpp_create ||
+ die "ERROR : Rockchip MPP was not found."; } &&
+ { check_func_headers rockchip/rk_mpi_cmd.h "MPP_DEC_GET_FREE_PACKET_SLOT_COUNT" ||
+ die "ERROR: Rockchip MPP is outdated, please get a more recent one."; } &&
+ { enabled libdrm ||
+ die "ERROR: rkmpp requires --enable-libdrm"; }
+ }
if enabled gcrypt; then
GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
if enabled sdl2; then
SDL2_CONFIG="${cross_prefix}sdl2-config"
- if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
- 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 &&
+ if check_pkg_config "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent; then
check_func SDL_Init $sdl2_extralibs $sdl2_cflags ||
disable sdl2
elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
+# 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_safe 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
check_header sys/videoio.h
check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
struct_name=$2
name=$3
shift 3
- echo "static const $struct_name *$name[] = {" > $TMPH
+ echo "static const $struct_name * const $name[] = {" > $TMPH
for c in $*; do
enabled $c && printf " &ff_%s,\n" $c >> $TMPH
done