diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-01-19 11:41:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-20 11:57:29 +0000 |
commit | 5ecb96d56f698039bbc58519400ef5be0e2cbf22 (patch) | |
tree | 613a3fb8ea77f411c6db12bea8f57825a44d4b00 | |
parent | 725ceea724817c9eb77a7391499f0a0fe9e1fb43 (diff) | |
download | poky-5ecb96d56f698039bbc58519400ef5be0e2cbf22.tar.gz |
ffmpeg: upgrade 4.4.1 -> 5.0
libavresample has been removed; libswresample is the replacement.
(From OE-Core rev: 5555bca01750024a786a1f78d573d02f12b45686)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch | 21 | ||||
-rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.bb (renamed from meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb) | 9 | ||||
-rw-r--r-- | meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-gst-libav-fix-build-with-ffmpeg-5.0.0.patch | 346 | ||||
-rw-r--r-- | meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.18.5.bb | 4 |
4 files changed, 369 insertions, 11 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch index 2b4ca0e9b9..7d0a06f85b 100644 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg/0001-libavutil-include-assembly-with-full-path-from-sourc.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 24a58d70cbb3997e471366bd5afe54be9007bfb1 Mon Sep 17 00:00:00 2001 | 1 | From 4a891e1eddbf63f32fe769b5bff289f6748abf45 Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
3 | Date: Tue, 10 Nov 2020 15:32:14 +0000 | 3 | Date: Tue, 10 Nov 2020 15:32:14 +0000 |
4 | Subject: [PATCH] libavutil: include assembly with full path from source root | 4 | Subject: [PATCH] libavutil: include assembly with full path from source root |
@@ -6,8 +6,9 @@ Subject: [PATCH] libavutil: include assembly with full path from source root | |||
6 | Otherwise nasm writes the full host-specific paths into .o | 6 | Otherwise nasm writes the full host-specific paths into .o |
7 | output, which breaks binary reproducibility. | 7 | output, which breaks binary reproducibility. |
8 | 8 | ||
9 | Upstream-Status: Submitted [by email to jamrial@gmail.com,ffmpeg-devel@ffmpeg.org] | 9 | Upstream-Status: Submitted [http://ffmpeg.org/pipermail/ffmpeg-devel/2022-January/291781.html] |
10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | 10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
11 | |||
11 | --- | 12 | --- |
12 | libavutil/x86/cpuid.asm | 2 +- | 13 | libavutil/x86/cpuid.asm | 2 +- |
13 | libavutil/x86/emms.asm | 2 +- | 14 | libavutil/x86/emms.asm | 2 +- |
@@ -15,7 +16,8 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | |||
15 | libavutil/x86/float_dsp.asm | 2 +- | 16 | libavutil/x86/float_dsp.asm | 2 +- |
16 | libavutil/x86/lls.asm | 2 +- | 17 | libavutil/x86/lls.asm | 2 +- |
17 | libavutil/x86/pixelutils.asm | 2 +- | 18 | libavutil/x86/pixelutils.asm | 2 +- |
18 | 6 files changed, 6 insertions(+), 6 deletions(-) | 19 | libavutil/x86/tx_float.asm | 2 +- |
20 | 7 files changed, 7 insertions(+), 7 deletions(-) | ||
19 | 21 | ||
20 | diff --git a/libavutil/x86/cpuid.asm b/libavutil/x86/cpuid.asm | 22 | diff --git a/libavutil/x86/cpuid.asm b/libavutil/x86/cpuid.asm |
21 | index c3f7866..766f77f 100644 | 23 | index c3f7866..766f77f 100644 |
@@ -95,3 +97,16 @@ index 36c57c5..8b45ead 100644 | |||
95 | 97 | ||
96 | SECTION .text | 98 | SECTION .text |
97 | 99 | ||
100 | diff --git a/libavutil/x86/tx_float.asm b/libavutil/x86/tx_float.asm | ||
101 | index 4d2283f..ea39f21 100644 | ||
102 | --- a/libavutil/x86/tx_float.asm | ||
103 | +++ b/libavutil/x86/tx_float.asm | ||
104 | @@ -29,7 +29,7 @@ | ||
105 | ; replace some shuffles with vblends? | ||
106 | ; avx512 split-radix | ||
107 | |||
108 | -%include "x86util.asm" | ||
109 | +%include "libavutil/x86/x86util.asm" | ||
110 | |||
111 | %if ARCH_X86_64 | ||
112 | %define ptr resq | ||
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.bb index 3ba07c31d6..4ba5ff4537 100644 --- a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.4.1.bb +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_5.0.bb | |||
@@ -11,7 +11,6 @@ LICENSE:libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LG | |||
11 | LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | 11 | LICENSE:libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" |
12 | LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | 12 | LICENSE:libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" |
13 | LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | 13 | LICENSE:libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" |
14 | LICENSE:libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
15 | LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | 14 | LICENSE:libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" |
16 | LICENSE:libpostproc = "GPLv2+" | 15 | LICENSE:libpostproc = "GPLv2+" |
17 | LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | 16 | LICENSE:libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" |
@@ -26,7 +25,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | |||
26 | SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ | 25 | SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ |
27 | file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \ | 26 | file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \ |
28 | " | 27 | " |
29 | SRC_URI[sha256sum] = "eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02" | 28 | SRC_URI[sha256sum] = "51e919f7d205062c0fd4fae6243a84850391115104ccf1efc451733bc0ac7298" |
30 | 29 | ||
31 | # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 | 30 | # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 |
32 | ARM_INSTRUCTION_SET:armv4 = "arm" | 31 | ARM_INSTRUCTION_SET:armv4 = "arm" |
@@ -41,7 +40,7 @@ DEPENDS = "nasm-native" | |||
41 | 40 | ||
42 | inherit autotools pkgconfig | 41 | inherit autotools pkgconfig |
43 | 42 | ||
44 | PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \ | 43 | PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \ |
45 | alsa bzlib lzma pic pthreads shared theora zlib \ | 44 | alsa bzlib lzma pic pthreads shared theora zlib \ |
46 | ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \ | 45 | ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \ |
47 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" | 46 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" |
@@ -54,7 +53,6 @@ PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" | |||
54 | PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" | 53 | PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" |
55 | PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" | 54 | PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" |
56 | PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" | 55 | PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" |
57 | PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample" | ||
58 | 56 | ||
59 | # features to support | 57 | # features to support |
60 | PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" | 58 | PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" |
@@ -153,7 +151,6 @@ PACKAGES =+ "libavcodec \ | |||
153 | libavdevice \ | 151 | libavdevice \ |
154 | libavfilter \ | 152 | libavfilter \ |
155 | libavformat \ | 153 | libavformat \ |
156 | libavresample \ | ||
157 | libavutil \ | 154 | libavutil \ |
158 | libpostproc \ | 155 | libpostproc \ |
159 | libswresample \ | 156 | libswresample \ |
@@ -163,7 +160,6 @@ FILES:libavcodec = "${libdir}/libavcodec${SOLIBS}" | |||
163 | FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}" | 160 | FILES:libavdevice = "${libdir}/libavdevice${SOLIBS}" |
164 | FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}" | 161 | FILES:libavfilter = "${libdir}/libavfilter${SOLIBS}" |
165 | FILES:libavformat = "${libdir}/libavformat${SOLIBS}" | 162 | FILES:libavformat = "${libdir}/libavformat${SOLIBS}" |
166 | FILES:libavresample = "${libdir}/libavresample${SOLIBS}" | ||
167 | FILES:libavutil = "${libdir}/libavutil${SOLIBS}" | 163 | FILES:libavutil = "${libdir}/libavutil${SOLIBS}" |
168 | FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}" | 164 | FILES:libpostproc = "${libdir}/libpostproc${SOLIBS}" |
169 | FILES:libswresample = "${libdir}/libswresample${SOLIBS}" | 165 | FILES:libswresample = "${libdir}/libswresample${SOLIBS}" |
@@ -175,7 +171,6 @@ INSANE_SKIP:${MLPREFIX}libavdevice = "textrel" | |||
175 | INSANE_SKIP:${MLPREFIX}libavfilter = "textrel" | 171 | INSANE_SKIP:${MLPREFIX}libavfilter = "textrel" |
176 | INSANE_SKIP:${MLPREFIX}libavformat = "textrel" | 172 | INSANE_SKIP:${MLPREFIX}libavformat = "textrel" |
177 | INSANE_SKIP:${MLPREFIX}libavutil = "textrel" | 173 | INSANE_SKIP:${MLPREFIX}libavutil = "textrel" |
178 | INSANE_SKIP:${MLPREFIX}libavresample = "textrel" | ||
179 | INSANE_SKIP:${MLPREFIX}libswscale = "textrel" | 174 | INSANE_SKIP:${MLPREFIX}libswscale = "textrel" |
180 | INSANE_SKIP:${MLPREFIX}libswresample = "textrel" | 175 | INSANE_SKIP:${MLPREFIX}libswresample = "textrel" |
181 | INSANE_SKIP:${MLPREFIX}libpostproc = "textrel" | 176 | INSANE_SKIP:${MLPREFIX}libpostproc = "textrel" |
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-gst-libav-fix-build-with-ffmpeg-5.0.0.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-gst-libav-fix-build-with-ffmpeg-5.0.0.patch new file mode 100644 index 0000000000..022ff9af29 --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-gst-libav-fix-build-with-ffmpeg-5.0.0.patch | |||
@@ -0,0 +1,346 @@ | |||
1 | From 38d10ee800e42afeacc6bee714216e4c974c11f5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xi Ruoyao <xry111@mengyan1223.wang> | ||
3 | Date: Mon, 17 Jan 2022 01:33:47 +0800 | ||
4 | Subject: [PATCH] gst-libav: fix build with ffmpeg-5.0.0 | ||
5 | |||
6 | Latest ffmpeg has removed avcodec_get_context_defaults(), and its | ||
7 | documentation says a new AVCodecContext should be allocated for this | ||
8 | purpose. The pointer returned by avcodec_find_decoder() is now | ||
9 | const-qualified so we also need to adjust for it. And, AVCOL_RANGE_MPEG | ||
10 | is now rejected with strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL. | ||
11 | |||
12 | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1531> | ||
13 | Upstream-Status: Backport | ||
14 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
15 | --- | ||
16 | ext/libav/gstavauddec.c | 22 ++++++++------------- | ||
17 | ext/libav/gstavaudenc.c | 40 +++++++++++++++++++-------------------- | ||
18 | ext/libav/gstavcodecmap.c | 7 ++++--- | ||
19 | ext/libav/gstavutils.c | 2 +- | ||
20 | ext/libav/gstavviddec.c | 28 +++++++++++---------------- | ||
21 | ext/libav/gstavvidenc.c | 21 ++++++++++---------- | ||
22 | 6 files changed, 54 insertions(+), 66 deletions(-) | ||
23 | |||
24 | diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c | ||
25 | index baf7aa5..b03a724 100644 | ||
26 | --- a/ext/libav/gstavauddec.c | ||
27 | +++ b/ext/libav/gstavauddec.c | ||
28 | @@ -168,12 +168,7 @@ gst_ffmpegauddec_finalize (GObject * object) | ||
29 | GstFFMpegAudDec *ffmpegdec = (GstFFMpegAudDec *) object; | ||
30 | |||
31 | av_frame_free (&ffmpegdec->frame); | ||
32 | - | ||
33 | - if (ffmpegdec->context != NULL) { | ||
34 | - gst_ffmpeg_avcodec_close (ffmpegdec->context); | ||
35 | - av_free (ffmpegdec->context); | ||
36 | - ffmpegdec->context = NULL; | ||
37 | - } | ||
38 | + avcodec_free_context (&ffmpegdec->context); | ||
39 | |||
40 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
41 | } | ||
42 | @@ -193,14 +188,12 @@ gst_ffmpegauddec_close (GstFFMpegAudDec * ffmpegdec, gboolean reset) | ||
43 | gst_ffmpeg_avcodec_close (ffmpegdec->context); | ||
44 | ffmpegdec->opened = FALSE; | ||
45 | |||
46 | - if (ffmpegdec->context->extradata) { | ||
47 | - av_free (ffmpegdec->context->extradata); | ||
48 | - ffmpegdec->context->extradata = NULL; | ||
49 | - } | ||
50 | + av_freep (&ffmpegdec->context->extradata); | ||
51 | |||
52 | if (reset) { | ||
53 | - if (avcodec_get_context_defaults3 (ffmpegdec->context, | ||
54 | - oclass->in_plugin) < 0) { | ||
55 | + avcodec_free_context (&ffmpegdec->context); | ||
56 | + ffmpegdec->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
57 | + if (ffmpegdec->context == NULL) { | ||
58 | GST_DEBUG_OBJECT (ffmpegdec, "Failed to set context defaults"); | ||
59 | return FALSE; | ||
60 | } | ||
61 | @@ -219,8 +212,9 @@ gst_ffmpegauddec_start (GstAudioDecoder * decoder) | ||
62 | oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); | ||
63 | |||
64 | GST_OBJECT_LOCK (ffmpegdec); | ||
65 | - gst_ffmpeg_avcodec_close (ffmpegdec->context); | ||
66 | - if (avcodec_get_context_defaults3 (ffmpegdec->context, oclass->in_plugin) < 0) { | ||
67 | + avcodec_free_context (&ffmpegdec->context); | ||
68 | + ffmpegdec->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
69 | + if (ffmpegdec->context == NULL) { | ||
70 | GST_DEBUG_OBJECT (ffmpegdec, "Failed to set context defaults"); | ||
71 | GST_OBJECT_UNLOCK (ffmpegdec); | ||
72 | return FALSE; | ||
73 | diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c | ||
74 | index 3ff6432..689982f 100644 | ||
75 | --- a/ext/libav/gstavaudenc.c | ||
76 | +++ b/ext/libav/gstavaudenc.c | ||
77 | @@ -175,10 +175,8 @@ gst_ffmpegaudenc_finalize (GObject * object) | ||
78 | |||
79 | /* clean up remaining allocated data */ | ||
80 | av_frame_free (&ffmpegaudenc->frame); | ||
81 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->context); | ||
82 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->refcontext); | ||
83 | - av_free (ffmpegaudenc->context); | ||
84 | - av_free (ffmpegaudenc->refcontext); | ||
85 | + avcodec_free_context (&ffmpegaudenc->context); | ||
86 | + avcodec_free_context (&ffmpegaudenc->refcontext); | ||
87 | |||
88 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
89 | } | ||
90 | @@ -193,9 +191,9 @@ gst_ffmpegaudenc_start (GstAudioEncoder * encoder) | ||
91 | ffmpegaudenc->opened = FALSE; | ||
92 | ffmpegaudenc->need_reopen = FALSE; | ||
93 | |||
94 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->context); | ||
95 | - if (avcodec_get_context_defaults3 (ffmpegaudenc->context, | ||
96 | - oclass->in_plugin) < 0) { | ||
97 | + avcodec_free_context (&ffmpegaudenc->context); | ||
98 | + ffmpegaudenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
99 | + if (ffmpegaudenc->context == NULL) { | ||
100 | GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults"); | ||
101 | return FALSE; | ||
102 | } | ||
103 | @@ -241,10 +239,10 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) | ||
104 | |||
105 | /* close old session */ | ||
106 | if (ffmpegaudenc->opened) { | ||
107 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->context); | ||
108 | + avcodec_free_context (&ffmpegaudenc->context); | ||
109 | ffmpegaudenc->opened = FALSE; | ||
110 | - if (avcodec_get_context_defaults3 (ffmpegaudenc->context, | ||
111 | - oclass->in_plugin) < 0) { | ||
112 | + ffmpegaudenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
113 | + if (ffmpegaudenc->context == NULL) { | ||
114 | GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults"); | ||
115 | return FALSE; | ||
116 | } | ||
117 | @@ -286,11 +284,11 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) | ||
118 | /* open codec */ | ||
119 | if (gst_ffmpeg_avcodec_open (ffmpegaudenc->context, oclass->in_plugin) < 0) { | ||
120 | gst_caps_unref (allowed_caps); | ||
121 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->context); | ||
122 | + avcodec_free_context (&ffmpegaudenc->context); | ||
123 | GST_DEBUG_OBJECT (ffmpegaudenc, "avenc_%s: Failed to open FFMPEG codec", | ||
124 | oclass->in_plugin->name); | ||
125 | - if (avcodec_get_context_defaults3 (ffmpegaudenc->context, | ||
126 | - oclass->in_plugin) < 0) | ||
127 | + ffmpegaudenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
128 | + if (ffmpegaudenc->context == NULL) | ||
129 | GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults"); | ||
130 | |||
131 | if ((oclass->in_plugin->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && | ||
132 | @@ -312,10 +310,10 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) | ||
133 | |||
134 | if (!other_caps) { | ||
135 | gst_caps_unref (allowed_caps); | ||
136 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->context); | ||
137 | + avcodec_free_context (&ffmpegaudenc->context); | ||
138 | GST_DEBUG ("Unsupported codec - no caps found"); | ||
139 | - if (avcodec_get_context_defaults3 (ffmpegaudenc->context, | ||
140 | - oclass->in_plugin) < 0) | ||
141 | + ffmpegaudenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
142 | + if (ffmpegaudenc->context == NULL) | ||
143 | GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults"); | ||
144 | return FALSE; | ||
145 | } | ||
146 | @@ -331,10 +329,10 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) | ||
147 | |||
148 | if (!gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (ffmpegaudenc), | ||
149 | icaps)) { | ||
150 | - gst_ffmpeg_avcodec_close (ffmpegaudenc->context); | ||
151 | + avcodec_free_context (&ffmpegaudenc->context); | ||
152 | gst_caps_unref (icaps); | ||
153 | - if (avcodec_get_context_defaults3 (ffmpegaudenc->context, | ||
154 | - oclass->in_plugin) < 0) | ||
155 | + ffmpegaudenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
156 | + if (ffmpegaudenc->context == NULL) | ||
157 | GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults"); | ||
158 | return FALSE; | ||
159 | } | ||
160 | @@ -403,8 +401,8 @@ buffer_info_free (void *opaque, guint8 * data) | ||
161 | gst_buffer_unmap (info->buffer, &info->map); | ||
162 | gst_buffer_unref (info->buffer); | ||
163 | } else { | ||
164 | - av_free (info->ext_data); | ||
165 | - av_free (info->ext_data_array); | ||
166 | + av_freep (&info->ext_data); | ||
167 | + av_freep (&info->ext_data_array); | ||
168 | } | ||
169 | g_slice_free (BufferInfo, info); | ||
170 | } | ||
171 | diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c | ||
172 | index f58633d..e2a3641 100644 | ||
173 | --- a/ext/libav/gstavcodecmap.c | ||
174 | +++ b/ext/libav/gstavcodecmap.c | ||
175 | @@ -2331,7 +2331,7 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, | ||
176 | } | ||
177 | |||
178 | if (buildcaps) { | ||
179 | - AVCodec *codec; | ||
180 | + const AVCodec *codec; | ||
181 | |||
182 | if ((codec = avcodec_find_decoder (codec_id)) || | ||
183 | (codec = avcodec_find_encoder (codec_id))) { | ||
184 | @@ -2975,6 +2975,7 @@ gst_ffmpeg_videoinfo_to_context (GstVideoInfo * info, AVCodecContext * context) | ||
185 | context->color_range = AVCOL_RANGE_JPEG; | ||
186 | } else { | ||
187 | context->color_range = AVCOL_RANGE_MPEG; | ||
188 | + context->strict_std_compliance = FF_COMPLIANCE_UNOFFICIAL; | ||
189 | } | ||
190 | } | ||
191 | |||
192 | @@ -4330,7 +4331,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) | ||
193 | audio = TRUE; | ||
194 | } else if (!strncmp (mimetype, "audio/x-gst-av-", 15)) { | ||
195 | gchar ext[16]; | ||
196 | - AVCodec *codec; | ||
197 | + const AVCodec *codec; | ||
198 | |||
199 | if (strlen (mimetype) <= 30 && | ||
200 | sscanf (mimetype, "audio/x-gst-av-%s", ext) == 1) { | ||
201 | @@ -4342,7 +4343,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) | ||
202 | } | ||
203 | } else if (!strncmp (mimetype, "video/x-gst-av-", 15)) { | ||
204 | gchar ext[16]; | ||
205 | - AVCodec *codec; | ||
206 | + const AVCodec *codec; | ||
207 | |||
208 | if (strlen (mimetype) <= 30 && | ||
209 | sscanf (mimetype, "video/x-gst-av-%s", ext) == 1) { | ||
210 | diff --git a/ext/libav/gstavutils.c b/ext/libav/gstavutils.c | ||
211 | index 3780cff..f3878c3 100644 | ||
212 | --- a/ext/libav/gstavutils.c | ||
213 | +++ b/ext/libav/gstavutils.c | ||
214 | @@ -36,7 +36,7 @@ | ||
215 | const gchar * | ||
216 | gst_ffmpeg_get_codecid_longname (enum AVCodecID codec_id) | ||
217 | { | ||
218 | - AVCodec *codec; | ||
219 | + const AVCodec *codec; | ||
220 | /* Let's use what ffmpeg can provide us */ | ||
221 | |||
222 | if ((codec = avcodec_find_decoder (codec_id)) || | ||
223 | diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c | ||
224 | index 7ec5766..5dd207e 100644 | ||
225 | --- a/ext/libav/gstavviddec.c | ||
226 | +++ b/ext/libav/gstavviddec.c | ||
227 | @@ -320,12 +320,7 @@ gst_ffmpegviddec_finalize (GObject * object) | ||
228 | GstFFMpegVidDec *ffmpegdec = (GstFFMpegVidDec *) object; | ||
229 | |||
230 | av_frame_free (&ffmpegdec->picture); | ||
231 | - | ||
232 | - if (ffmpegdec->context != NULL) { | ||
233 | - gst_ffmpeg_avcodec_close (ffmpegdec->context); | ||
234 | - av_free (ffmpegdec->context); | ||
235 | - ffmpegdec->context = NULL; | ||
236 | - } | ||
237 | + avcodec_free_context (&ffmpegdec->context); | ||
238 | |||
239 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
240 | } | ||
241 | @@ -363,13 +358,11 @@ gst_ffmpegviddec_close (GstFFMpegVidDec * ffmpegdec, gboolean reset) | ||
242 | |||
243 | gst_buffer_replace (&ffmpegdec->palette, NULL); | ||
244 | |||
245 | - if (ffmpegdec->context->extradata) { | ||
246 | - av_free (ffmpegdec->context->extradata); | ||
247 | - ffmpegdec->context->extradata = NULL; | ||
248 | - } | ||
249 | + av_freep (&ffmpegdec->context->extradata); | ||
250 | if (reset) { | ||
251 | - if (avcodec_get_context_defaults3 (ffmpegdec->context, | ||
252 | - oclass->in_plugin) < 0) { | ||
253 | + avcodec_free_context (&ffmpegdec->context); | ||
254 | + ffmpegdec->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
255 | + if (ffmpegdec->context == NULL) { | ||
256 | GST_DEBUG_OBJECT (ffmpegdec, "Failed to set context defaults"); | ||
257 | return FALSE; | ||
258 | } | ||
259 | @@ -1704,7 +1697,7 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, | ||
260 | if (side_data) { | ||
261 | GST_LOG_OBJECT (ffmpegdec, | ||
262 | "Found CC side data of type AV_FRAME_DATA_A53_CC, size %d", | ||
263 | - side_data->size); | ||
264 | + (int) side_data->size); | ||
265 | GST_MEMDUMP ("A53 CC", side_data->data, side_data->size); | ||
266 | |||
267 | /* do not add closed caption meta if it already exists */ | ||
268 | @@ -1966,8 +1959,9 @@ gst_ffmpegviddec_start (GstVideoDecoder * decoder) | ||
269 | oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); | ||
270 | |||
271 | GST_OBJECT_LOCK (ffmpegdec); | ||
272 | - gst_ffmpeg_avcodec_close (ffmpegdec->context); | ||
273 | - if (avcodec_get_context_defaults3 (ffmpegdec->context, oclass->in_plugin) < 0) { | ||
274 | + avcodec_free_context (&ffmpegdec->context); | ||
275 | + ffmpegdec->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
276 | + if (ffmpegdec->context == NULL) { | ||
277 | GST_DEBUG_OBJECT (ffmpegdec, "Failed to set context defaults"); | ||
278 | GST_OBJECT_UNLOCK (ffmpegdec); | ||
279 | return FALSE; | ||
280 | @@ -2261,10 +2255,10 @@ gst_ffmpegviddec_get_property (GObject * object, | ||
281 | |||
282 | switch (prop_id) { | ||
283 | case PROP_LOWRES: | ||
284 | - g_value_set_enum (value, ffmpegdec->context->lowres); | ||
285 | + g_value_set_enum (value, ffmpegdec->lowres); | ||
286 | break; | ||
287 | case PROP_SKIPFRAME: | ||
288 | - g_value_set_enum (value, ffmpegdec->context->skip_frame); | ||
289 | + g_value_set_enum (value, ffmpegdec->skip_frame); | ||
290 | break; | ||
291 | case PROP_DIRECT_RENDERING: | ||
292 | g_value_set_boolean (value, ffmpegdec->direct_rendering); | ||
293 | diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c | ||
294 | index 0468d88..2ed9e5a 100644 | ||
295 | --- a/ext/libav/gstavvidenc.c | ||
296 | +++ b/ext/libav/gstavvidenc.c | ||
297 | @@ -224,8 +224,8 @@ gst_ffmpegvidenc_finalize (GObject * object) | ||
298 | av_frame_free (&ffmpegenc->picture); | ||
299 | gst_ffmpeg_avcodec_close (ffmpegenc->context); | ||
300 | gst_ffmpeg_avcodec_close (ffmpegenc->refcontext); | ||
301 | - av_free (ffmpegenc->context); | ||
302 | - av_free (ffmpegenc->refcontext); | ||
303 | + av_freep (&ffmpegenc->context); | ||
304 | + av_freep (&ffmpegenc->refcontext); | ||
305 | |||
306 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
307 | } | ||
308 | @@ -247,10 +247,10 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder, | ||
309 | |||
310 | /* close old session */ | ||
311 | if (ffmpegenc->opened) { | ||
312 | - gst_ffmpeg_avcodec_close (ffmpegenc->context); | ||
313 | + avcodec_free_context (&ffmpegenc->context); | ||
314 | ffmpegenc->opened = FALSE; | ||
315 | - if (avcodec_get_context_defaults3 (ffmpegenc->context, | ||
316 | - oclass->in_plugin) < 0) { | ||
317 | + ffmpegenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
318 | + if (ffmpegenc->context == NULL) { | ||
319 | GST_DEBUG_OBJECT (ffmpegenc, "Failed to set context defaults"); | ||
320 | return FALSE; | ||
321 | } | ||
322 | @@ -454,9 +454,9 @@ bad_input_fmt: | ||
323 | } | ||
324 | close_codec: | ||
325 | { | ||
326 | - gst_ffmpeg_avcodec_close (ffmpegenc->context); | ||
327 | - if (avcodec_get_context_defaults3 (ffmpegenc->context, | ||
328 | - oclass->in_plugin) < 0) | ||
329 | + avcodec_free_context (&ffmpegenc->context); | ||
330 | + ffmpegenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
331 | + if (ffmpegenc->context == NULL) | ||
332 | GST_DEBUG_OBJECT (ffmpegenc, "Failed to set context defaults"); | ||
333 | goto cleanup_stats_in; | ||
334 | } | ||
335 | @@ -896,8 +896,9 @@ gst_ffmpegvidenc_start (GstVideoEncoder * encoder) | ||
336 | ffmpegenc->need_reopen = FALSE; | ||
337 | |||
338 | /* close old session */ | ||
339 | - gst_ffmpeg_avcodec_close (ffmpegenc->context); | ||
340 | - if (avcodec_get_context_defaults3 (ffmpegenc->context, oclass->in_plugin) < 0) { | ||
341 | + avcodec_free_context (&ffmpegenc->context); | ||
342 | + ffmpegenc->context = avcodec_alloc_context3 (oclass->in_plugin); | ||
343 | + if (ffmpegenc->context == NULL) { | ||
344 | GST_DEBUG_OBJECT (ffmpegenc, "Failed to set context defaults"); | ||
345 | return FALSE; | ||
346 | } | ||
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.18.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.18.5.bb index a77ec62759..64b8bcdb52 100644 --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.18.5.bb +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.18.5.bb | |||
@@ -11,7 +11,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \ | |||
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 | ||
14 | SRC_URI = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz" | 14 | SRC_URI = "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \ |
15 | file://0001-gst-libav-fix-build-with-ffmpeg-5.0.0.patch \ | ||
16 | " | ||
15 | SRC_URI[sha256sum] = "822e008a910e9dd13aedbdd8dc63fedef4040c0ee2e927bab3112e9de693a548" | 17 | SRC_URI[sha256sum] = "822e008a910e9dd13aedbdd8dc63fedef4040c0ee2e927bab3112e9de693a548" |
16 | 18 | ||
17 | S = "${WORKDIR}/gst-libav-${PV}" | 19 | S = "${WORKDIR}/gst-libav-${PV}" |