1 |
commit: 1e7e5cf5b4395cb2ff0207ca4749d11b95a6d4d5 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 2 09:18:37 2016 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 2 09:18:58 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e7e5cf5 |
7 |
|
8 |
media-video/vlc: add patches to build with ffmpeg3, bug #574788 |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
media-video/vlc/files/vlc-2.2.4-ffmpeg3.patch | 160 +++++++++++++++++++++ |
13 |
media-video/vlc/files/vlc-2.2.4-relax_ffmpeg.patch | 45 ++++++ |
14 |
media-video/vlc/vlc-2.2.4.ebuild | 15 +- |
15 |
3 files changed, 213 insertions(+), 7 deletions(-) |
16 |
|
17 |
diff --git a/media-video/vlc/files/vlc-2.2.4-ffmpeg3.patch b/media-video/vlc/files/vlc-2.2.4-ffmpeg3.patch |
18 |
new file mode 100644 |
19 |
index 00000000..3bc5954 |
20 |
--- /dev/null |
21 |
+++ b/media-video/vlc/files/vlc-2.2.4-ffmpeg3.patch |
22 |
@@ -0,0 +1,160 @@ |
23 |
+Index: vlc-2.2.4/configure.ac |
24 |
+=================================================================== |
25 |
+--- vlc-2.2.4.orig/configure.ac |
26 |
++++ vlc-2.2.4/configure.ac |
27 |
+@@ -2323,8 +2323,8 @@ AC_ARG_ENABLE(avcodec, |
28 |
+ [ --enable-avcodec libavcodec codec (default enabled)]) |
29 |
+ AS_IF([test "${enable_avcodec}" != "no"], [ |
30 |
+ PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [ |
31 |
+- PKG_CHECK_EXISTS([libavutil < 55],, [ |
32 |
+- AC_MSG_ERROR([libavutil versions 55 and later are not supported.]) |
33 |
++ PKG_CHECK_EXISTS([libavutil < 56],, [ |
34 |
++ AC_MSG_ERROR([libavutil versions 56 and later are not supported.]) |
35 |
+ ]) |
36 |
+ VLC_SAVE_FLAGS |
37 |
+ CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" |
38 |
+Index: vlc-2.2.4/modules/codec/avcodec/audio.c |
39 |
+=================================================================== |
40 |
+--- vlc-2.2.4.orig/modules/codec/avcodec/audio.c |
41 |
++++ vlc-2.2.4/modules/codec/avcodec/audio.c |
42 |
+@@ -39,8 +39,6 @@ |
43 |
+ #include <libavcodec/avcodec.h> |
44 |
+ #include <libavutil/mem.h> |
45 |
+ |
46 |
+-#include <libavutil/audioconvert.h> |
47 |
+- |
48 |
+ #include "avcodec.h" |
49 |
+ |
50 |
+ /***************************************************************************** |
51 |
+Index: vlc-2.2.4/modules/codec/avcodec/encoder.c |
52 |
+=================================================================== |
53 |
+--- vlc-2.2.4.orig/modules/codec/avcodec/encoder.c |
54 |
++++ vlc-2.2.4/modules/codec/avcodec/encoder.c |
55 |
+@@ -41,7 +41,6 @@ |
56 |
+ #include <vlc_cpu.h> |
57 |
+ |
58 |
+ #include <libavcodec/avcodec.h> |
59 |
+-#include <libavutil/audioconvert.h> |
60 |
+ |
61 |
+ #include "avcodec.h" |
62 |
+ #include "avcommon.h" |
63 |
+@@ -311,7 +310,7 @@ int OpenEncoder( vlc_object_t *p_this ) |
64 |
+ else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id, |
65 |
+ &psz_namecodec ) ) |
66 |
+ { |
67 |
+- if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE ) |
68 |
++ if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE ) |
69 |
+ return VLC_EGENERIC; /* handed chroma output */ |
70 |
+ |
71 |
+ i_cat = VIDEO_ES; |
72 |
+@@ -555,7 +554,7 @@ int OpenEncoder( vlc_object_t *p_this ) |
73 |
+ |
74 |
+ if( p_codec->pix_fmts ) |
75 |
+ { |
76 |
+- const enum PixelFormat *p = p_codec->pix_fmts; |
77 |
++ const enum AVPixelFormat *p = p_codec->pix_fmts; |
78 |
+ for( ; *p != -1; p++ ) |
79 |
+ { |
80 |
+ if( *p == p_context->pix_fmt ) break; |
81 |
+@@ -1017,7 +1016,7 @@ errmsg: |
82 |
+ } |
83 |
+ } |
84 |
+ |
85 |
+- p_sys->frame = avcodec_alloc_frame(); |
86 |
++ p_sys->frame = av_frame_alloc(); |
87 |
+ if( !p_sys->frame ) |
88 |
+ { |
89 |
+ goto error; |
90 |
+@@ -1088,7 +1087,7 @@ static block_t *EncodeVideo( encoder_t * |
91 |
+ AVFrame *frame = NULL; |
92 |
+ if( likely(p_pict) ) { |
93 |
+ frame = p_sys->frame; |
94 |
+- avcodec_get_frame_defaults( frame ); |
95 |
++ av_frame_unref( frame ); |
96 |
+ for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ ) |
97 |
+ { |
98 |
+ p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels; |
99 |
+@@ -1329,7 +1328,7 @@ static block_t *handle_delay_buffer( enc |
100 |
+ //How much we need to copy from new packet |
101 |
+ const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes; |
102 |
+ |
103 |
+- avcodec_get_frame_defaults( p_sys->frame ); |
104 |
++ av_frame_unref( p_sys->frame ); |
105 |
+ p_sys->frame->format = p_sys->p_context->sample_fmt; |
106 |
+ p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; |
107 |
+ |
108 |
+@@ -1451,7 +1450,7 @@ static block_t *EncodeAudio( encoder_t * |
109 |
+ while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) || |
110 |
+ ( p_sys->b_variable && p_aout_buf->i_nb_samples ) ) |
111 |
+ { |
112 |
+- avcodec_get_frame_defaults( p_sys->frame ); |
113 |
++ av_frame_unref( p_sys->frame ); |
114 |
+ if( p_sys->b_variable ) |
115 |
+ p_sys->frame->nb_samples = p_aout_buf->i_nb_samples; |
116 |
+ else |
117 |
+Index: vlc-2.2.4/modules/codec/avcodec/vaapi.c |
118 |
+=================================================================== |
119 |
+--- vlc-2.2.4.orig/modules/codec/avcodec/vaapi.c |
120 |
++++ vlc-2.2.4/modules/codec/avcodec/vaapi.c |
121 |
+@@ -598,7 +598,7 @@ static int Create( vlc_va_t *p_va, AVCod |
122 |
+ return err; |
123 |
+ |
124 |
+ /* Only VLD supported */ |
125 |
+- p_va->pix_fmt = PIX_FMT_VAAPI_VLD; |
126 |
++ p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD; |
127 |
+ p_va->setup = Setup; |
128 |
+ p_va->get = Get; |
129 |
+ p_va->release = Release; |
130 |
+Index: vlc-2.2.4/modules/codec/avcodec/video.c |
131 |
+=================================================================== |
132 |
+--- vlc-2.2.4.orig/modules/codec/avcodec/video.c |
133 |
++++ vlc-2.2.4/modules/codec/avcodec/video.c |
134 |
+@@ -108,8 +108,8 @@ static int lavc_GetFrame(struct AVCodecC |
135 |
+ static int ffmpeg_GetFrameBuf ( struct AVCodecContext *, AVFrame * ); |
136 |
+ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * ); |
137 |
+ #endif |
138 |
+-static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *, |
139 |
+- const enum PixelFormat * ); |
140 |
++static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *, |
141 |
++ const enum AVPixelFormat * ); |
142 |
+ |
143 |
+ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc ) |
144 |
+ { |
145 |
+@@ -234,7 +234,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo |
146 |
+ p_sys->p_codec = p_codec; |
147 |
+ p_sys->i_codec_id = i_codec_id; |
148 |
+ p_sys->psz_namecodec = psz_namecodec; |
149 |
+- p_sys->p_ff_pic = avcodec_alloc_frame(); |
150 |
++ p_sys->p_ff_pic = av_frame_alloc(); |
151 |
+ p_sys->b_delayed_open = true; |
152 |
+ p_sys->p_va = NULL; |
153 |
+ vlc_sem_init( &p_sys->sem_mt, 0 ); |
154 |
+@@ -446,7 +446,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo |
155 |
+ if( ffmpeg_OpenCodec( p_dec ) < 0 ) |
156 |
+ { |
157 |
+ msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec ); |
158 |
+- avcodec_free_frame( &p_sys->p_ff_pic ); |
159 |
++ av_frame_free( &p_sys->p_ff_pic ); |
160 |
+ vlc_sem_destroy( &p_sys->sem_mt ); |
161 |
+ free( p_sys ); |
162 |
+ return VLC_EGENERIC; |
163 |
+@@ -826,7 +826,7 @@ void EndVideoDec( decoder_t *p_dec ) |
164 |
+ wait_mt( p_sys ); |
165 |
+ |
166 |
+ if( p_sys->p_ff_pic ) |
167 |
+- avcodec_free_frame( &p_sys->p_ff_pic ); |
168 |
++ av_frame_free( &p_sys->p_ff_pic ); |
169 |
+ |
170 |
+ if( p_sys->p_va ) |
171 |
+ vlc_va_Delete( p_sys->p_va ); |
172 |
+@@ -1313,8 +1313,8 @@ static void ffmpeg_ReleaseFrameBuf( stru |
173 |
+ } |
174 |
+ #endif |
175 |
+ |
176 |
+-static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, |
177 |
+- const enum PixelFormat *pi_fmt ) |
178 |
++static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, |
179 |
++ const enum AVPixelFormat *pi_fmt ) |
180 |
+ { |
181 |
+ decoder_t *p_dec = p_context->opaque; |
182 |
+ decoder_sys_t *p_sys = p_dec->p_sys; |
183 |
|
184 |
diff --git a/media-video/vlc/files/vlc-2.2.4-relax_ffmpeg.patch b/media-video/vlc/files/vlc-2.2.4-relax_ffmpeg.patch |
185 |
new file mode 100644 |
186 |
index 00000000..218af58 |
187 |
--- /dev/null |
188 |
+++ b/media-video/vlc/files/vlc-2.2.4-relax_ffmpeg.patch |
189 |
@@ -0,0 +1,45 @@ |
190 |
+commit b8869f97ea66ac7ec9912a74c2e8b5e15daf7752 |
191 |
+Author: Rafaël Carré <funman@××××××××.org> |
192 |
+Date: Fri Feb 26 00:36:26 2016 +0000 |
193 |
+ |
194 |
+ Relax requirements for FFmpeg hwaccel |
195 |
+ |
196 |
+ It doesn't error out anymore since 5edd1f62ca1 |
197 |
+ |
198 |
+Index: vlc-2.2.4/configure.ac |
199 |
+=================================================================== |
200 |
+--- vlc-2.2.4.orig/configure.ac |
201 |
++++ vlc-2.2.4/configure.ac |
202 |
+@@ -2383,7 +2383,9 @@ AS_IF([test "${have_vaapi}" = "yes" -a " |
203 |
+ case "${avfork}" in |
204 |
+ ffmpeg) |
205 |
+ PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [ |
206 |
+- AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.]) |
207 |
++ PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [ |
208 |
++ AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.]) |
209 |
++ ]) |
210 |
+ ]) |
211 |
+ ;; |
212 |
+ esac |
213 |
+@@ -2417,7 +2419,9 @@ AS_IF([test "${enable_dxva2}" != "no"], |
214 |
+ case "${avfork}" in |
215 |
+ ffmpeg) |
216 |
+ PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [ |
217 |
+- AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.]) |
218 |
++ PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [ |
219 |
++ AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.]) |
220 |
++ ]) |
221 |
+ ]) |
222 |
+ ;; |
223 |
+ esac |
224 |
+@@ -3181,7 +3185,9 @@ AS_IF([test "${have_vdpau}" = "yes" -a " |
225 |
+ libav) av_vdpau_ver="55.26.0" ;; |
226 |
+ ffmpeg) av_vdpau_ver="55.42.100" |
227 |
+ PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [ |
228 |
+- AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.]) |
229 |
++ PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [ |
230 |
++ AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.]) |
231 |
++ ]) |
232 |
+ ]) |
233 |
+ ;; |
234 |
+ esac |
235 |
|
236 |
diff --git a/media-video/vlc/vlc-2.2.4.ebuild b/media-video/vlc/vlc-2.2.4.ebuild |
237 |
index d1958ac..7e3bd58 100644 |
238 |
--- a/media-video/vlc/vlc-2.2.4.ebuild |
239 |
+++ b/media-video/vlc/vlc-2.2.4.ebuild |
240 |
@@ -63,15 +63,13 @@ RDEPEND=" |
241 |
alsa? ( >=media-libs/alsa-lib-1.0.24:0 ) |
242 |
avcodec? ( |
243 |
!libav? ( |
244 |
- >=media-video/ffmpeg-2.2:0= |
245 |
- <=media-video/ffmpeg-2.9:0= |
246 |
+ >=media-video/ffmpeg-2.8:0= |
247 |
) |
248 |
libav? ( >=media-video/libav-11:0= ) |
249 |
) |
250 |
avformat? ( |
251 |
!libav? ( |
252 |
- >=media-video/ffmpeg-2.2:0= |
253 |
- <=media-video/ffmpeg-2.9:0= |
254 |
+ >=media-video/ffmpeg-2.8:0= |
255 |
) |
256 |
libav? ( media-video/libav:0= ) |
257 |
) |
258 |
@@ -157,7 +155,7 @@ RDEPEND=" |
259 |
v4l? ( media-libs/libv4l:0 ) |
260 |
vaapi? ( |
261 |
x11-libs/libva:0[X,drm] |
262 |
- !libav? ( <=media-video/ffmpeg-2.9:0=[vaapi] ) |
263 |
+ !libav? ( >=media-video/ffmpeg-2.8:0=[vaapi] ) |
264 |
libav? ( media-video/libav:0=[vaapi] ) |
265 |
) |
266 |
vcdx? ( >=dev-libs/libcdio-0.78.2:0 >=media-video/vcdimager-0.7.22:0 ) |
267 |
@@ -170,8 +168,7 @@ RDEPEND="${RDEPEND} |
268 |
vdpau? ( |
269 |
>=x11-libs/libvdpau-0.6:0 |
270 |
!libav? ( |
271 |
- >=media-video/ffmpeg-2.2:0= |
272 |
- <=media-video/ffmpeg-2.9:0= |
273 |
+ >=media-video/ffmpeg-2.8:0= |
274 |
) |
275 |
libav? ( >=media-video/libav-10:0= ) |
276 |
) |
277 |
@@ -234,6 +231,10 @@ PATCHES=( |
278 |
|
279 |
# Allow QT5.5 since Gentoo has a patched QTwidgets |
280 |
"${FILESDIR}"/${PN}-2.2.2-qt5widgets.patch |
281 |
+ |
282 |
+ # Bug #575072 |
283 |
+ "${FILESDIR}"/${PN}-2.2.4-relax_ffmpeg.patch |
284 |
+ "${FILESDIR}"/${PN}-2.2.4-ffmpeg3.patch |
285 |
) |
286 |
|
287 |
S="${WORKDIR}/${MY_P}" |