Skip to content

Commit

Permalink
Merge pull request #1245 from microsoft/master
Browse files Browse the repository at this point in the history
[ffmpeg] Update to 5.0 (microsoft#23312)
  • Loading branch information
Jimmy-Hu authored Jan 4, 2023
2 parents 30d0fbd + 0f719b3 commit 85b1ab3
Show file tree
Hide file tree
Showing 24 changed files with 125 additions and 216 deletions.
4 changes: 2 additions & 2 deletions ports/ffmpeg/0001-create-lib-libraries.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index 89af70d..405680e 100755
index 34c2adb..1c8008a 100755
--- a/configure
+++ b/configure
@@ -5480,15 +5480,17 @@ case $target_os in
@@ -5352,15 +5352,17 @@ case $target_os in
;;
win32|win64)
disable symver
Expand Down
4 changes: 2 additions & 2 deletions ports/ffmpeg/0003-fix-windowsinclude.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index fe424b6..2df70df 100644
index 9cfbc45..e3447e6 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -60,6 +60,8 @@
@@ -63,6 +63,8 @@
#include <sys/resource.h>
#endif
#ifdef _WIN32
Expand Down
11 changes: 6 additions & 5 deletions ports/ffmpeg/0004-fix-debug-build.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index 405680e..cc5bf29 100755
index bd2de34..fba948a 100755
--- a/configure
+++ b/configure
@@ -4111,6 +4111,9 @@ for opt do
@@ -3993,6 +3993,9 @@ for opt do
--libfuzzer=*)
libfuzzer_path="$optval"
;;
Expand All @@ -12,7 +12,7 @@ index 405680e..cc5bf29 100755
*)
optname="${opt%%=*}"
optname="${optname#--}"
@@ -6316,7 +6319,11 @@ fi
@@ -6464,8 +6464,12 @@

enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
check_lib zlib zlib.h zlibVersion -lz; }
Expand All @@ -24,8 +24,9 @@ index 405680e..cc5bf29 100755
+fi
enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma

# On some systems dynamic loading requires no extra linker flags
@@ -6434,7 +6441,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8
enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
#include <zlib.h>
@@ -6350,7 +6350,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8
enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
Expand Down
14 changes: 7 additions & 7 deletions ports/ffmpeg/0006-fix-StaticFeatures.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index cc5bf29..ee26559 100755
index 3bdcfc6..00b2f13 100644
--- a/configure
+++ b/configure
@@ -6406,7 +6406,8 @@ if enabled libmfx; then
@@ -6351,7 +6351,8 @@ if enabled libmfx; then
fi

enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
Expand All @@ -11,8 +11,8 @@ index cc5bf29..ee26559 100755
+ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; }
enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
@@ -6446,7 +6447,7 @@ if enabled debug_configure; then
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
@@ -6392,7 +6393,7 @@ if enabled debug_configure; then
else
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
fi
Expand All @@ -21,7 +21,7 @@ index cc5bf29..ee26559 100755
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.3.0" srt/srt.h srt_socket
@@ -6527,6 +6528,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal"
@@ -6460,6 +6461,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal"
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
Expand All @@ -30,15 +30,15 @@ index cc5bf29..ee26559 100755
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -6550,6 +6553,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
@@ -6479,6 +6482,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
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 ||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 -lAdvapi32 -lUser32||
die "ERROR: openssl not found"; }
enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
@@ -6811,7 +6815,7 @@ enabled amf &&
@@ -6707,7 +6711,7 @@ enabled amf &&
if enabled libc_iconv; then
check_func_headers iconv.h iconv
elif enabled iconv; then
Expand Down
5 changes: 3 additions & 2 deletions ports/ffmpeg/0007-fix-lib-naming.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
diff --git a/configure b/configure
index ee26559..f2c83b7 100755
index d6c4388..75b96c3 100644
--- a/configure
+++ b/configure
@@ -4496,6 +4496,10 @@ msvc_common_flags(){
@@ -4378,6 +4378,11 @@ msvc_common_flags(){
-march=*) ;;
-lz) echo zlib.lib ;;
-lx264) echo libx264.lib ;;
+ -lx265) echo libx265.lib ;;
+ -lmp3lame) echo libmp3lame.lib ;;
+ -liconv) echo iconv.lib ;;
+ -llibcharset) echo charset.lib ;;
+ -lm) ;;
-lstdc++) ;;
-l*) echo ${flag#-l}.lib ;;
Expand Down
5 changes: 3 additions & 2 deletions ports/ffmpeg/0009-Fix-fdk-detection.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index f2c83b7..5e42b12 100755
index b137669dd3..34c92230f4 100755
--- a/configure
+++ b/configure
@@ -6379,7 +6379,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.
@@ -6331,7 +6331,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.
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 && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
Expand All @@ -11,3 +11,4 @@ index f2c83b7..5e42b12 100755
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

13 changes: 0 additions & 13 deletions ports/ffmpeg/0010-Fix-x264-detection.patch

This file was deleted.

5 changes: 3 additions & 2 deletions ports/ffmpeg/0011-Fix-x265-detection.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index d8f059f..f3688ad 100755
index 34a2e644c4..0ea64bd306 100755
--- a/configure
+++ b/configure
@@ -6501,7 +6501,10 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
@@ -6447,7 +6447,10 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
warn "using libx264 without pkg-config"; } } &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
Expand All @@ -14,3 +14,4 @@ index d8f059f..f3688ad 100755
require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get

10 changes: 6 additions & 4 deletions ports/ffmpeg/0012-Fix-ssl-110-detection.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
diff --git a/configure b/configure
index f3688ad..26e512e 100755
index 2be953f7e7..e075949ffc 100755
--- a/configure
+++ b/configure
@@ -6556,6 +6556,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
enabled omx && require_headers OMX_Core.h
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
@@ -6497,6 +6497,7 @@ enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0
{ enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
{ enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl ||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||

7 changes: 3 additions & 4 deletions ports/ffmpeg/0013-define-WINVER.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff --git a/libavcodec/mf_utils.c b/libavcodec/mf_utils.c
index eeabd0c..ea3a03b 100644
--- a/libavcodec/mf_utils.c
+++ b/libavcodec/mf_utils.c
diff --color -Naur src_old/libavcodec/mf_utils.c src/libavcodec/mf_utils.c
--- src_old/libavcodec/mf_utils.c 2020-07-11 05:26:17.000000000 +0700
+++ src/libavcodec/mf_utils.c 2020-11-13 12:55:57.226976400 +0700
@@ -22,6 +22,11 @@
#define _WIN32_WINNT 0x0602
#endif
Expand Down
23 changes: 0 additions & 23 deletions ports/ffmpeg/0014-avfilter-dependency-fix.patch

This file was deleted.

8 changes: 6 additions & 2 deletions ports/ffmpeg/0015-Fix-xml2-detection.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index c0377b6..62753ef 100755
index 900505756b..8d1388a347 100755
--- a/configure
+++ b/configure
@@ -6526,7 +6526,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z
@@ -6476,7 +6476,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z
enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
{ test_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."; }
Expand All @@ -11,3 +14,4 @@ index c0377b6..62753ef 100755
enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||

This file was deleted.

13 changes: 0 additions & 13 deletions ports/ffmpeg/0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
From d5fca748d76602a912590b64022560283db6fae6 Mon Sep 17 00:00:00 2001
From: Matt Oliver <[email protected]>
Date: Sat, 30 Oct 2021 14:09:29 +1100
Subject: [PATCH] libx264: Do not explicitly set X264_API_IMPORTS

---
configure | 8 +++-----
libavcodec/libx264.c | 4 ----
2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 62753ef..018764e 100755
index ede8f9777b..b35728aace 100755
--- a/configure
+++ b/configure
@@ -6508,11 +6508,8 @@ enabled libvpx && {
@@ -6535,11 +6535,8 @@ enabled libvpx && {
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
-enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" &&
- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
- warn "using libx264 without pkg-config"; } } &&
- require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
- check_cpp_condition libx262 x264.h "X264_MPEG2"
Expand All @@ -17,12 +27,12 @@ index 62753ef..018764e 100755
{ { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" ||
require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } &&
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ddc497..0152d30 100644
index 21f434d06d..efbc9608c7 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -32,10 +32,6 @@
#include "packet_internal.h"
@@ -34,10 +34,6 @@
#include "atsc_a53.h"
#include "sei.h"

-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
Expand All @@ -31,3 +41,6 @@ index 4ddc497..0152d30 100644
#include <x264.h>
#include <float.h>
#include <math.h>
--
2.33.1.windows.1

4 changes: 2 additions & 2 deletions ports/ffmpeg/0020-fix-aarch64-libswscale.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
index f4b220f..af677af 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
index af677afe6..f4b220fb6 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -169,19 +169,19 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
sqdmulh v26.8H, v26.8H, v0.8H // ((Y1*(1<<3) - y_offset) * y_coeff) >> 15
Expand Down
13 changes: 13 additions & 0 deletions ports/ffmpeg/0021-fix-sdl2-version-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/configure b/configure
index 2829d79..697a504 100755
--- a/configure
+++ b/configure
@@ -6589,7 +6589,7 @@ fi

if enabled sdl2; then
SDL2_CONFIG="${cross_prefix}sdl2-config"
- test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
+ test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
14 changes: 14 additions & 0 deletions ports/ffmpeg/0022-fix-iconv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/configure b/configure
index 2829d79..697a504 100755
--- a/configure
+++ b/configure
@@ -4221,9 +4221,6 @@
if disabled autodetect; then

- # Unless iconv is explicitely disabled by the user, we still want to probe
- # for the iconv from the libc.
- disabled iconv || enable libc_iconv

disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
fi
Loading

0 comments on commit 85b1ab3

Please sign in to comment.