summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/ffmpeg
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg')
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavf-srt-fix-build-fail-when-used-the-libsrt-1.4.1.patch52
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch97
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35964.patch75
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35965.patch35
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch32
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg_6.1.1.bb (renamed from meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.1.bb)137
6 files changed, 75 insertions, 353 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavf-srt-fix-build-fail-when-used-the-libsrt-1.4.1.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavf-srt-fix-build-fail-when-used-the-libsrt-1.4.1.patch
deleted file mode 100644
index 7635c9196a..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-lavf-srt-fix-build-fail-when-used-the-libsrt-1.4.1.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1From aebb72e025cbfbd4a6765354f6f565ad4ac89789 Mon Sep 17 00:00:00 2001
2From: Jun Zhao <barryjzhao@tencent.com>
3Date: Sun, 12 Jul 2020 05:48:48 +0800
4Subject: [PATCH] lavf/srt: fix build fail when used the libsrt 1.4.1
5
6lavf/srt: fix build fail when used the libsrt 1.4.1
7
8libsrt changed the:
9SRTO_SMOOTHER -> SRTO_CONGESTION
10SRTO_STRICTENC -> SRTO_ENFORCEDENCRYPTION
11and removed the front of deprecated options (SRTO_SMOOTHER/SRTO_STRICTENC)
12in the header, it's lead to build fail
13
14fix #8760
15
16Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315]
17
18Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
19Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
20---
21 libavformat/libsrt.c | 8 ++++++++
22 1 file changed, 8 insertions(+)
23
24diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
25index 4de575b..4719ce0 100644
26--- a/libavformat/libsrt.c
27+++ b/libavformat/libsrt.c
28@@ -313,8 +313,12 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
29 (s->pbkeylen >= 0 && libsrt_setsockopt(h, fd, SRTO_PBKEYLEN, "SRTO_PBKEYLEN", &s->pbkeylen, sizeof(s->pbkeylen)) < 0) ||
30 (s->passphrase && libsrt_setsockopt(h, fd, SRTO_PASSPHRASE, "SRTO_PASSPHRASE", s->passphrase, strlen(s->passphrase)) < 0) ||
31 #if SRT_VERSION_VALUE >= 0x010302
32+#if SRT_VERSION_VALUE >= 0x010401
33+ (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_ENFORCEDENCRYPTION, "SRTO_ENFORCEDENCRYPTION", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
34+#else
35 /* SRTO_STRICTENC == SRTO_ENFORCEDENCRYPTION (53), but for compatibility, we used SRTO_STRICTENC */
36 (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_STRICTENC, "SRTO_STRICTENC", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
37+#endif
38 (s->kmrefreshrate >= 0 && libsrt_setsockopt(h, fd, SRTO_KMREFRESHRATE, "SRTO_KMREFRESHRATE", &s->kmrefreshrate, sizeof(s->kmrefreshrate)) < 0) ||
39 (s->kmpreannounce >= 0 && libsrt_setsockopt(h, fd, SRTO_KMPREANNOUNCE, "SRTO_KMPREANNOUNCE", &s->kmpreannounce, sizeof(s->kmpreannounce)) < 0) ||
40 #endif
41@@ -333,7 +337,11 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
42 (s->lossmaxttl >= 0 && libsrt_setsockopt(h, fd, SRTO_LOSSMAXTTL, "SRTO_LOSSMAXTTL", &s->lossmaxttl, sizeof(s->lossmaxttl)) < 0) ||
43 (s->minversion >= 0 && libsrt_setsockopt(h, fd, SRTO_MINVERSION, "SRTO_MINVERSION", &s->minversion, sizeof(s->minversion)) < 0) ||
44 (s->streamid && libsrt_setsockopt(h, fd, SRTO_STREAMID, "SRTO_STREAMID", s->streamid, strlen(s->streamid)) < 0) ||
45+#if SRT_VERSION_VALUE >= 0x010401
46+ (s->smoother && libsrt_setsockopt(h, fd, SRTO_CONGESTION, "SRTO_CONGESTION", s->smoother, strlen(s->smoother)) < 0) ||
47+#else
48 (s->smoother && libsrt_setsockopt(h, fd, SRTO_SMOOTHER, "SRTO_SMOOTHER", s->smoother, strlen(s->smoother)) < 0) ||
49+#endif
50 (s->messageapi >= 0 && libsrt_setsockopt(h, fd, SRTO_MESSAGEAPI, "SRTO_MESSAGEAPI", &s->messageapi, sizeof(s->messageapi)) < 0) ||
51 (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0) ||
52 ((h->flags & AVIO_FLAG_WRITE) && libsrt_setsockopt(h, fd, SRTO_SENDER, "SRTO_SENDER", &yes, sizeof(yes)) < 0)) {
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch
deleted file mode 100644
index 3b503c49c9..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch
+++ /dev/null
@@ -1,97 +0,0 @@
1From 24a58d70cbb3997e471366bd5afe54be9007bfb1 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 10 Nov 2020 15:32:14 +0000
4Subject: [PATCH] libavutil: include assembly with full path from source root
5
6Otherwise nasm writes the full host-specific paths into .o
7output, which breaks binary reproducibility.
8
9Upstream-Status: Pending
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 libavutil/x86/cpuid.asm | 2 +-
13 libavutil/x86/emms.asm | 2 +-
14 libavutil/x86/fixed_dsp.asm | 2 +-
15 libavutil/x86/float_dsp.asm | 2 +-
16 libavutil/x86/lls.asm | 2 +-
17 libavutil/x86/pixelutils.asm | 2 +-
18 6 files changed, 6 insertions(+), 6 deletions(-)
19
20diff --git a/libavutil/x86/cpuid.asm b/libavutil/x86/cpuid.asm
21index c3f7866..766f77f 100644
22--- a/libavutil/x86/cpuid.asm
23+++ b/libavutil/x86/cpuid.asm
24@@ -21,7 +21,7 @@
25 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 ;******************************************************************************
27
28-%include "x86util.asm"
29+%include "libavutil/x86/x86util.asm"
30
31 SECTION .text
32
33diff --git a/libavutil/x86/emms.asm b/libavutil/x86/emms.asm
34index 8611762..df84f22 100644
35--- a/libavutil/x86/emms.asm
36+++ b/libavutil/x86/emms.asm
37@@ -18,7 +18,7 @@
38 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
39 ;******************************************************************************
40
41-%include "x86util.asm"
42+%include "libavutil/x86/x86util.asm"
43
44 SECTION .text
45
46diff --git a/libavutil/x86/fixed_dsp.asm b/libavutil/x86/fixed_dsp.asm
47index 979dd5c..2f41185 100644
48--- a/libavutil/x86/fixed_dsp.asm
49+++ b/libavutil/x86/fixed_dsp.asm
50@@ -20,7 +20,7 @@
51 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
52 ;******************************************************************************
53
54-%include "x86util.asm"
55+%include "libavutil/x86/x86util.asm"
56
57 SECTION .text
58
59diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm
60index 517fd63..b773e61 100644
61--- a/libavutil/x86/float_dsp.asm
62+++ b/libavutil/x86/float_dsp.asm
63@@ -20,7 +20,7 @@
64 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
65 ;******************************************************************************
66
67-%include "x86util.asm"
68+%include "libavutil/x86/x86util.asm"
69
70 SECTION_RODATA 32
71 pd_reverse: dd 7, 6, 5, 4, 3, 2, 1, 0
72diff --git a/libavutil/x86/lls.asm b/libavutil/x86/lls.asm
73index 317fba6..d2526d1 100644
74--- a/libavutil/x86/lls.asm
75+++ b/libavutil/x86/lls.asm
76@@ -20,7 +20,7 @@
77 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
78 ;******************************************************************************
79
80-%include "x86util.asm"
81+%include "libavutil/x86/x86util.asm"
82
83 SECTION .text
84
85diff --git a/libavutil/x86/pixelutils.asm b/libavutil/x86/pixelutils.asm
86index 36c57c5..8b45ead 100644
87--- a/libavutil/x86/pixelutils.asm
88+++ b/libavutil/x86/pixelutils.asm
89@@ -21,7 +21,7 @@
90 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
91 ;******************************************************************************
92
93-%include "x86util.asm"
94+%include "libavutil/x86/x86util.asm"
95
96 SECTION .text
97
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35964.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35964.patch
deleted file mode 100644
index 6b96bd674f..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35964.patch
+++ /dev/null
@@ -1,75 +0,0 @@
1From 27a99e2c7d450fef15594671eef4465c8a166bd7 Mon Sep 17 00:00:00 2001
2From: Michael Niedermayer <michael@niedermayer.cc>
3Date: Wed, 28 Oct 2020 20:11:54 +0100
4Subject: [PATCH] avformat/vividas: improve extradata packing checks in
5 track_header()
6
7Fixes: out of array accesses
8Fixes: 26622/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6581200338288640
9
10Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
11Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12
13Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/27a99e2c7d450fef15594671eef4465c8a166bd7]
14
15CVE: CVE-2020-35964
16
17Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
18Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com>
19---
20 libavformat/vividas.c | 12 ++++++------
21 1 file changed, 6 insertions(+), 6 deletions(-)
22
23diff --git a/libavformat/vividas.c b/libavformat/vividas.c
24index 83d0ed116787..46c66bf9a0ae 100644
25--- a/libavformat/vividas.c
26+++ b/libavformat/vividas.c
27@@ -28,6 +28,7 @@
28 * @sa http://wiki.multimedia.cx/index.php?title=Vividas_VIV
29 */
30
31+#include "libavutil/avassert.h"
32 #include "libavutil/intreadwrite.h"
33 #include "avio_internal.h"
34 #include "avformat.h"
35@@ -379,7 +380,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
36
37 if (avio_tell(pb) < off) {
38 int num_data;
39- int xd_size = 0;
40+ int xd_size = 1;
41 int data_len[256];
42 int offset = 1;
43 uint8_t *p;
44@@ -393,10 +394,10 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
45 return AVERROR_INVALIDDATA;
46 }
47 data_len[j] = len;
48- xd_size += len;
49+ xd_size += len + 1 + len/255;
50 }
51
52- ret = ff_alloc_extradata(st->codecpar, 64 + xd_size + xd_size / 255);
53+ ret = ff_alloc_extradata(st->codecpar, xd_size);
54 if (ret < 0)
55 return ret;
56
57@@ -405,9 +406,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
58
59 for (j = 0; j < num_data - 1; j++) {
60 unsigned delta = av_xiphlacing(&p[offset], data_len[j]);
61- if (delta > data_len[j]) {
62- return AVERROR_INVALIDDATA;
63- }
64+ av_assert0(delta <= xd_size - offset);
65 offset += delta;
66 }
67
68@@ -418,6 +417,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
69 av_freep(&st->codecpar->extradata);
70 break;
71 }
72+ av_assert0(data_len[j] <= xd_size - offset);
73 offset += data_len[j];
74 }
75
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35965.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35965.patch
deleted file mode 100644
index ddab8e9aca..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2020-35965.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From 3e5959b3457f7f1856d997261e6ac672bba49e8b Mon Sep 17 00:00:00 2001
2From: Michael Niedermayer <michael@niedermayer.cc>
3Date: Sat, 24 Oct 2020 22:21:48 +0200
4Subject: [PATCH] avcodec/exr: Check ymin vs. h
5
6Fixes: out of array access
7Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344
8Fixes: 27443/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5631239813595136
9
10Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
11Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12
13Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/3e5959b3457f7f1856d997261e6ac672bba49e8b]
14
15CVE: CVE-2020-35965
16
17Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
18Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com>
19---
20 libavcodec/exr.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/libavcodec/exr.c b/libavcodec/exr.c
24index e907c5c46401..8b701d1cd298 100644
25--- a/libavcodec/exr.c
26+++ b/libavcodec/exr.c
27@@ -1830,7 +1830,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
28 // Zero out the start if ymin is not 0
29 for (i = 0; i < planes; i++) {
30 ptr = picture->data[i];
31- for (y = 0; y < s->ymin; y++) {
32+ for (y = 0; y < FFMIN(s->ymin, s->h); y++) {
33 memset(ptr, 0, out_line_size);
34 ptr += picture->linesize[i];
35 }
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch
deleted file mode 100644
index 69429af8f0..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1It will add -mips64r6 and -mips64r2 to cmdline which will
2cause conflicts
3
4in OE we user mips32r2 and mips64r2 for mips arch versions
5so there is no benefit of detecting it automatically by
6poking at tools especially in cross env
7
8Fixes errors like
9
10linking -mnan=2008 module with previous -mnan=legacy modules
11failed to merge target specific data of file
12
13-Khem
14Upstream-Status: Inappropriate [OE-Specific]
15
16Index: ffmpeg-3.1.1/configure
17===================================================================
18--- ffmpeg-3.1.1.orig/configure
19+++ ffmpeg-3.1.1/configure
20@@ -5220,12 +5220,9 @@ elif enabled mips; then
21
22 # Enable minimum ISA based on selected options
23 if enabled mips64; then
24- enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
25 enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
26 disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
27 else
28- enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
29- enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
30 enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
31 disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
32 fi
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.1.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_6.1.1.bb
index bd21552332..aa59755034 100644
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.1.bb
+++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_6.1.1.bb
@@ -5,17 +5,16 @@ DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encod
5HOMEPAGE = "https://www.ffmpeg.org/" 5HOMEPAGE = "https://www.ffmpeg.org/"
6SECTION = "libs" 6SECTION = "libs"
7 7
8LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT" 8LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & ISC & MIT & BSD-2-Clause & BSD-3-Clause & IJG"
9LICENSE_${PN} = "GPLv2+" 9LICENSE:${PN} = "GPL-2.0-or-later"
10LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 10LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
11LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 11LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
12LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 12LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
13LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 13LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
14LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 14LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
15LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 15LICENSE:libpostproc = "GPL-2.0-or-later"
16LICENSE_libpostproc = "GPLv2+" 16LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
17LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" 17LICENSE:libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPL-2.0-or-later', 'LGPL-2.1-or-later', d)}"
18LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
19LICENSE_FLAGS = "commercial" 18LICENSE_FLAGS = "commercial"
20 19
21LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 20LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
@@ -23,19 +22,21 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
23 file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ 22 file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
24 file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" 23 file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
25 24
26SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ 25SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz"
27 file://mips64_cpu_detection.patch \ 26
28 file://0001-lavf-srt-fix-build-fail-when-used-the-libsrt-1.4.1.patch \ 27SRC_URI[sha256sum] = "8684f4b00f94b85461884c3719382f1261f0d9eb3d59640a1f4ac0873616f968"
29 file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \ 28
30 file://CVE-2020-35964.patch \ 29# https://nvd.nist.gov/vuln/detail/CVE-2023-39018
31 file://CVE-2020-35965.patch \ 30# https://github.com/bramp/ffmpeg-cli-wrapper/issues/291
32 " 31# https://security-tracker.debian.org/tracker/CVE-2023-39018
33SRC_URI[sha256sum] = "ad009240d46e307b4e03a213a0f49c11b650e445b1f8be0dda2a9212b34d2ffb" 32# https://bugzilla.suse.com/show_bug.cgi?id=CVE-2023-39018
33CVE_STATUS[CVE-2023-39018] = "cpe-incorrect: This issue belongs to ffmpeg-cli-wrapper \
34(Java wrapper around the FFmpeg CLI) and not ffmepg itself."
34 35
35# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 36# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
36ARM_INSTRUCTION_SET_armv4 = "arm" 37ARM_INSTRUCTION_SET:armv4 = "arm"
37ARM_INSTRUCTION_SET_armv5 = "arm" 38ARM_INSTRUCTION_SET:armv5 = "arm"
38ARM_INSTRUCTION_SET_armv6 = "arm" 39ARM_INSTRUCTION_SET:armv6 = "arm"
39 40
40# Should be API compatible with libav (which was a fork of ffmpeg) 41# Should be API compatible with libav (which was a fork of ffmpeg)
41# libpostproc was previously packaged from a separate recipe 42# libpostproc was previously packaged from a separate recipe
@@ -45,9 +46,8 @@ DEPENDS = "nasm-native"
45 46
46inherit autotools pkgconfig 47inherit autotools pkgconfig
47 48
48PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \ 49PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \
49 alsa bzlib gpl lzma pic pthreads shared theora x264 zlib \ 50 alsa bzlib lzma theora zlib \
50 ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \
51 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" 51 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}"
52 52
53# libraries to build in addition to avutil 53# libraries to build in addition to avutil
@@ -58,7 +58,6 @@ PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
58PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" 58PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
59PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" 59PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
60PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" 60PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
61PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample"
62 61
63# features to support 62# features to support
64PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" 63PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
@@ -68,6 +67,7 @@ PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-
68PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" 67PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
69PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" 68PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
70PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" 69PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
70PACKAGECONFIG[libopus] = "--enable-libopus,--disable-libopus,libopus"
71PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" 71PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
72PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz" 72PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
73PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk" 73PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk"
@@ -77,6 +77,7 @@ PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2"
77PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" 77PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
78PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt" 78PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt"
79PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg" 79PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg"
80PACKAGECONFIG[v4l2] = "--enable-libv4l2,--disable-libv4l2,v4l-utils"
80PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" 81PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
81PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" 82PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
82PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" 83PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
@@ -86,13 +87,6 @@ PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb"
86PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" 87PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
87PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" 88PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
88 89
89# other configuration options
90PACKAGECONFIG[mips32r2] = ",--disable-mipsdsp --disable-mipsdspr2"
91PACKAGECONFIG[pic] = "--enable-pic"
92PACKAGECONFIG[pthreads] = "--enable-pthreads,--disable-pthreads"
93PACKAGECONFIG[shared] = "--enable-shared"
94PACKAGECONFIG[strip] = ",--disable-stripping"
95
96# Check codecs that require --enable-nonfree 90# Check codecs that require --enable-nonfree
97USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" 91USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}"
98 92
@@ -103,41 +97,63 @@ def cpu(d):
103 return 'generic' 97 return 'generic'
104 98
105EXTRA_OECONF = " \ 99EXTRA_OECONF = " \
100 --disable-stripping \
101 --enable-pic \
102 --enable-shared \
103 --enable-pthreads \
106 ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \ 104 ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
107 \ 105 \
108 --cross-prefix=${TARGET_PREFIX} \ 106 --cross-prefix=${TARGET_PREFIX} \
109 \ 107 \
110 --ld="${CCLD}" \ 108 --ld='${CCLD}' \
111 --cc="${CC}" \ 109 --cc='${CC}' \
112 --cxx="${CXX}" \ 110 --cxx='${CXX}' \
113 --arch=${TARGET_ARCH} \ 111 --arch=${TARGET_ARCH} \
114 --target-os="linux" \ 112 --target-os='linux' \
115 --enable-cross-compile \ 113 --enable-cross-compile \
116 --extra-cflags="${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \ 114 --extra-cflags='${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}' \
117 --extra-ldflags="${LDFLAGS}" \ 115 --extra-ldflags='${LDFLAGS}' \
118 --sysroot="${STAGING_DIR_TARGET}" \ 116 --sysroot='${STAGING_DIR_TARGET}' \
119 ${EXTRA_FFCONF} \ 117 ${EXTRA_FFCONF} \
120 --libdir=${libdir} \ 118 --libdir=${libdir} \
121 --shlibdir=${libdir} \ 119 --shlibdir=${libdir} \
122 --datadir=${datadir}/ffmpeg \ 120 --datadir=${datadir}/ffmpeg \
121 ${@bb.utils.contains('AVAILTUNES', 'mips32r2', '', '--disable-mipsdsp --disable-mipsdspr2', d)} \
123 --cpu=${@cpu(d)} \ 122 --cpu=${@cpu(d)} \
124 --pkg-config=pkg-config \ 123 --pkg-config=pkg-config \
125" 124"
126 125
127EXTRA_OECONF_append_linux-gnux32 = " --disable-asm" 126EXTRA_OECONF:append:linux-gnux32 = " --disable-asm"
127
128EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', '--disable-mips64r2 --disable-mips32r2', '', d)}"
129EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r2', '--disable-mips64r6 --disable-mips32r6', '', d)}"
130EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r2', '--disable-mips64r6 --disable-mips32r6', '', d)}"
131EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r6', '--disable-mips64r2 --disable-mips32r2', '', d)}"
132EXTRA_OECONF:append:mips = " --extra-libs=-latomic --disable-mips32r5 --disable-mipsdsp --disable-mipsdspr2 \
133 --disable-loongson2 --disable-loongson3 --disable-mmi --disable-msa"
134EXTRA_OECONF:append:riscv32 = " --extra-libs=-latomic --disable-rvv --disable-asm"
135EXTRA_OECONF:append:armv5 = " --extra-libs=-latomic"
136EXTRA_OECONF:append:powerpc = " --extra-libs=-latomic"
137EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
138EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
139
128# gold crashes on x86, another solution is to --disable-asm but thats more hacky 140# gold crashes on x86, another solution is to --disable-asm but thats more hacky
129# ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684 141# ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684
130 142
131LDFLAGS_append_x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" 143LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
144LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=bfd ', '', d)}"
132 145
133EXTRA_OEMAKE = "V=1" 146EXTRA_OEMAKE = "V=1"
134 147
135do_configure() { 148do_configure() {
149 export TMPDIR="${B}/tmp"
150 mkdir -p ${B}/tmp
136 ${S}/configure ${EXTRA_OECONF} 151 ${S}/configure ${EXTRA_OECONF}
152 sed -i -e "s,^X86ASMFLAGS=.*,& --debug-prefix-map=${S}=${TARGET_DBGSRC_DIR} --debug-prefix-map=${B}=${TARGET_DBGSRC_DIR},g" ${B}/ffbuild/config.mak
137} 153}
138 154
139# patch out build host paths for reproducibility 155# patch out build host paths for reproducibility
140do_compile_prepend_class-target() { 156do_compile:prepend:class-target() {
141 sed -i -e "s,${WORKDIR},,g" ${B}/config.h 157 sed -i -e "s,${WORKDIR},,g" ${B}/config.h
142} 158}
143 159
@@ -145,29 +161,26 @@ PACKAGES =+ "libavcodec \
145 libavdevice \ 161 libavdevice \
146 libavfilter \ 162 libavfilter \
147 libavformat \ 163 libavformat \
148 libavresample \
149 libavutil \ 164 libavutil \
150 libpostproc \ 165 libpostproc \
151 libswresample \ 166 libswresample \
152 libswscale" 167 libswscale"
153 168
154FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}" 169FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}"
155FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}" 170FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}"
156FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}" 171FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}"
157FILES_libavformat = "${libdir}/libavformat${SOLIBS}" 172FILES:libavformat = "${libdir}/libavformat${SOLIBS}"
158FILES_libavresample = "${libdir}/libavresample${SOLIBS}" 173FILES:libavutil = "${libdir}/libavutil${SOLIBS}"
159FILES_libavutil = "${libdir}/libavutil${SOLIBS}" 174FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}"
160FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}" 175FILES:libswresample = "${libdir}/libswresample${SOLIBS}"
161FILES_libswresample = "${libdir}/libswresample${SOLIBS}" 176FILES:libswscale = "${libdir}/libswscale${SOLIBS}"
162FILES_libswscale = "${libdir}/libswscale${SOLIBS}"
163 177
164# ffmpeg disables PIC on some platforms (e.g. x86-32) 178# ffmpeg disables PIC on some platforms (e.g. x86-32)
165INSANE_SKIP_${MLPREFIX}libavcodec = "textrel" 179INSANE_SKIP:${MLPREFIX}libavcodec = "textrel"
166INSANE_SKIP_${MLPREFIX}libavdevice = "textrel" 180INSANE_SKIP:${MLPREFIX}libavdevice = "textrel"
167INSANE_SKIP_${MLPREFIX}libavfilter = "textrel" 181INSANE_SKIP:${MLPREFIX}libavfilter = "textrel"
168INSANE_SKIP_${MLPREFIX}libavformat = "textrel" 182INSANE_SKIP:${MLPREFIX}libavformat = "textrel"
169INSANE_SKIP_${MLPREFIX}libavutil = "textrel" 183INSANE_SKIP:${MLPREFIX}libavutil = "textrel"
170INSANE_SKIP_${MLPREFIX}libavresample = "textrel" 184INSANE_SKIP:${MLPREFIX}libswscale = "textrel"
171INSANE_SKIP_${MLPREFIX}libswscale = "textrel" 185INSANE_SKIP:${MLPREFIX}libswresample = "textrel"
172INSANE_SKIP_${MLPREFIX}libswresample = "textrel" 186INSANE_SKIP:${MLPREFIX}libpostproc = "textrel"
173INSANE_SKIP_${MLPREFIX}libpostproc = "textrel"