summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer
diff options
context:
space:
mode:
authorClaus Stovgaard <claus.stovgaard@gmail.com>2022-10-22 14:59:34 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-10 14:39:24 +0000
commitc8002205ffe0d0c73221196f3470f40309a1243e (patch)
tree06538cd16498ec171cdf583ca53a230167955432 /meta/recipes-multimedia/gstreamer
parent1952d2934568b0007f38cd3cca86abcaf5a881ee (diff)
downloadpoky-c8002205ffe0d0c73221196f3470f40309a1243e.tar.gz
gstreamer1.0-libav: fix errors with ffmpeg 5.x
Backport of patch already present upstream to fix issues with invalid characters for GLIB when combining gstreamer1.0-libav with ffmpeg 5.x. Remove when gstreamer1.0-libav is upgraded to 1.21.1 or above (From OE-Core rev: d142cc8e6faf42c0a495c28c177061ffb9b1f793) Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 703ff945557ad307bbe4ba0b0b7f1a2e5b4b847e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/gstreamer')
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-libav-Fix-for-APNG-encoder-property-registration.patch86
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.20.3.bb4
2 files changed, 89 insertions, 1 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-libav-Fix-for-APNG-encoder-property-registration.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-libav-Fix-for-APNG-encoder-property-registration.patch
new file mode 100644
index 0000000000..526bbb0037
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-libav-Fix-for-APNG-encoder-property-registration.patch
@@ -0,0 +1,86 @@
1From 78a97c1ec35ada76d83fc67d0549ba56c74d8875 Mon Sep 17 00:00:00 2001
2From: Seungha Yang <seungha@centricular.com>
3Date: Thu, 7 Jul 2022 22:16:30 +0900
4Subject: [PATCH] libav: Fix for APNG encoder property registration
5
6The AVClass name of Animated PNG in FFmpeg 5.x is "(A)PNG"
7and it will be converted to "-a-png" through
8g_ascii_strdown() and g_strcanon(). But GLib disallow leading '-'
9character for a GType name. Strip leading '-' to workaround it.
10
11Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2724]
12
13Seungha Yangs patch was imported without modifications.
14
15Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com>
16---
17 ext/libav/gstavcfg.c | 29 +++++++++++++++++++++++------
18 1 file changed, 23 insertions(+), 6 deletions(-)
19
20diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
21index c736920..a8635a7 100644
22--- a/ext/libav/gstavcfg.c
23+++ b/ext/libav/gstavcfg.c
24@@ -91,10 +91,19 @@ register_enum (const AVClass ** obj, const AVOption * top_opt)
25 gchar *lower_obj_name = g_ascii_strdown ((*obj)->class_name, -1);
26 gchar *enum_name = g_strdup_printf ("%s-%s", lower_obj_name, top_opt->unit);
27 gboolean none_default = TRUE;
28+ const gchar *enum_name_strip;
29
30 g_strcanon (enum_name, G_CSET_a_2_z G_CSET_DIGITS, '-');
31
32- if ((res = g_type_from_name (enum_name)))
33+ /* strip leading '-'s */
34+ enum_name_strip = enum_name;
35+ while (enum_name_strip[0] == '-')
36+ enum_name_strip++;
37+
38+ if (enum_name_strip[0] == '\0')
39+ goto done;
40+
41+ if ((res = g_type_from_name (enum_name_strip)))
42 goto done;
43
44 while ((opt = av_opt_next (obj, opt))) {
45@@ -150,9 +159,8 @@ register_enum (const AVClass ** obj, const AVOption * top_opt)
46 }
47 }
48
49- res =
50- g_enum_register_static (enum_name, &g_array_index (values, GEnumValue,
51- 0));
52+ res = g_enum_register_static (enum_name_strip,
53+ &g_array_index (values, GEnumValue, 0));
54
55 gst_type_mark_as_plugin_api (res, 0);
56 }
57@@ -177,10 +185,19 @@ register_flags (const AVClass ** obj, const AVOption * top_opt)
58 GArray *values = g_array_new (TRUE, TRUE, sizeof (GEnumValue));
59 gchar *lower_obj_name = g_ascii_strdown ((*obj)->class_name, -1);
60 gchar *flags_name = g_strdup_printf ("%s-%s", lower_obj_name, top_opt->unit);
61+ const gchar *flags_name_strip;
62
63 g_strcanon (flags_name, G_CSET_a_2_z G_CSET_DIGITS, '-');
64
65- if ((res = g_type_from_name (flags_name)))
66+ /* strip leading '-'s */
67+ flags_name_strip = flags_name;
68+ while (flags_name_strip[0] == '-')
69+ flags_name_strip++;
70+
71+ if (flags_name_strip[0] == '\0')
72+ goto done;
73+
74+ if ((res = g_type_from_name (flags_name_strip)))
75 goto done;
76
77 while ((opt = av_opt_next (obj, opt))) {
78@@ -211,7 +228,7 @@ register_flags (const AVClass ** obj, const AVOption * top_opt)
79 g_array_sort (values, (GCompareFunc) cmp_flags_value);
80
81 res =
82- g_flags_register_static (flags_name, &g_array_index (values,
83+ g_flags_register_static (flags_name_strip, &g_array_index (values,
84 GFlagsValue, 0));
85
86 gst_type_mark_as_plugin_api (res, 0);
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.20.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.20.3.bb
index e8da49af99..7a2c0d1365 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.20.3.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.20.3.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://0001-libav-Fix-for-APNG-encoder-property-registration.patch \
16 "
15SRC_URI[sha256sum] = "3fedd10560fcdfaa1b6462cbf79a38c4e7b57d7f390359393fc0cef6dbf27dfe" 17SRC_URI[sha256sum] = "3fedd10560fcdfaa1b6462cbf79a38c4e7b57d7f390359393fc0cef6dbf27dfe"
16 18
17S = "${WORKDIR}/gst-libav-${PV}" 19S = "${WORKDIR}/gst-libav-${PV}"