summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-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
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/ffmpeg-6.0.patch49
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.22.0.bb4
6 files changed, 54 insertions, 238 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"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/ffmpeg-6.0.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/ffmpeg-6.0.patch
new file mode 100644
index 0000000000..0a06540fb4
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/ffmpeg-6.0.patch
@@ -0,0 +1,49 @@
1From cde31d23c071ee93fae96331805f696856084254 Mon Sep 17 00:00:00 2001
2From: "U. Artie Eoff" <ullysses.a.eoff@intel.com>
3Date: Mon, 13 Feb 2023 17:02:01 -0500
4Subject: [PATCH] avviddec: change
5 AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS
6
7This fixes a compile error with recent upstream FFmpeg.
8
9The AV_CODEC_CAP_AUTO_THREADS was deprecated and renamed to
10AV_CODEC_CAP_OTHER_THREADS in FFmpeg upstream commit
117d09579190de (lavc 58.132.100).
12
13The AV_CODEC_CAP_AUTO_THREADS was finally removed in FFmpeg upstream
14commit 10c9a0874cb3 (lavc 59.63.100).
15
16Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3964>
17
18Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/cde31d23c071ee93fae96331805f696856084254?merge_request_iid=3964]
19Signed-off-by: Alexander Kanavin <alex@linutronix.de>
20---
21 ext/libav/gstavviddec.c | 6 +++++-
22 1 file changed, 5 insertions(+), 1 deletion(-)
23
24diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
25index 43cea456ae8..6d7c4cd0de8 100644
26--- a/ext/libav/gstavviddec.c
27+++ b/ext/libav/gstavviddec.c
28@@ -35,6 +35,10 @@
29
30 GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
31
32+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100)
33+#define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS
34+#endif
35+
36 #define GST_FFMPEG_VIDEO_CODEC_FRAME_FLAG_ALLOCATED (1<<15)
37
38 #define MAX_TS_MASK 0xff
39@@ -615,7 +619,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
40 if (ffmpegdec->max_threads == 0) {
41 /* When thread type is FF_THREAD_FRAME, extra latency is introduced equal
42 * to one frame per thread. We thus need to calculate the thread count ourselves */
43- if ((!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS)) ||
44+ if ((!(oclass->in_plugin->capabilities & AV_CODEC_CAP_OTHER_THREADS)) ||
45 (ffmpegdec->context->thread_type & FF_THREAD_FRAME))
46 ffmpegdec->context->thread_count =
47 MIN (gst_ffmpeg_auto_max_threads (), 16);
48--
49GitLab
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.22.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.22.0.bb
index 625a52ea55..d1dce6739d 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.22.0.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.22.0.bb
@@ -11,7 +11,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=69333daa044cb77e486cc36129f7a770 \
11 file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \ 11 file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
12 " 12 "
13 13
14SRC_URI = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz" 14SRC_URI = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
15 file://ffmpeg-6.0.patch \
16 "
15SRC_URI[sha256sum] = "0e48407b4905227a260213dbda84cba3812f0530fc7a75b43829102ef82810f1" 17SRC_URI[sha256sum] = "0e48407b4905227a260213dbda84cba3812f0530fc7a75b43829102ef82810f1"
16 18
17S = "${WORKDIR}/gst-libav-${PV}" 19S = "${WORKDIR}/gst-libav-${PV}"