summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia
diff options
context:
space:
mode:
authorDaniel Semkowicz <dse@thaumatec.com>2025-10-14 10:33:08 +0200
committerSteve Sakoman <steve@sakoman.com>2025-11-03 07:17:02 -0800
commit5ea0467919d30e4beeea782d374e5dc4edffa906 (patch)
treefb86cc800d950ecf56eae60ba7836dda1c28a682 /meta/recipes-multimedia
parent2a7d38f814b5f4f043e4baf7d3a2d643b85f689f (diff)
downloadpoky-5ea0467919d30e4beeea782d374e5dc4edffa906.tar.gz
gstreamer1.0-plugins-bad: fix buffer allocation fail for v4l2codecs
There is a bug in GStreamer 1.22 that prevents video playback when some of the v4l2codecs are paired with sinks that do not support GstVideoMeta. This is the case of the Qt 6.9 sink used by some of the Qt components. For example, when the v4l2codecs-vp8dec decoder is paired with QMediaPlayer, video playback fails to start with the following error: WARN videodecoder gstvideodecoder.c:4409:gst_video_decoder_negotiate_pool: Subclass failed to decide allocation ERROR videodecoder gstvideodecoder.c:4635:gst_video_decoder_allocate_output_buffer: Failed to allocate the buffer.. WARN videodecoder gstvideodecoder.c:4409:gst_video_decoder_negotiate_pool: Subclass failed to decide allocation WARN matroskademux matroska-demux.c:6131:gst_matroska_demux_loop: error: Internal data stream error. WARN matroskademux matroska-demux.c:6131:gst_matroska_demux_loop: error: streaming stopped, reason not-negotiated (-4) This problem is already fixed in GStreamer 1.24, so backport the fix. This fixes the buffer allocation failure for H.264, H.265, and VP8. CC: Steve Sakoman <steve@sakoman.com> CC: Anuj Mittal <anuj.mittal@intel.com> (From OE-Core rev: 1be0de000bb852f1acc9644c1cb702336d7fdd61) Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-multimedia')
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-v4l2codecs-Always-chain-up-to-parent-decide_allocati.patch87
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.12.bb1
2 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-v4l2codecs-Always-chain-up-to-parent-decide_allocati.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-v4l2codecs-Always-chain-up-to-parent-decide_allocati.patch
new file mode 100644
index 0000000000..8906b55082
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-v4l2codecs-Always-chain-up-to-parent-decide_allocati.patch
@@ -0,0 +1,87 @@
1From 4e96cc4df0b6807cb487368afca64e022078ed6a Mon Sep 17 00:00:00 2001
2From: James Cowgill <james.cowgill@blaize.com>
3Date: Sun, 14 May 2023 13:23:17 +0100
4Subject: [PATCH] v4l2codecs: Always chain up to parent decide_allocation
5 function
6
7The `gst_video_decoder_negotiate_pool` function expects the
8`decide_allocation` function to always provide a pool and will fail to
9negotiate if the pool is missing. If we return immediately (even if we
10don't need to do anything special) negotiation will fail if the
11downstream element does not propose a pool.
12
13Fix by chaining up to the default `decide_allocation` function which
14adds a fallback pool if one was not already proposed.
15
16Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4630>
17Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/70ff80a873d8202329df1731c06f1bfed464ad2a]
18Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
19---
20 sys/v4l2codecs/gstv4l2codech264dec.c | 3 ++-
21 sys/v4l2codecs/gstv4l2codech265dec.c | 3 ++-
22 sys/v4l2codecs/gstv4l2codecvp8dec.c | 3 ++-
23 3 files changed, 6 insertions(+), 3 deletions(-)
24
25diff --git a/sys/v4l2codecs/gstv4l2codech264dec.c b/sys/v4l2codecs/gstv4l2codech264dec.c
26index 1a6b144e9b..bd9041533b 100644
27--- a/sys/v4l2codecs/gstv4l2codech264dec.c
28+++ b/sys/v4l2codecs/gstv4l2codech264dec.c
29@@ -417,7 +417,7 @@ gst_v4l2_codec_h264_dec_decide_allocation (GstVideoDecoder * decoder,
30 /* If we are streaming here, then it means there is nothing allocation
31 * related in the new state and allocation can be ignored */
32 if (self->streaming)
33- return TRUE;
34+ goto no_internal_changes;
35
36 self->has_videometa = gst_query_find_allocation_meta (query,
37 GST_VIDEO_META_API_TYPE, NULL);
38@@ -452,6 +452,7 @@ gst_v4l2_codec_h264_dec_decide_allocation (GstVideoDecoder * decoder,
39
40 self->src_pool = gst_v4l2_codec_pool_new (self->src_allocator, &self->vinfo);
41
42+no_internal_changes:
43 /* Our buffer pool is internal, we will let the base class create a video
44 * pool, and use it if we are running out of buffers or if downstream does
45 * not support GstVideoMeta */
46diff --git a/sys/v4l2codecs/gstv4l2codech265dec.c b/sys/v4l2codecs/gstv4l2codech265dec.c
47index 8d70d05220..3f0c08d6a4 100644
48--- a/sys/v4l2codecs/gstv4l2codech265dec.c
49+++ b/sys/v4l2codecs/gstv4l2codech265dec.c
50@@ -446,7 +446,7 @@ gst_v4l2_codec_h265_dec_decide_allocation (GstVideoDecoder * decoder,
51 guint min = 0;
52
53 if (self->streaming)
54- return TRUE;
55+ goto no_internal_changes;
56
57 self->has_videometa = gst_query_find_allocation_meta (query,
58 GST_VIDEO_META_API_TYPE, NULL);
59@@ -465,6 +465,7 @@ gst_v4l2_codec_h265_dec_decide_allocation (GstVideoDecoder * decoder,
60 GST_PAD_SRC, self->min_pool_size + min + 1);
61 self->src_pool = gst_v4l2_codec_pool_new (self->src_allocator, &self->vinfo);
62
63+no_internal_changes:
64 /* Our buffer pool is internal, we will let the base class create a video
65 * pool, and use it if we are running out of buffers or if downstream does
66 * not support GstVideoMeta */
67diff --git a/sys/v4l2codecs/gstv4l2codecvp8dec.c b/sys/v4l2codecs/gstv4l2codecvp8dec.c
68index ba63a029df..bdea1fdf76 100644
69--- a/sys/v4l2codecs/gstv4l2codecvp8dec.c
70+++ b/sys/v4l2codecs/gstv4l2codecvp8dec.c
71@@ -284,7 +284,7 @@ gst_v4l2_codec_vp8_dec_decide_allocation (GstVideoDecoder * decoder,
72 guint num_bitstream;
73
74 if (self->streaming)
75- return TRUE;
76+ goto no_internal_changes;
77
78 self->has_videometa = gst_query_find_allocation_meta (query,
79 GST_VIDEO_META_API_TYPE, NULL);
80@@ -319,6 +319,7 @@ gst_v4l2_codec_vp8_dec_decide_allocation (GstVideoDecoder * decoder,
81
82 self->src_pool = gst_v4l2_codec_pool_new (self->src_allocator, &self->vinfo);
83
84+no_internal_changes:
85 /* Our buffer pool is internal, we will let the base class create a video
86 * pool, and use it if we are running out of buffers or if downstream does
87 * not support GstVideoMeta */
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.12.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.12.bb
index e4fa2a412f..f6d0711bd8 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.12.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.12.bb
@@ -9,6 +9,7 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad
9 file://0001-fix-maybe-uninitialized-warnings-when-compiling-with.patch \ 9 file://0001-fix-maybe-uninitialized-warnings-when-compiling-with.patch \
10 file://0002-avoid-including-sys-poll.h-directly.patch \ 10 file://0002-avoid-including-sys-poll.h-directly.patch \
11 file://0004-opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch \ 11 file://0004-opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch \
12 file://0005-v4l2codecs-Always-chain-up-to-parent-decide_allocati.patch \
12 file://CVE-2025-3887-1.patch \ 13 file://CVE-2025-3887-1.patch \
13 file://CVE-2025-3887-2.patch \ 14 file://CVE-2025-3887-2.patch \
14 " 15 "