summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/ffmpeg
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-03-31 07:26:30 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-13 11:56:06 +0100
commit476c25f20089589880545e1fa51719d30bbc11d5 (patch)
treee0051f5f7139684050d58540a2f114214058d871 /meta/recipes-multimedia/ffmpeg
parentf79046d082f3a7752e6780b2990470dcd36cbba4 (diff)
downloadpoky-476c25f20089589880545e1fa51719d30bbc11d5.tar.gz
ffmpeg: update 5.1.2 -> 6.0
Add a patch to gstreamer1.0-libav to address an API compatibility fail. (From OE-Core rev: 2ebea6658458ca926af58b4904cecdbec7416e04) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg')
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-rpzaenc-stop-accessing-out-of-bounds-frame.patch89
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-smcenc-stop-accessing-out-of-bounds-frame.patch108
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg/ffmpeg-fix-vulkan.patch34
-rw-r--r--meta/recipes-multimedia/ffmpeg/ffmpeg_6.0.bb (renamed from meta/recipes-multimedia/ffmpeg/ffmpeg_5.1.2.bb)8
4 files changed, 2 insertions, 237 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-rpzaenc-stop-accessing-out-of-bounds-frame.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-rpzaenc-stop-accessing-out-of-bounds-frame.patch
deleted file mode 100644
index 2775a81cc8..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-rpzaenc-stop-accessing-out-of-bounds-frame.patch
+++ /dev/null
@@ -1,89 +0,0 @@
1From 92f9b28ed84a77138105475beba16c146bdaf984 Mon Sep 17 00:00:00 2001
2From: Paul B Mahol <onemda@gmail.com>
3Date: Sat, 12 Nov 2022 16:12:00 +0100
4Subject: [PATCH] avcodec/rpzaenc: stop accessing out of bounds frame
5
6Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/92f9b28ed84a77138105475beba16c146bdaf984]
7
8Signed-off-by: <narpat.mali@windriver.com>
9
10---
11 libavcodec/rpzaenc.c | 22 +++++++++++++++-------
12 1 file changed, 15 insertions(+), 7 deletions(-)
13
14diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c
15index d710eb4f82..4ced9523e2 100644
16--- a/libavcodec/rpzaenc.c
17+++ b/libavcodec/rpzaenc.c
18@@ -205,7 +205,7 @@ static void get_max_component_diff(const BlockInfo *bi, const uint16_t *block_pt
19
20 // loop thru and compare pixels
21 for (y = 0; y < bi->block_height; y++) {
22- for (x = 0; x < bi->block_width; x++){
23+ for (x = 0; x < bi->block_width; x++) {
24 // TODO: optimize
25 min_r = FFMIN(R(block_ptr[x]), min_r);
26 min_g = FFMIN(G(block_ptr[x]), min_g);
27@@ -278,7 +278,7 @@ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi,
28 return -1;
29
30 for (i = 0; i < bi->block_height; i++) {
31- for (j = 0; j < bi->block_width; j++){
32+ for (j = 0; j < bi->block_width; j++) {
33 x = GET_CHAN(block_ptr[j], xchannel);
34 y = GET_CHAN(block_ptr[j], ychannel);
35 sumx += x;
36@@ -325,7 +325,7 @@ static int calc_lsq_max_fit_error(const uint16_t *block_ptr, const BlockInfo *bi
37 int max_err = 0;
38
39 for (i = 0; i < bi->block_height; i++) {
40- for (j = 0; j < bi->block_width; j++){
41+ for (j = 0; j < bi->block_width; j++) {
42 int x_inc, lin_y, lin_x;
43 x = GET_CHAN(block_ptr[j], xchannel);
44 y = GET_CHAN(block_ptr[j], ychannel);
45@@ -420,7 +420,9 @@ static void update_block_in_prev_frame(const uint16_t *src_pixels,
46 uint16_t *dest_pixels,
47 const BlockInfo *bi, int block_counter)
48 {
49- for (int y = 0; y < 4; y++) {
50+ const int y_size = FFMIN(4, bi->image_height - bi->row * 4);
51+
52+ for (int y = 0; y < y_size; y++) {
53 memcpy(dest_pixels, src_pixels, 8);
54 dest_pixels += bi->rowstride;
55 src_pixels += bi->rowstride;
56@@ -730,14 +732,15 @@ post_skip :
57
58 if (err > s->sixteen_color_thresh) { // DO SIXTEEN COLOR BLOCK
59 uint16_t *row_ptr;
60- int rgb555;
61+ int y_size, rgb555;
62
63 block_offset = get_block_info(&bi, block_counter);
64
65 row_ptr = &src_pixels[block_offset];
66+ y_size = FFMIN(4, bi.image_height - bi.row * 4);
67
68- for (int y = 0; y < 4; y++) {
69- for (int x = 0; x < 4; x++){
70+ for (int y = 0; y < y_size; y++) {
71+ for (int x = 0; x < 4; x++) {
72 rgb555 = row_ptr[x] & ~0x8000;
73
74 put_bits(&s->pb, 16, rgb555);
75@@ -745,6 +748,11 @@ post_skip :
76 row_ptr += bi.rowstride;
77 }
78
79+ for (int y = y_size; y < 4; y++) {
80+ for (int x = 0; x < 4; x++)
81+ put_bits(&s->pb, 16, 0);
82+ }
83+
84 block_counter++;
85 } else { // FOUR COLOR BLOCK
86 block_counter += encode_four_color_block(min_color, max_color,
87--
882.34.1
89
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-smcenc-stop-accessing-out-of-bounds-frame.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-smcenc-stop-accessing-out-of-bounds-frame.patch
deleted file mode 100644
index 923fc6a9c1..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-avcodec-smcenc-stop-accessing-out-of-bounds-frame.patch
+++ /dev/null
@@ -1,108 +0,0 @@
1From 13c13109759090b7f7182480d075e13b36ed8edd Mon Sep 17 00:00:00 2001
2From: Paul B Mahol <onemda@gmail.com>
3Date: Sat, 12 Nov 2022 15:19:21 +0100
4Subject: [PATCH] avcodec/smcenc: stop accessing out of bounds frame
5
6Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/13c13109759090b7f7182480d075e13b36ed8edd]
7
8Signed-off-by: <narpat.mali@windriver.com>
9
10---
11 libavcodec/smcenc.c | 18 ++++++++++++++----
12 1 file changed, 14 insertions(+), 4 deletions(-)
13
14diff --git a/libavcodec/smcenc.c b/libavcodec/smcenc.c
15index f3d26a4e8d..33549b8ab4 100644
16--- a/libavcodec/smcenc.c
17+++ b/libavcodec/smcenc.c
18@@ -61,6 +61,7 @@ typedef struct SMCContext {
19 { \
20 row_ptr += stride * 4; \
21 pixel_ptr = row_ptr; \
22+ cur_y += 4; \
23 } \
24 } \
25 }
26@@ -117,6 +118,7 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
27 const uint8_t *prev_pixels = (const uint8_t *)s->prev_frame->data[0];
28 uint8_t *distinct_values = s->distinct_values;
29 const uint8_t *pixel_ptr, *row_ptr;
30+ const int height = frame->height;
31 const int width = frame->width;
32 uint8_t block_values[16];
33 int block_counter = 0;
34@@ -125,13 +127,14 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
35 int color_octet_index = 0;
36 int color_table_index; /* indexes to color pair, quad, or octet tables */
37 int total_blocks;
38+ int cur_y = 0;
39
40 memset(s->color_pairs, 0, sizeof(s->color_pairs));
41 memset(s->color_quads, 0, sizeof(s->color_quads));
42 memset(s->color_octets, 0, sizeof(s->color_octets));
43
44 /* Number of 4x4 blocks in frame. */
45- total_blocks = ((frame->width + 3) / 4) * ((frame->height + 3) / 4);
46+ total_blocks = ((width + 3) / 4) * ((height + 3) / 4);
47
48 pixel_ptr = row_ptr = src_pixels;
49
50@@ -145,11 +148,13 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
51 int cache_index;
52 int distinct = 0;
53 int blocks = 0;
54+ int frame_y = cur_y;
55
56 while (prev_pixels && s->key_frame == 0 && block_counter + inter_skip_blocks < total_blocks) {
57+ const int y_size = FFMIN(4, height - cur_y);
58 int compare = 0;
59
60- for (int y = 0; y < 4; y++) {
61+ for (int y = 0; y < y_size; y++) {
62 const ptrdiff_t offset = pixel_ptr - src_pixels;
63 const uint8_t *prev_pixel_ptr = prev_pixels + offset;
64
65@@ -170,8 +175,10 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
66
67 pixel_ptr = xpixel_ptr;
68 row_ptr = xrow_ptr;
69+ cur_y = frame_y;
70
71 while (block_counter > 0 && block_counter + intra_skip_blocks < total_blocks) {
72+ const int y_size = FFMIN(4, height - cur_y);
73 const ptrdiff_t offset = pixel_ptr - src_pixels;
74 const int sy = offset / stride;
75 const int sx = offset % stride;
76@@ -180,7 +187,7 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
77 const uint8_t *old_pixel_ptr = src_pixels + nx + ny * stride;
78 int compare = 0;
79
80- for (int y = 0; y < 4; y++) {
81+ for (int y = 0; y < y_size; y++) {
82 compare |= memcmp(old_pixel_ptr + y * stride, pixel_ptr + y * stride, 4);
83 if (compare)
84 break;
85@@ -197,9 +204,11 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
86
87 pixel_ptr = xpixel_ptr;
88 row_ptr = xrow_ptr;
89+ cur_y = frame_y;
90
91 while (block_counter + coded_blocks < total_blocks && coded_blocks < 256) {
92- for (int y = 0; y < 4; y++)
93+ const int y_size = FFMIN(4, height - cur_y);
94+ for (int y = 0; y < y_size; y++)
95 memcpy(block_values + y * 4, pixel_ptr + y * stride, 4);
96
97 qsort(block_values, 16, sizeof(block_values[0]), smc_cmp_values);
98@@ -224,6 +233,7 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
99
100 pixel_ptr = xpixel_ptr;
101 row_ptr = xrow_ptr;
102+ cur_y = frame_y;
103
104 blocks = coded_blocks;
105 distinct = coded_distinct;
106--
1072.34.1
108
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/ffmpeg-fix-vulkan.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/ffmpeg-fix-vulkan.patch
deleted file mode 100644
index 95bd608a27..0000000000
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg/ffmpeg-fix-vulkan.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From: Lynne <dev@lynne.ee>
2Date: Sun, 25 Dec 2022 00:03:30 +0000 (+0100)
3Subject: hwcontext_vulkan: remove optional encode/decode extensions from the list
4X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/eb0455d64690
5
6hwcontext_vulkan: remove optional encode/decode extensions from the list
7
8They're not currently used, so they don't need to be there.
9Vulkan stabilized the decode extensions less than a week ago, and their
10name prefixes were changed from EXT to KHR. It's a bit too soon to be
11depending on it, so rather than bumping, just remove these for now.
12
13Upstream-Status: Backport [https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/eb0455d64690]
14---
15
16diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
17index f1db1c7291..2a9b5f4aac 100644
18--- a/libavutil/hwcontext_vulkan.c
19+++ b/libavutil/hwcontext_vulkan.c
20@@ -358,14 +358,6 @@ static const VulkanOptExtension optional_device_exts[] = {
21 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY },
22 { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM },
23 #endif
24-
25- /* Video encoding/decoding */
26- { VK_KHR_VIDEO_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG },
27- { VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG },
28- { VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG },
29- { VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG },
30- { VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG },
31- { VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_NO_FLAG },
32 };
33
34 /* Converts return values to strings */
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_5.1.2.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_6.0.bb
index cccd9f65ab..e4a4a0effa 100644
--- a/meta/recipes-multimedia/ffmpeg/ffmpeg_5.1.2.bb
+++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_6.0.bb
@@ -22,13 +22,9 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
22 file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ 22 file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
23 file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" 23 file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
24 24
25SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ 25SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz"
26 file://0001-avcodec-rpzaenc-stop-accessing-out-of-bounds-frame.patch \
27 file://0001-avcodec-smcenc-stop-accessing-out-of-bounds-frame.patch \
28 file://ffmpeg-fix-vulkan.patch \
29 "
30 26
31SRC_URI[sha256sum] = "619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc" 27SRC_URI[sha256sum] = "57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082"
32 28
33# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 29# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
34ARM_INSTRUCTION_SET:armv4 = "arm" 30ARM_INSTRUCTION_SET:armv4 = "arm"