--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
- --enable-libopus enable Opus decoding via libopus [no]
+ --enable-libopus enable Opus de/encoding via libopus [no]
--enable-libpulse enable Pulseaudio input via libpulse [no]
--enable-libquvi enable quvi input via libquvi [no]
--enable-librtmp enable RTMP[E] support via librtmp [no]
eval "$var=\"$* \$$var\""
}
+unique(){
+ var=$1
+ uniq_list=""
+ for tok in $(eval echo \$$var); do
+ uniq_list="$(filter_out $tok $uniq_list) $tok"
+ done
+ eval "$var=\"${uniq_list}\""
+}
+
add_cppflags(){
append CPPFLAGS "$@"
}
pkg="freetype2"
check_cmd $pkg_config --exists --print-errors $pkg \
|| die "ERROR: $pkg not found"
- pkg_cflags=$($pkg_config --cflags $pkg)
- pkg_libs=$($pkg_config --libs $pkg)
+ pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
+ pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
{
echo "#include <ft2build.h>"
echo "#include FT_FREETYPE_H"
$TYPES_LIST
atomics_native
dos_paths
+ dxva2api_cobj
dxva2_lib
libc_msvcrt
libdc1394_1
need_memalign="altivec neon sse"
# system capabilities
-log2_deps="!libc_msvcrt"
symver_if_any="symver_asm_label symver_gnu_asm"
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
nuv_decoder_select="dsputil lzo"
on2avc_decoder_select="mdct"
+opus_decoder_deps="swresample"
png_decoder_select="zlib"
png_encoder_select="dsputil zlib"
prores_decoder_select="dsputil"
vp6f_decoder_select="vp6_decoder"
vp7_decoder_select="h264pred videodsp"
vp8_decoder_select="h264pred videodsp"
-vp9_decoder_select="videodsp"
+vp9_decoder_select="videodsp vp9_parser"
webp_decoder_select="vp8_decoder"
wmapro_decoder_select="mdct sinewin"
wmav1_decoder_select="mdct sinewin"
h264_vda_decoder_select="h264_decoder"
h264_vda_hwaccel_deps="vda"
h264_vda_hwaccel_select="h264_decoder"
+h264_vda_old_hwaccel_deps="vda"
+h264_vda_old_hwaccel_select="h264_decoder"
h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
h264_vdpau_hwaccel_deps="vdpau"
interlace_filter_deps="gpl"
kerndeint_filter_deps="gpl"
ladspa_filter_deps="ladspa dlopen"
+ladspa_filter_extralibs='$ldl'
mcdeint_filter_deps="avcodec gpl"
movie_filter_deps="avcodec avformat"
mp_filter_deps="gpl avcodec swscale inline_asm"
transcode_aac_example_deps="avcodec avformat swresample"
transcoding_example_deps="avfilter avcodec avformat avutil"
-# libraries
+# libraries, in linking order
avcodec_deps="avutil"
-avdevice_deps="avutil avcodec avformat"
+avdevice_deps="avformat avcodec avutil"
avfilter_deps="avutil"
-avformat_deps="avutil avcodec"
+avformat_deps="avcodec avutil"
avresample_deps="avutil"
postproc_deps="avutil gpl"
+swresample_deps="avutil"
swscale_deps="avutil"
# programs
_ld_path='-libpath:'
# -Qdiag-error to make icl error when seeing certain unknown arguments
_flags='-nologo -Qdiag-error:4044,10157'
- # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
+ # -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'
+ _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
if [ $pfx = hostcc ]; then
append _cflags -Dsnprintf=_snprintf
fi
case "$subarch" in
armv5t*) enable fast_clz ;;
- armv[6-8]*) enable fast_clz fast_unaligned ;;
+ armv[6-8]*)
+ enable fast_clz
+ disabled fast_unaligned || enable fast_unaligned
+ ;;
esac
elif enabled avr32; then
check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
- # check whether binutils is new enough to compile SSSE3/MMXEXT
+ # check whether binutils is new enough to compile AVX/SSSE3/MMXEXT
+ enabled avx && check_inline_asm avx_inline '"vextractf128 $1, %ymm0, %xmm1"'
enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
+enabled dxva2api_h &&
+ check_cc <<EOF && enable dxva2api_cobj
+#define _WIN32_WINNT 0x0600
+#define COBJMACROS
+#include <windows.h>
+#include <d3d9.h>
+#include <dxva2api.h>
+int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
+EOF
+
enabled vaapi &&
check_lib va/va.h vaInitialize -lva ||
disable vaapi
check_ldflags -wd10156,11030
# icc 11.0 and 11.1 work with ebp_available, but don't pass the test
enable ebp_available
+ # The test above does not test linking
+ enabled lto && disable symver_asm_label
if enabled x86_32; then
icc_version=$($cc -dumpversion)
test ${icc_version%%.*} -ge 11 &&
disable ebx_available
fi
fi
+ # msvcrt10 x64 incorrectly enables log2, only msvcrt12 onwards actually has log2.
+ check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
fi
case $as_type in
disable posix_memalign
fi
-enabled_all dxva2 CoTaskMemFree &&
+enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
prepend ffmpeg_libs $($ldflags_filter "-lole32") &&
enable dxva2_lib
fi
done
+# conditional library dependencies, in linking order
+enabled aconvert_filter && prepend avfilter_deps "swresample"
+enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
+enabled aresample_filter && prepend avfilter_deps "swresample"
+enabled asyncts_filter && prepend avfilter_deps "avresample"
+enabled atempo_filter && prepend avfilter_deps "avcodec"
+enabled decimate_filter && prepend avfilter_deps "avcodec"
+enabled deshake_filter && prepend avfilter_deps "avcodec"
+enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
+enabled elbg_filter && prepend avfilter_deps "avcodec"
+enabled mcdeint_filter && prepend avfilter_deps "avcodec"
+enabled movie_filter && prepend avfilter_deps "avformat avcodec"
+enabled mp_filter && prepend avfilter_deps "avcodec"
+enabled pan_filter && prepend avfilter_deps "swresample"
+enabled pp_filter && prepend avfilter_deps "postproc"
+enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
+enabled resample_filter && prepend avfilter_deps "avresample"
+enabled sab_filter && prepend avfilter_deps "swscale"
+enabled scale_filter && prepend avfilter_deps "swscale"
+enabled showspectrum_filter && prepend avfilter_deps "avcodec"
+enabled smartblur_filter && prepend avfilter_deps "swscale"
+enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
+
+enabled lavfi_indev && prepend avdevice_deps "avfilter"
+
+enabled opus_decoder && prepend avcodec_deps "swresample"
+
+expand_deps(){
+ lib_deps=${1}_deps
+ eval "deps=\$$lib_deps"
+ append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
+ unique $lib_deps
+}
+
+#we have to remove gpl from the deps here as some code assumes all lib deps are libs
+postproc_deps="$(filter_out 'gpl' $postproc_deps)"
+
+map 'expand_deps $v' $LIBRARY_LIST
+
echo "install prefix $prefix"
echo "source path $source_path"
echo "C compiler $cc"
map 'get_version $v' $LIBRARY_LIST
+map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
+
print_program_libs(){
eval "program_libs=\$${1}_libs"
eval echo "LIBS-${1}=${program_libs}" >> config.mak
# build pkg-config files
+lib_version(){
+ eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
+}
+
pkgconfig_generate(){
name=$1
shortname=${name#lib}${build_suffix}
comment=$2
version=$3
libs=$4
- requires=$5
+ requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
+ requires=${requires%, }
enabled ${name#lib} || return 0
mkdir -p $name
cat <<EOF > $name/$name${build_suffix}.pc
EOF
}
-lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
-enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
-enabled libavfilter_deps_avresample && prepend lavfi_libs "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
-enabled libavfilter_deps_swscale && prepend lavfi_libs "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
-enabled libavfilter_deps_swresample && prepend lavfi_libs "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
-enabled libavfilter_deps_postproc && prepend lavfi_libs "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
-lavfi_libs=${lavfi_libs%, }
-
-lavd_libs="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
-enabled lavfi_indev && prepend lavd_libs "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
-
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
-pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
-pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$lavd_libs"
-pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$lavfi_libs"
-pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
+pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
+pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
+pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
+pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
+pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
+pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
+pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
+pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"