From f3afff95455153a89df1d0b15b6173b910863be8 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Tue, 2 Nov 2021 09:42:54 +0100 Subject: ffmpeg: update 4.4 -> 4.4.1 Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- .../ffmpeg/ffmpeg/fix-CVE-2020-20446.patch | 35 ---- .../ffmpeg/ffmpeg/fix-CVE-2020-20453.patch | 42 ----- .../ffmpeg/ffmpeg/fix-CVE-2020-22015.patch | 44 ----- .../ffmpeg/ffmpeg/fix-CVE-2020-22021.patch | 87 ---------- .../ffmpeg/fix-CVE-2020-22033-CVE-2020-22019.patch | 40 ----- .../ffmpeg/ffmpeg/fix-CVE-2021-33815.patch | 44 ----- .../ffmpeg/ffmpeg/fix-CVE-2021-38114.patch | 67 -------- .../ffmpeg/ffmpeg/fix-CVE-2021-38171.patch | 42 ----- meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb | 180 ++++++++++++++++++++ meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb | 188 --------------------- 10 files changed, 180 insertions(+), 589 deletions(-) delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20446.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20453.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22015.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22021.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22033-CVE-2020-22019.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-33815.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38171.patch create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb delete mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20446.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20446.patch deleted file mode 100644 index f048c2e715..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20446.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 223b5e8ac9f6461bb13ed365419ec485c5b2b002 Mon Sep 17 00:00:00 2001 -From: Michael Niedermayer -Date: Fri, 28 May 2021 20:18:25 +0200 -Subject: [PATCH] avcodec/aacpsy: Avoid floating point division by 0 of - norm_fac - -Fixes: Ticket7995 -Fixes: CVE-2020-20446 - -Signed-off-by: Michael Niedermayer - -CVE: CVE-2020-20446 -Upstream-Status: Backport [223b5e8ac9f6461bb13ed365419ec485c5b2b002] - -Signed-off-by: Tony Tascioglu ---- - libavcodec/aacpsy.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c -index 482113d427..e51d29750b 100644 ---- a/libavcodec/aacpsy.c -+++ b/libavcodec/aacpsy.c -@@ -794,7 +794,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel, - - if (pe < 1.15f * desired_pe) { - /* 6.6.1.3.6 "Final threshold modification by linearization" */ -- norm_fac = 1.0f / norm_fac; -+ norm_fac = norm_fac ? 1.0f / norm_fac : 0; - for (w = 0; w < wi->num_windows*16; w += 16) { - for (g = 0; g < num_bands; g++) { - AacPsyBand *band = &pch->band[w+g]; --- -2.32.0 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20453.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20453.patch deleted file mode 100644 index b1c94057a3..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-20453.patch +++ /dev/null @@ -1,42 +0,0 @@ -From a7a7f32c8ad0179a1a85d0a8cff35924e6d90be8 Mon Sep 17 00:00:00 2001 -From: Michael Niedermayer -Date: Fri, 28 May 2021 21:37:26 +0200 -Subject: [PATCH] avcodec/aacenc: Avoid 0 lambda - -Fixes: Ticket8003 -Fixes: CVE-2020-20453 - -Signed-off-by: Michael Niedermayer - -CVE: CVE-2020-20453 -Upstream-Status: Backport [a7a7f32c8ad0179a1a85d0a8cff35924e6d90be8] - -Signed-off-by: Tony Tascioglu ---- - libavcodec/aacenc.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c -index aa223cf25f..e80591ba86 100644 ---- a/libavcodec/aacenc.c -+++ b/libavcodec/aacenc.c -@@ -28,6 +28,7 @@ - * TODOs: - * add sane pulse detection - ***********************************/ -+#include - - #include "libavutil/libm.h" - #include "libavutil/float_dsp.h" -@@ -852,7 +853,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, - /* Not so fast though */ - ratio = sqrtf(ratio); - } -- s->lambda = FFMIN(s->lambda * ratio, 65536.f); -+ s->lambda = av_clipf(s->lambda * ratio, FLT_MIN, 65536.f); - - /* Keep iterating if we must reduce and lambda is in the sky */ - if (ratio > 0.9f && ratio < 1.1f) { --- -2.32.0 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22015.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22015.patch deleted file mode 100644 index 5c911299cb..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22015.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4c1afa292520329eecd1cc7631bc59a8cca95c46 Mon Sep 17 00:00:00 2001 -From: Michael Niedermayer -Date: Sat, 29 May 2021 09:22:27 +0200 -Subject: [PATCH] avformat/movenc: Check pal_size before use - -Fixes: assertion failure -Fixes: out of array read -Fixes: Ticket8190 -Fixes: CVE-2020-22015 - -Signed-off-by: Michael Niedermayer - - -CVE: CVE-2020-22015 -Upstream-Status: Backport [4c1afa292520329eecd1cc7631bc59a8cca95c46] - -Signed-off-by: Tony Tascioglu ---- - libavformat/movenc.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libavformat/movenc.c b/libavformat/movenc.c -index 2ab507df15..7d839f447b 100644 ---- a/libavformat/movenc.c -+++ b/libavformat/movenc.c -@@ -2160,11 +2160,13 @@ static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex - avio_wb16(pb, 0x18); /* Reserved */ - - if (track->mode == MODE_MOV && track->par->format == AV_PIX_FMT_PAL8) { -- int pal_size = 1 << track->par->bits_per_coded_sample; -- int i; -+ int pal_size, i; - avio_wb16(pb, 0); /* Color table ID */ - avio_wb32(pb, 0); /* Color table seed */ - avio_wb16(pb, 0x8000); /* Color table flags */ -+ if (track->par->bits_per_coded_sample < 0 || track->par->bits_per_coded_sample > 8) -+ return AVERROR(EINVAL); -+ pal_size = 1 << track->par->bits_per_coded_sample; - avio_wb16(pb, pal_size - 1); /* Color table size (zero-relative) */ - for (i = 0; i < pal_size; i++) { - uint32_t rgb = track->palette[i]; --- -2.32.0 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22021.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22021.patch deleted file mode 100644 index 6f7fce0e4c..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22021.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 7971f62120a55c141ec437aa3f0bacc1c1a3526b Mon Sep 17 00:00:00 2001 -From: Michael Niedermayer -Date: Sat, 29 May 2021 11:17:35 +0200 -Subject: [PATCH] avfilter/vf_yadif: Fix handing of tiny images - -Fixes: out of array access -Fixes: Ticket8240 -Fixes: CVE-2020-22021 - -Signed-off-by: Michael Niedermayer - -CVE: CVE-2020-22021 -Upstream-Status: Backport [7971f62120a55c141ec437aa3f0bacc1c1a3526b] - -Signed-off-by: Tony Tascioglu ---- - libavfilter/vf_yadif.c | 32 ++++++++++++++++++-------------- - 1 file changed, 18 insertions(+), 14 deletions(-) - -diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c -index 91cc79ecc3..b0d9fbaf1f 100644 ---- a/libavfilter/vf_yadif.c -+++ b/libavfilter/vf_yadif.c -@@ -123,20 +123,22 @@ static void filter_edges(void *dst1, void *prev1, void *cur1, void *next1, - uint8_t *next2 = parity ? cur : next; - - const int edge = MAX_ALIGN - 1; -+ int offset = FFMAX(w - edge, 3); - - /* Only edge pixels need to be processed here. A constant value of false - * for is_not_edge should let the compiler ignore the whole branch. */ -- FILTER(0, 3, 0) -+ FILTER(0, FFMIN(3, w), 0) - -- dst = (uint8_t*)dst1 + w - edge; -- prev = (uint8_t*)prev1 + w - edge; -- cur = (uint8_t*)cur1 + w - edge; -- next = (uint8_t*)next1 + w - edge; -+ dst = (uint8_t*)dst1 + offset; -+ prev = (uint8_t*)prev1 + offset; -+ cur = (uint8_t*)cur1 + offset; -+ next = (uint8_t*)next1 + offset; - prev2 = (uint8_t*)(parity ? prev : cur); - next2 = (uint8_t*)(parity ? cur : next); - -- FILTER(w - edge, w - 3, 1) -- FILTER(w - 3, w, 0) -+ FILTER(offset, w - 3, 1) -+ offset = FFMAX(offset, w - 3); -+ FILTER(offset, w, 0) - } - - -@@ -170,21 +172,23 @@ static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1, - uint16_t *next2 = parity ? cur : next; - - const int edge = MAX_ALIGN / 2 - 1; -+ int offset = FFMAX(w - edge, 3); - - mrefs /= 2; - prefs /= 2; - -- FILTER(0, 3, 0) -+ FILTER(0, FFMIN(3, w), 0) - -- dst = (uint16_t*)dst1 + w - edge; -- prev = (uint16_t*)prev1 + w - edge; -- cur = (uint16_t*)cur1 + w - edge; -- next = (uint16_t*)next1 + w - edge; -+ dst = (uint16_t*)dst1 + offset; -+ prev = (uint16_t*)prev1 + offset; -+ cur = (uint16_t*)cur1 + offset; -+ next = (uint16_t*)next1 + offset; - prev2 = (uint16_t*)(parity ? prev : cur); - next2 = (uint16_t*)(parity ? cur : next); - -- FILTER(w - edge, w - 3, 1) -- FILTER(w - 3, w, 0) -+ FILTER(offset, w - 3, 1) -+ offset = FFMAX(offset, w - 3); -+ FILTER(offset, w, 0) - } - - static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) --- -2.32.0 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22033-CVE-2020-22019.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22033-CVE-2020-22019.patch deleted file mode 100644 index 5d979ca3f2..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2020-22033-CVE-2020-22019.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 82ad1b76751bcfad5005440db48c46a4de5d6f02 Mon Sep 17 00:00:00 2001 -From: Michael Niedermayer -Date: Sat, 29 May 2021 09:58:31 +0200 -Subject: [PATCH] avfilter/vf_vmafmotion: Check dimensions - -Fixes: out of array access -Fixes: Ticket8241 -Fixes: Ticket8246 -Fixes: CVE-2020-22019 -Fixes: CVE-2020-22033 - -Signed-off-by: Michael Niedermayer - - -CVE: CVE-2020-22033 -CVE: CVE-2020-22019 -Upstream-Status: Backport [82ad1b76751bcfad5005440db48c46a4de5d6f02] - -Signed-off-by: Tony Tascioglu ---- - libavfilter/vf_vmafmotion.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c -index 2db4783d8d..454ebb8afa 100644 ---- a/libavfilter/vf_vmafmotion.c -+++ b/libavfilter/vf_vmafmotion.c -@@ -238,6 +238,9 @@ int ff_vmafmotion_init(VMAFMotionData *s, - int i; - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); - -+ if (w < 3 || h < 3) -+ return AVERROR(EINVAL); -+ - s->width = w; - s->height = h; - s->stride = FFALIGN(w * sizeof(uint16_t), 32); --- -2.32.0 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-33815.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-33815.patch deleted file mode 100644 index 51edb76389..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-33815.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777 Mon Sep 17 00:00:00 2001 -From: Michael Niedermayer -Date: Tue, 25 May 2021 19:29:18 +0200 -Subject: [PATCH] avcodec/exr: More strictly check dc_count -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes: out of array access -Fixes: exr/deneme - -Found-by: Burak Çarıkçı -Signed-off-by: Michael Niedermayer - - -CVE: CVE-2021-33815 -Upstream-Status: Backport [26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777] - -Signed-off-by: Tony Tascioglu ---- - libavcodec/exr.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libavcodec/exr.c b/libavcodec/exr.c -index 9377a89169..4648ed7d62 100644 ---- a/libavcodec/exr.c -+++ b/libavcodec/exr.c -@@ -1059,11 +1059,11 @@ static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size - bytestream2_skip(&gb, ac_size); - } - -- if (dc_size > 0) { -+ { - unsigned long dest_len = dc_count * 2LL; - GetByteContext agb = gb; - -- if (dc_count > (6LL * td->xsize * td->ysize + 63) / 64) -+ if (dc_count != dc_w * dc_h * 3) - return AVERROR_INVALIDDATA; - - av_fast_padded_malloc(&td->dc_data, &td->dc_size, FFALIGN(dest_len, 64) * 2); --- -2.32.0 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch deleted file mode 100644 index ab3ecfecbb..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38114.patch +++ /dev/null @@ -1,67 +0,0 @@ -CVE: CVE-2021-38114 -Upstream-Status: Backport -Signed-off-by: Kiran Surendran - -From 463dbe4e78cc560ca5b09f23a07add0eb78ccee8 Mon Sep 17 00:00:00 2001 -From: maryam ebr -Date: Tue, 3 Aug 2021 01:05:47 -0400 -Subject: [PATCH] avcodec/dnxhddec: check and propagate function return value - -Similar to CVE-2013-0868, here return value check for 'init_vlc' is needed. -crafted DNxHD data can cause unspecified impact. - -Reviewed-by: Paul B Mahol -Signed-off-by: James Almer ---- - libavcodec/dnxhddec.c | 22 +++++++++++++++------- - 1 file changed, 15 insertions(+), 7 deletions(-) - -diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c -index c78d55aee5..9b475a6979 100644 ---- a/libavcodec/dnxhddec.c -+++ b/libavcodec/dnxhddec.c -@@ -112,6 +112,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx) - - static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) - { -+ int ret; - if (cid != ctx->cid) { - const CIDEntry *cid_table = ff_dnxhd_get_cid_table(cid); - -@@ -132,19 +133,26 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); - -- init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, -+ if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, - ctx->cid_table->ac_bits, 1, 1, -- ctx->cid_table->ac_codes, 2, 2, 0); -- init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, -+ ctx->cid_table->ac_codes, 2, 2, 0)) < 0) -+ goto out; -+ if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, - ctx->cid_table->dc_bits, 1, 1, -- ctx->cid_table->dc_codes, 1, 1, 0); -- init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, -+ ctx->cid_table->dc_codes, 1, 1, 0)) < 0) -+ goto out; -+ if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, - ctx->cid_table->run_bits, 1, 1, -- ctx->cid_table->run_codes, 2, 2, 0); -+ ctx->cid_table->run_codes, 2, 2, 0)) < 0) -+ goto out; - - ctx->cid = cid; - } -- return 0; -+ ret = 0; -+out: -+ if (ret < 0) -+ av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n"); -+ return ret; - } - - static int dnxhd_get_profile(int cid) --- -2.31.1 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38171.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38171.patch deleted file mode 100644 index d82f3a4b63..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/fix-CVE-2021-38171.patch +++ /dev/null @@ -1,42 +0,0 @@ -CVE: CVE-2021-38171 -Upstream-Status: Backport -Signed-off-by: Kiran Surendran - -From fb993619d1035fa9646506925ea70fb122038999 Mon Sep 17 00:00:00 2001 -From: maryam ebrahimzadeh -Date: Wed, 4 Aug 2021 16:15:18 -0400 -Subject: [PATCH] avformat/adtsenc: return value check for init_get_bits in - adts_decode_extradata - -As the second argument for init_get_bits (buf) can be crafted, a return value check for this function call is necessary. -'buf' is part of 'AVPacket pkt'. -replace init_get_bits with init_get_bits8. - -Signed-off-by: Michael Niedermayer -(cherry picked from commit 9ffa49496d1aae4cbbb387aac28a9e061a6ab0a6) -Signed-off-by: Michael Niedermayer ---- - libavformat/adtsenc.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c -index 3595cb3bb2..c35a12a628 100644 ---- a/libavformat/adtsenc.c -+++ b/libavformat/adtsenc.c -@@ -51,9 +51,11 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui - GetBitContext gb; - PutBitContext pb; - MPEG4AudioConfig m4ac; -- int off; -+ int off, ret; - -- init_get_bits(&gb, buf, size * 8); -+ ret = init_get_bits8(&gb, buf, size); -+ if (ret < 0) -+ return ret; - off = avpriv_mpeg4audio_get_config2(&m4ac, buf, size, 1, s); - if (off < 0) - return off; --- -2.31.1 - diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb new file mode 100644 index 0000000000..685214a751 --- /dev/null +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb @@ -0,0 +1,180 @@ +SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video." +DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \ + mux, demux, stream, filter and play pretty much anything that humans and machines \ + have created. It supports the most obscure ancient formats up to the cutting edge." +HOMEPAGE = "https://www.ffmpeg.org/" +SECTION = "libs" + +LICENSE = "GPLv2+ & LGPLv2.1+ & ISC & MIT & BSD-2-Clause & BSD-3-Clause & IJG" +LICENSE:${PN} = "GPLv2+" +LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libpostproc = "GPLv2+" +LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE:libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" +LICENSE_FLAGS = "commercial" + +LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ + file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" + +SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ + file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \ + " +SRC_URI[sha256sum] = "eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02" + +# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +ARM_INSTRUCTION_SET:armv6 = "arm" + +# Should be API compatible with libav (which was a fork of ffmpeg) +# libpostproc was previously packaged from a separate recipe +PROVIDES = "libav libpostproc" + +DEPENDS = "nasm-native" + +inherit autotools pkgconfig + +PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \ + alsa bzlib lzma pic pthreads shared theora zlib \ + ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" + +# libraries to build in addition to avutil +PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice" +PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter" +PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec" +PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" +PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" +PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" +PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" +PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample" + +# features to support +PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" +PACKAGECONFIG[altivec] = "--enable-altivec,--disable-altivec," +PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2" +PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-aac,fdk-aac" +PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" +PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" +PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" +PACKAGECONFIG[libopus] = "--enable-libopus,--disable-libopus,libopus" +PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" +PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz" +PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk" +PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" +PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" +PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2" +PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" +PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt" +PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg" +PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" +PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" +PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" +PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" +PACKAGECONFIG[x265] = "--enable-libx265,--disable-libx265,x265" +PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb" +PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" +PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" + +# other configuration options +PACKAGECONFIG[mips32r2] = ",--disable-mipsdsp --disable-mipsdspr2" +PACKAGECONFIG[pic] = "--enable-pic" +PACKAGECONFIG[pthreads] = "--enable-pthreads,--disable-pthreads" +PACKAGECONFIG[shared] = "--enable-shared" +PACKAGECONFIG[strip] = ",--disable-stripping" + +# Check codecs that require --enable-nonfree +USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" + +def cpu(d): + for arg in (d.getVar('TUNE_CCARGS') or '').split(): + if arg.startswith('-mcpu='): + return arg[6:] + return 'generic' + +EXTRA_OECONF = " \ + ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \ + \ + --cross-prefix=${TARGET_PREFIX} \ + \ + --ld='${CCLD}' \ + --cc='${CC}' \ + --cxx='${CXX}' \ + --arch=${TARGET_ARCH} \ + --target-os='linux' \ + --enable-cross-compile \ + --extra-cflags='${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}' \ + --extra-ldflags='${LDFLAGS}' \ + --sysroot='${STAGING_DIR_TARGET}' \ + ${EXTRA_FFCONF} \ + --libdir=${libdir} \ + --shlibdir=${libdir} \ + --datadir=${datadir}/ffmpeg \ + --cpu=${@cpu(d)} \ + --pkg-config=pkg-config \ +" + +EXTRA_OECONF:append:linux-gnux32 = " --disable-asm" + +EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', '--disable-mips64r2 --disable-mips32r2', '', d)}" +EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r2', '--disable-mips64r6 --disable-mips32r6', '', d)}" +EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r2', '--disable-mips64r6 --disable-mips32r6', '', d)}" +EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r6', '--disable-mips64r2 --disable-mips32r2', '', d)}" +EXTRA_OECONF:append:mips = " --extra-libs=-latomic --disable-mips32r5 --disable-mipsdsp --disable-mipsdspr2 \ + --disable-loongson2 --disable-loongson3 --disable-mmi --disable-msa --disable-msa2" +EXTRA_OECONF:append:riscv32 = " --extra-libs=-latomic" +EXTRA_OECONF:append:armv5 = " --extra-libs=-latomic" + +# gold crashes on x86, another solution is to --disable-asm but thats more hacky +# ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684 + +LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" + +EXTRA_OEMAKE = "V=1" + +do_configure() { + ${S}/configure ${EXTRA_OECONF} +} + +# patch out build host paths for reproducibility +do_compile:prepend:class-target() { + sed -i -e "s,${WORKDIR},,g" ${B}/config.h +} + +PACKAGES =+ "libavcodec \ + libavdevice \ + libavfilter \ + libavformat \ + libavresample \ + libavutil \ + libpostproc \ + libswresample \ + libswscale" + +FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}" +FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}" +FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}" +FILES:libavformat = "${libdir}/libavformat${SOLIBS}" +FILES:libavresample = "${libdir}/libavresample${SOLIBS}" +FILES:libavutil = "${libdir}/libavutil${SOLIBS}" +FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}" +FILES:libswresample = "${libdir}/libswresample${SOLIBS}" +FILES:libswscale = "${libdir}/libswscale${SOLIBS}" + +# ffmpeg disables PIC on some platforms (e.g. x86-32) +INSANE_SKIP:${MLPREFIX}libavcodec = "textrel" +INSANE_SKIP:${MLPREFIX}libavdevice = "textrel" +INSANE_SKIP:${MLPREFIX}libavfilter = "textrel" +INSANE_SKIP:${MLPREFIX}libavformat = "textrel" +INSANE_SKIP:${MLPREFIX}libavutil = "textrel" +INSANE_SKIP:${MLPREFIX}libavresample = "textrel" +INSANE_SKIP:${MLPREFIX}libswscale = "textrel" +INSANE_SKIP:${MLPREFIX}libswresample = "textrel" +INSANE_SKIP:${MLPREFIX}libpostproc = "textrel" diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb deleted file mode 100644 index c0318ef01d..0000000000 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.bb +++ /dev/null @@ -1,188 +0,0 @@ -SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video." -DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \ - mux, demux, stream, filter and play pretty much anything that humans and machines \ - have created. It supports the most obscure ancient formats up to the cutting edge." -HOMEPAGE = "https://www.ffmpeg.org/" -SECTION = "libs" - -LICENSE = "GPLv2+ & LGPLv2.1+ & ISC & MIT & BSD-2-Clause & BSD-3-Clause & IJG" -LICENSE:${PN} = "GPLv2+" -LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libpostproc = "GPLv2+" -LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE:libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" -LICENSE_FLAGS = "commercial" - -LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ - file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ - file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" - -SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ - file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \ - file://fix-CVE-2020-20446.patch \ - file://fix-CVE-2020-20453.patch \ - file://fix-CVE-2020-22015.patch \ - file://fix-CVE-2020-22021.patch \ - file://fix-CVE-2020-22033-CVE-2020-22019.patch \ - file://fix-CVE-2021-33815.patch \ - file://fix-CVE-2021-38171.patch \ - file://fix-CVE-2021-38114.patch \ - " -SRC_URI[sha256sum] = "06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909" - -# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 -ARM_INSTRUCTION_SET:armv4 = "arm" -ARM_INSTRUCTION_SET:armv5 = "arm" -ARM_INSTRUCTION_SET:armv6 = "arm" - -# Should be API compatible with libav (which was a fork of ffmpeg) -# libpostproc was previously packaged from a separate recipe -PROVIDES = "libav libpostproc" - -DEPENDS = "nasm-native" - -inherit autotools pkgconfig - -PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \ - alsa bzlib lzma pic pthreads shared theora zlib \ - ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" - -# libraries to build in addition to avutil -PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice" -PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter" -PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec" -PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" -PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" -PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" -PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" -PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample" - -# features to support -PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" -PACKAGECONFIG[altivec] = "--enable-altivec,--disable-altivec," -PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2" -PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-aac,fdk-aac" -PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" -PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" -PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" -PACKAGECONFIG[libopus] = "--enable-libopus,--disable-libopus,libopus" -PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" -PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz" -PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk" -PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" -PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" -PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2" -PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" -PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt" -PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg" -PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" -PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" -PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" -PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" -PACKAGECONFIG[x265] = "--enable-libx265,--disable-libx265,x265" -PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb" -PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" -PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" - -# other configuration options -PACKAGECONFIG[mips32r2] = ",--disable-mipsdsp --disable-mipsdspr2" -PACKAGECONFIG[pic] = "--enable-pic" -PACKAGECONFIG[pthreads] = "--enable-pthreads,--disable-pthreads" -PACKAGECONFIG[shared] = "--enable-shared" -PACKAGECONFIG[strip] = ",--disable-stripping" - -# Check codecs that require --enable-nonfree -USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" - -def cpu(d): - for arg in (d.getVar('TUNE_CCARGS') or '').split(): - if arg.startswith('-mcpu='): - return arg[6:] - return 'generic' - -EXTRA_OECONF = " \ - ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \ - \ - --cross-prefix=${TARGET_PREFIX} \ - \ - --ld='${CCLD}' \ - --cc='${CC}' \ - --cxx='${CXX}' \ - --arch=${TARGET_ARCH} \ - --target-os='linux' \ - --enable-cross-compile \ - --extra-cflags='${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}' \ - --extra-ldflags='${LDFLAGS}' \ - --sysroot='${STAGING_DIR_TARGET}' \ - ${EXTRA_FFCONF} \ - --libdir=${libdir} \ - --shlibdir=${libdir} \ - --datadir=${datadir}/ffmpeg \ - --cpu=${@cpu(d)} \ - --pkg-config=pkg-config \ -" - -EXTRA_OECONF:append:linux-gnux32 = " --disable-asm" - -EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', '--disable-mips64r2 --disable-mips32r2', '', d)}" -EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r2', '--disable-mips64r6 --disable-mips32r6', '', d)}" -EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r2', '--disable-mips64r6 --disable-mips32r6', '', d)}" -EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'mips32r6', '--disable-mips64r2 --disable-mips32r2', '', d)}" -EXTRA_OECONF:append:mips = " --extra-libs=-latomic --disable-mips32r5 --disable-mipsdsp --disable-mipsdspr2 \ - --disable-loongson2 --disable-loongson3 --disable-mmi --disable-msa --disable-msa2" -EXTRA_OECONF:append:riscv32 = " --extra-libs=-latomic" -EXTRA_OECONF:append:armv5 = " --extra-libs=-latomic" - -# gold crashes on x86, another solution is to --disable-asm but thats more hacky -# ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684 - -LDFLAGS:append:x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" - -EXTRA_OEMAKE = "V=1" - -do_configure() { - ${S}/configure ${EXTRA_OECONF} -} - -# patch out build host paths for reproducibility -do_compile:prepend:class-target() { - sed -i -e "s,${WORKDIR},,g" ${B}/config.h -} - -PACKAGES =+ "libavcodec \ - libavdevice \ - libavfilter \ - libavformat \ - libavresample \ - libavutil \ - libpostproc \ - libswresample \ - libswscale" - -FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}" -FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}" -FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}" -FILES:libavformat = "${libdir}/libavformat${SOLIBS}" -FILES:libavresample = "${libdir}/libavresample${SOLIBS}" -FILES:libavutil = "${libdir}/libavutil${SOLIBS}" -FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}" -FILES:libswresample = "${libdir}/libswresample${SOLIBS}" -FILES:libswscale = "${libdir}/libswscale${SOLIBS}" - -# ffmpeg disables PIC on some platforms (e.g. x86-32) -INSANE_SKIP:${MLPREFIX}libavcodec = "textrel" -INSANE_SKIP:${MLPREFIX}libavdevice = "textrel" -INSANE_SKIP:${MLPREFIX}libavfilter = "textrel" -INSANE_SKIP:${MLPREFIX}libavformat = "textrel" -INSANE_SKIP:${MLPREFIX}libavutil = "textrel" -INSANE_SKIP:${MLPREFIX}libavresample = "textrel" -INSANE_SKIP:${MLPREFIX}libswscale = "textrel" -INSANE_SKIP:${MLPREFIX}libswresample = "textrel" -INSANE_SKIP:${MLPREFIX}libpostproc = "textrel" -- cgit 1.2.3-korg