Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/ffmpeg/files/, media-video/ffmpeg/
Date: Sat, 26 Aug 2017 13:41:26
Message-Id: 1503754858.904d190b4714c2d7a2ca9637f45d817a13e69125.aballier@gentoo
1 commit: 904d190b4714c2d7a2ca9637f45d817a13e69125
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 26 13:40:52 2017 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 26 13:40:58 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=904d190b
7
8 media-video/ffmpeg: Backport upstream patches to build with openjpeg 2.2, bugs #628302 and #627562
9
10 Package-Manager: Portage-2.3.8, Repoman-2.3.3
11
12 media-video/ffmpeg/ffmpeg-3.2.6.ebuild | 2 +
13 media-video/ffmpeg/ffmpeg-3.2.7.ebuild | 2 +
14 media-video/ffmpeg/ffmpeg-3.3.3.ebuild | 2 +
15 media-video/ffmpeg/files/ffmpeg32-openjpeg22.patch | 106 +++++++++++++++++++++
16 media-video/ffmpeg/files/openjpeg22.patch | 106 +++++++++++++++++++++
17 5 files changed, 218 insertions(+)
18
19 diff --git a/media-video/ffmpeg/ffmpeg-3.2.6.ebuild b/media-video/ffmpeg/ffmpeg-3.2.6.ebuild
20 index 0969268ce8f..74d37e876a7 100644
21 --- a/media-video/ffmpeg/ffmpeg-3.2.6.ebuild
22 +++ b/media-video/ffmpeg/ffmpeg-3.2.6.ebuild
23 @@ -287,6 +287,8 @@ MULTILIB_WRAPPED_HEADERS=(
24 /usr/include/libavutil/avconfig.h
25 )
26
27 +PATCHES=( "${FILESDIR}/ffmpeg32-openjpeg22.patch" )
28 +
29 src_prepare() {
30 if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
31 export revision=git-N-${FFMPEG_REVISION}
32
33 diff --git a/media-video/ffmpeg/ffmpeg-3.2.7.ebuild b/media-video/ffmpeg/ffmpeg-3.2.7.ebuild
34 index d7e03bf5fdf..15961769e9c 100644
35 --- a/media-video/ffmpeg/ffmpeg-3.2.7.ebuild
36 +++ b/media-video/ffmpeg/ffmpeg-3.2.7.ebuild
37 @@ -287,6 +287,8 @@ MULTILIB_WRAPPED_HEADERS=(
38 /usr/include/libavutil/avconfig.h
39 )
40
41 +PATCHES=( "${FILESDIR}/ffmpeg32-openjpeg22.patch" )
42 +
43 src_prepare() {
44 if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
45 export revision=git-N-${FFMPEG_REVISION}
46
47 diff --git a/media-video/ffmpeg/ffmpeg-3.3.3.ebuild b/media-video/ffmpeg/ffmpeg-3.3.3.ebuild
48 index fb789614634..a6548ccc453 100644
49 --- a/media-video/ffmpeg/ffmpeg-3.3.3.ebuild
50 +++ b/media-video/ffmpeg/ffmpeg-3.3.3.ebuild
51 @@ -307,6 +307,8 @@ MULTILIB_WRAPPED_HEADERS=(
52 /usr/include/libavutil/avconfig.h
53 )
54
55 +PATCHES=( "${FILESDIR}/openjpeg22.patch" )
56 +
57 src_prepare() {
58 if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
59 export revision=git-N-${FFMPEG_REVISION}
60
61 diff --git a/media-video/ffmpeg/files/ffmpeg32-openjpeg22.patch b/media-video/ffmpeg/files/ffmpeg32-openjpeg22.patch
62 new file mode 100644
63 index 00000000000..0ee648641be
64 --- /dev/null
65 +++ b/media-video/ffmpeg/files/ffmpeg32-openjpeg22.patch
66 @@ -0,0 +1,106 @@
67 +commit 078322f33ced4b2db6ac3e5002f98233d6fbf643
68 +Author: Reino17 <rwijnsma@××××××.nl>
69 +Date: Fri Jun 23 23:49:31 2017 +0200
70 +
71 + Add support for LibOpenJPEG v2.2/git
72 +
73 + Signed-off-by: Michael Bradshaw <mjbshaw@××××××.com>
74 +
75 +Index: ffmpeg-3.2.7/configure
76 +===================================================================
77 +--- ffmpeg-3.2.7.orig/configure
78 ++++ ffmpeg-3.2.7/configure
79 +@@ -1831,6 +1831,7 @@ HEADERS_LIST="
80 + machine_ioctl_meteor_h
81 + malloc_h
82 + opencv2_core_core_c_h
83 ++ openjpeg_2_2_openjpeg_h
84 + openjpeg_2_1_openjpeg_h
85 + openjpeg_2_0_openjpeg_h
86 + openjpeg_1_5_openjpeg_h
87 +@@ -5721,7 +5722,9 @@ enabled libopencv && { check_hea
88 + require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
89 + require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
90 + enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
91 +-enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
92 ++enabled libopenjpeg && { { check_lib2 openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
93 ++ check_lib2 openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
94 ++ { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
95 + check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
96 + { check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
97 + { check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
98 +Index: ffmpeg-3.2.7/libavcodec/libopenjpegdec.c
99 +===================================================================
100 +--- ffmpeg-3.2.7.orig/libavcodec/libopenjpegdec.c
101 ++++ ffmpeg-3.2.7/libavcodec/libopenjpegdec.c
102 +@@ -34,7 +34,9 @@
103 + #include "internal.h"
104 + #include "thread.h"
105 +
106 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
107 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H
108 ++# include <openjpeg-2.2/openjpeg.h>
109 ++#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
110 + # include <openjpeg-2.1/openjpeg.h>
111 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
112 + # include <openjpeg-2.0/openjpeg.h>
113 +@@ -44,7 +46,7 @@
114 + # include <openjpeg.h>
115 + #endif
116 +
117 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
118 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
119 + # define OPENJPEG_MAJOR_VERSION 2
120 + # define OPJ(x) OPJ_##x
121 + #else
122 +@@ -429,7 +431,7 @@ static int libopenjpeg_decode_frame(AVCo
123 + opj_stream_set_read_function(stream, stream_read);
124 + opj_stream_set_skip_function(stream, stream_skip);
125 + opj_stream_set_seek_function(stream, stream_seek);
126 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
127 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
128 + opj_stream_set_user_data(stream, &reader, NULL);
129 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
130 + opj_stream_set_user_data(stream, &reader);
131 +Index: ffmpeg-3.2.7/libavcodec/libopenjpegenc.c
132 +===================================================================
133 +--- ffmpeg-3.2.7.orig/libavcodec/libopenjpegenc.c
134 ++++ ffmpeg-3.2.7/libavcodec/libopenjpegenc.c
135 +@@ -32,7 +32,9 @@
136 + #include "avcodec.h"
137 + #include "internal.h"
138 +
139 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
140 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H
141 ++# include <openjpeg-2.2/openjpeg.h>
142 ++#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
143 + # include <openjpeg-2.1/openjpeg.h>
144 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
145 + # include <openjpeg-2.0/openjpeg.h>
146 +@@ -42,7 +44,7 @@
147 + # include <openjpeg.h>
148 + #endif
149 +
150 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
151 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
152 + # define OPENJPEG_MAJOR_VERSION 2
153 + # define OPJ(x) OPJ_##x
154 + #else
155 +@@ -306,7 +308,7 @@ static av_cold int libopenjpeg_encode_in
156 +
157 + opj_set_default_encoder_parameters(&ctx->enc_params);
158 +
159 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
160 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
161 + switch (ctx->cinema_mode) {
162 + case OPJ_CINEMA2K_24:
163 + ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K;
164 +@@ -771,7 +773,7 @@ static int libopenjpeg_encode_frame(AVCo
165 + opj_stream_set_write_function(stream, stream_write);
166 + opj_stream_set_skip_function(stream, stream_skip);
167 + opj_stream_set_seek_function(stream, stream_seek);
168 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
169 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
170 + opj_stream_set_user_data(stream, &writer, NULL);
171 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
172 + opj_stream_set_user_data(stream, &writer);
173
174 diff --git a/media-video/ffmpeg/files/openjpeg22.patch b/media-video/ffmpeg/files/openjpeg22.patch
175 new file mode 100644
176 index 00000000000..a458c15208a
177 --- /dev/null
178 +++ b/media-video/ffmpeg/files/openjpeg22.patch
179 @@ -0,0 +1,106 @@
180 +commit 078322f33ced4b2db6ac3e5002f98233d6fbf643
181 +Author: Reino17 <rwijnsma@××××××.nl>
182 +Date: Fri Jun 23 23:49:31 2017 +0200
183 +
184 + Add support for LibOpenJPEG v2.2/git
185 +
186 + Signed-off-by: Michael Bradshaw <mjbshaw@××××××.com>
187 +
188 +Index: ffmpeg-3.3.3/configure
189 +===================================================================
190 +--- ffmpeg-3.3.3.orig/configure
191 ++++ ffmpeg-3.3.3/configure
192 +@@ -1875,6 +1875,7 @@ HEADERS_LIST="
193 + machine_ioctl_meteor_h
194 + malloc_h
195 + opencv2_core_core_c_h
196 ++ openjpeg_2_2_openjpeg_h
197 + openjpeg_2_1_openjpeg_h
198 + openjpeg_2_0_openjpeg_h
199 + openjpeg_1_5_openjpeg_h
200 +@@ -5805,7 +5806,9 @@ enabled libopencv && { check_hea
201 + require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
202 + require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
203 + enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
204 +-enabled libopenjpeg && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
205 ++enabled libopenjpeg && { { check_lib openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
206 ++ check_lib openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
207 ++ { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
208 + check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
209 + { check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
210 + { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
211 +Index: ffmpeg-3.3.3/libavcodec/libopenjpegdec.c
212 +===================================================================
213 +--- ffmpeg-3.3.3.orig/libavcodec/libopenjpegdec.c
214 ++++ ffmpeg-3.3.3/libavcodec/libopenjpegdec.c
215 +@@ -34,7 +34,9 @@
216 + #include "internal.h"
217 + #include "thread.h"
218 +
219 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
220 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H
221 ++# include <openjpeg-2.2/openjpeg.h>
222 ++#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
223 + # include <openjpeg-2.1/openjpeg.h>
224 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
225 + # include <openjpeg-2.0/openjpeg.h>
226 +@@ -44,7 +46,7 @@
227 + # include <openjpeg.h>
228 + #endif
229 +
230 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
231 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
232 + # define OPENJPEG_MAJOR_VERSION 2
233 + # define OPJ(x) OPJ_##x
234 + #else
235 +@@ -429,7 +431,7 @@ static int libopenjpeg_decode_frame(AVCo
236 + opj_stream_set_read_function(stream, stream_read);
237 + opj_stream_set_skip_function(stream, stream_skip);
238 + opj_stream_set_seek_function(stream, stream_seek);
239 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
240 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
241 + opj_stream_set_user_data(stream, &reader, NULL);
242 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
243 + opj_stream_set_user_data(stream, &reader);
244 +Index: ffmpeg-3.3.3/libavcodec/libopenjpegenc.c
245 +===================================================================
246 +--- ffmpeg-3.3.3.orig/libavcodec/libopenjpegenc.c
247 ++++ ffmpeg-3.3.3/libavcodec/libopenjpegenc.c
248 +@@ -32,7 +32,9 @@
249 + #include "avcodec.h"
250 + #include "internal.h"
251 +
252 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
253 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H
254 ++# include <openjpeg-2.2/openjpeg.h>
255 ++#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
256 + # include <openjpeg-2.1/openjpeg.h>
257 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
258 + # include <openjpeg-2.0/openjpeg.h>
259 +@@ -42,7 +44,7 @@
260 + # include <openjpeg.h>
261 + #endif
262 +
263 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
264 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
265 + # define OPENJPEG_MAJOR_VERSION 2
266 + # define OPJ(x) OPJ_##x
267 + #else
268 +@@ -305,7 +307,7 @@ static av_cold int libopenjpeg_encode_in
269 +
270 + opj_set_default_encoder_parameters(&ctx->enc_params);
271 +
272 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
273 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
274 + switch (ctx->cinema_mode) {
275 + case OPJ_CINEMA2K_24:
276 + ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K;
277 +@@ -769,7 +771,7 @@ static int libopenjpeg_encode_frame(AVCo
278 + opj_stream_set_write_function(stream, stream_write);
279 + opj_stream_set_skip_function(stream, stream_skip);
280 + opj_stream_set_seek_function(stream, stream_seek);
281 +-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
282 ++#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
283 + opj_stream_set_user_data(stream, &writer, NULL);
284 + #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
285 + opj_stream_set_user_data(stream, &writer);