]> git.pld-linux.org Git - packages/vlc.git/blob - ffmpeg3.patch
- fix building with ffmpeg 3.x
[packages/vlc.git] / ffmpeg3.patch
1 diff -ur vlc-2.2.2/configure.ac vlc-2.2.2.ffmpeg3/configure.ac
2 --- vlc-2.2.2/configure.ac      2016-03-24 14:55:02.581707871 +0100
3 +++ vlc-2.2.2.ffmpeg3/configure.ac      2016-03-24 14:42:41.189209910 +0100
4 @@ -2323,9 +2323,6 @@
5  [  --enable-avcodec        libavcodec codec (default enabled)])
6  AS_IF([test "${enable_avcodec}" != "no"], [
7    PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
8 -    PKG_CHECK_EXISTS([libavutil < 55],, [
9 -      AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
10 -    ])
11      VLC_SAVE_FLAGS
12      CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
13      CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
14 @@ -2382,9 +2379,6 @@
15  AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
16    case "${avfork}" in
17      ffmpeg)
18 -      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
19 -        AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
20 -      ])
21        ;;
22    esac
23    VLC_SAVE_FLAGS
24 @@ -2416,9 +2410,6 @@
25    AS_IF([test "x${have_avcodec}" = "xyes"], [
26      case "${avfork}" in
27        ffmpeg)
28 -        PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
29 -          AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
30 -        ])
31          ;;
32      esac
33      AC_CHECK_HEADERS(dxva2api.h,
34 @@ -3180,9 +3171,6 @@
35    case "${avfork}" in
36      libav) av_vdpau_ver="55.26.0" ;;
37      ffmpeg) av_vdpau_ver="55.42.100"
38 -      PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
39 -        AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
40 -      ])
41        ;;
42    esac
43    PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
44 diff -ur vlc-2.2.2/modules/codec/avcodec/audio.c vlc-2.2.2.ffmpeg3/modules/codec/avcodec/audio.c
45 --- vlc-2.2.2/modules/codec/avcodec/audio.c     2016-01-18 21:49:57.000000000 +0100
46 +++ vlc-2.2.2.ffmpeg3/modules/codec/avcodec/audio.c     2016-03-24 14:44:59.137581977 +0100
47 @@ -39,7 +39,6 @@
48  #include <libavcodec/avcodec.h>
49  #include <libavutil/mem.h>
50  
51 -#include <libavutil/audioconvert.h>
52  
53  #include "avcodec.h"
54  
55 diff -ur vlc-2.2.2/modules/codec/avcodec/chroma.c vlc-2.2.2.ffmpeg3/modules/codec/avcodec/chroma.c
56 --- vlc-2.2.2/modules/codec/avcodec/chroma.c    2015-06-30 15:53:31.000000000 +0200
57 +++ vlc-2.2.2.ffmpeg3/modules/codec/avcodec/chroma.c    2016-03-24 14:42:39.442521648 +0100
58 @@ -62,77 +62,77 @@
59  } chroma_table[] =
60  {
61      /* Planar YUV formats */
62 -    {VLC_CODEC_I444, PIX_FMT_YUV444P, 0, 0, 0 },
63 -    {VLC_CODEC_J444, PIX_FMT_YUVJ444P, 0, 0, 0 },
64 +    {VLC_CODEC_I444, AV_PIX_FMT_YUV444P, 0, 0, 0 },
65 +    {VLC_CODEC_J444, AV_PIX_FMT_YUVJ444P, 0, 0, 0 },
66  
67 -    {VLC_CODEC_I440, PIX_FMT_YUV440P, 0, 0, 0 },
68 -    {VLC_CODEC_J440, PIX_FMT_YUVJ440P, 0, 0, 0 },
69 +    {VLC_CODEC_I440, AV_PIX_FMT_YUV440P, 0, 0, 0 },
70 +    {VLC_CODEC_J440, AV_PIX_FMT_YUVJ440P, 0, 0, 0 },
71  
72 -    {VLC_CODEC_I422, PIX_FMT_YUV422P, 0, 0, 0 },
73 -    {VLC_CODEC_J422, PIX_FMT_YUVJ422P, 0, 0, 0 },
74 +    {VLC_CODEC_I422, AV_PIX_FMT_YUV422P, 0, 0, 0 },
75 +    {VLC_CODEC_J422, AV_PIX_FMT_YUVJ422P, 0, 0, 0 },
76  
77 -    {VLC_CODEC_I420, PIX_FMT_YUV420P, 0, 0, 0 },
78 -    {VLC_CODEC_YV12, PIX_FMT_YUV420P, 0, 0, 0 },
79 -    {VLC_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P, 0, 0, 0 },
80 -    {VLC_CODEC_J420, PIX_FMT_YUVJ420P, 0, 0, 0 },
81 -    {VLC_CODEC_I411, PIX_FMT_YUV411P, 0, 0, 0 },
82 -    {VLC_CODEC_I410, PIX_FMT_YUV410P, 0, 0, 0 },
83 -    {VLC_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P, 0, 0, 0 },
84 -
85 -    {VLC_FOURCC('N','V','1','2'), PIX_FMT_NV12, 0, 0, 0 },
86 -    {VLC_FOURCC('N','V','2','1'), PIX_FMT_NV21, 0, 0, 0 },
87 -
88 -    {VLC_CODEC_I420_9L, PIX_FMT_YUV420P9LE, 0, 0, 0 },
89 -    {VLC_CODEC_I420_9B, PIX_FMT_YUV420P9BE, 0, 0, 0 },
90 -    {VLC_CODEC_I420_10L, PIX_FMT_YUV420P10LE, 0, 0, 0 },
91 -    {VLC_CODEC_I420_10B, PIX_FMT_YUV420P10BE, 0, 0, 0 },
92 +    {VLC_CODEC_I420, AV_PIX_FMT_YUV420P, 0, 0, 0 },
93 +    {VLC_CODEC_YV12, AV_PIX_FMT_YUV420P, 0, 0, 0 },
94 +    {VLC_FOURCC('I','Y','U','V'), AV_PIX_FMT_YUV420P, 0, 0, 0 },
95 +    {VLC_CODEC_J420, AV_PIX_FMT_YUVJ420P, 0, 0, 0 },
96 +    {VLC_CODEC_I411, AV_PIX_FMT_YUV411P, 0, 0, 0 },
97 +    {VLC_CODEC_I410, AV_PIX_FMT_YUV410P, 0, 0, 0 },
98 +    {VLC_FOURCC('Y','V','U','9'), AV_PIX_FMT_YUV410P, 0, 0, 0 },
99 +
100 +    {VLC_FOURCC('N','V','1','2'), AV_PIX_FMT_NV12, 0, 0, 0 },
101 +    {VLC_FOURCC('N','V','2','1'), AV_PIX_FMT_NV21, 0, 0, 0 },
102 +
103 +    {VLC_CODEC_I420_9L, AV_PIX_FMT_YUV420P9LE, 0, 0, 0 },
104 +    {VLC_CODEC_I420_9B, AV_PIX_FMT_YUV420P9BE, 0, 0, 0 },
105 +    {VLC_CODEC_I420_10L, AV_PIX_FMT_YUV420P10LE, 0, 0, 0 },
106 +    {VLC_CODEC_I420_10B, AV_PIX_FMT_YUV420P10BE, 0, 0, 0 },
107  #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,13,0)
108 -    {VLC_CODEC_I422_9L, PIX_FMT_YUV422P9LE, 0, 0, 0 },
109 -    {VLC_CODEC_I422_9B, PIX_FMT_YUV422P9BE, 0, 0, 0 },
110 +    {VLC_CODEC_I422_9L, AV_PIX_FMT_YUV422P9LE, 0, 0, 0 },
111 +    {VLC_CODEC_I422_9B, AV_PIX_FMT_YUV422P9BE, 0, 0, 0 },
112  #endif
113 -    {VLC_CODEC_I422_10L, PIX_FMT_YUV422P10LE, 0, 0, 0 },
114 -    {VLC_CODEC_I422_10B, PIX_FMT_YUV422P10BE, 0, 0, 0 },
115 +    {VLC_CODEC_I422_10L, AV_PIX_FMT_YUV422P10LE, 0, 0, 0 },
116 +    {VLC_CODEC_I422_10B, AV_PIX_FMT_YUV422P10BE, 0, 0, 0 },
117  
118 -    {VLC_CODEC_YUV420A, PIX_FMT_YUVA420P, 0, 0, 0 },
119 +    {VLC_CODEC_YUV420A, AV_PIX_FMT_YUVA420P, 0, 0, 0 },
120  #if LIBAVUTIL_VERSION_CHECK( 51, 45, 0, 74, 100 )
121      {VLC_CODEC_YUV422A, AV_PIX_FMT_YUVA422P, 0, 0, 0 },
122  #endif
123  
124 -    {VLC_CODEC_I444_9L, PIX_FMT_YUV444P9LE, 0, 0, 0 },
125 -    {VLC_CODEC_I444_9B, PIX_FMT_YUV444P9BE, 0, 0, 0 },
126 -    {VLC_CODEC_I444_10L, PIX_FMT_YUV444P10LE, 0, 0, 0 },
127 -    {VLC_CODEC_I444_10B, PIX_FMT_YUV444P10BE, 0, 0, 0 },
128 -    {VLC_CODEC_I444_16L, PIX_FMT_YUV444P16LE, 0, 0, 0 },
129 -    {VLC_CODEC_I444_16B, PIX_FMT_YUV444P16BE, 0, 0, 0 },
130 +    {VLC_CODEC_I444_9L, AV_PIX_FMT_YUV444P9LE, 0, 0, 0 },
131 +    {VLC_CODEC_I444_9B, AV_PIX_FMT_YUV444P9BE, 0, 0, 0 },
132 +    {VLC_CODEC_I444_10L, AV_PIX_FMT_YUV444P10LE, 0, 0, 0 },
133 +    {VLC_CODEC_I444_10B, AV_PIX_FMT_YUV444P10BE, 0, 0, 0 },
134 +    {VLC_CODEC_I444_16L, AV_PIX_FMT_YUV444P16LE, 0, 0, 0 },
135 +    {VLC_CODEC_I444_16B, AV_PIX_FMT_YUV444P16BE, 0, 0, 0 },
136  
137      /* Packed YUV formats */
138 -    {VLC_CODEC_YUYV, PIX_FMT_YUYV422, 0, 0, 0 },
139 -    {VLC_FOURCC('Y','U','Y','V'), PIX_FMT_YUYV422, 0, 0, 0 },
140 -    {VLC_CODEC_UYVY, PIX_FMT_UYVY422, 0, 0, 0 },
141 -    {VLC_FOURCC('Y','4','1','1'), PIX_FMT_UYYVYY411, 0, 0, 0 },
142 +    {VLC_CODEC_YUYV, AV_PIX_FMT_YUYV422, 0, 0, 0 },
143 +    {VLC_FOURCC('Y','U','Y','V'), AV_PIX_FMT_YUYV422, 0, 0, 0 },
144 +    {VLC_CODEC_UYVY, AV_PIX_FMT_UYVY422, 0, 0, 0 },
145 +    {VLC_FOURCC('Y','4','1','1'), AV_PIX_FMT_UYYVYY411, 0, 0, 0 },
146  
147      /* Packed RGB formats */
148 -    VLC_RGB( VLC_FOURCC('R','G','B','4'), PIX_FMT_RGB4, PIX_FMT_BGR4, 0x10, 0x06, 0x01 )
149 -    VLC_RGB( VLC_FOURCC('R','G','B','8'), PIX_FMT_RGB8, PIX_FMT_BGR8, 0xC0, 0x38, 0x07 )
150 +    VLC_RGB( VLC_FOURCC('R','G','B','4'), AV_PIX_FMT_RGB4, AV_PIX_FMT_BGR4, 0x10, 0x06, 0x01 )
151 +    VLC_RGB( VLC_FOURCC('R','G','B','8'), AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, 0xC0, 0x38, 0x07 )
152  
153 -    VLC_RGB( VLC_CODEC_RGB15, PIX_FMT_RGB555, PIX_FMT_BGR555, 0x7c00, 0x03e0, 0x001f )
154 -    VLC_RGB( VLC_CODEC_RGB16, PIX_FMT_RGB565, PIX_FMT_BGR565, 0xf800, 0x07e0, 0x001f )
155 -    VLC_RGB( VLC_CODEC_RGB24, PIX_FMT_BGR24, PIX_FMT_RGB24, 0xff0000, 0x00ff00, 0x0000ff )
156 +    VLC_RGB( VLC_CODEC_RGB15, AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555, 0x7c00, 0x03e0, 0x001f )
157 +    VLC_RGB( VLC_CODEC_RGB16, AV_PIX_FMT_RGB565, AV_PIX_FMT_BGR565, 0xf800, 0x07e0, 0x001f )
158 +    VLC_RGB( VLC_CODEC_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, 0xff0000, 0x00ff00, 0x0000ff )
159  
160 -    VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32, PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
161 -    VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
162 +    VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_RGB32, AV_PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
163 +    VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_RGB32_1, AV_PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
164  
165  #ifdef AV_PIX_FMT_0BGR32
166      VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_0BGR32, AV_PIX_FMT_0RGB32, 0x000000ff, 0x0000ff00, 0x00ff0000 )
167  #endif
168  
169 -    {VLC_CODEC_RGBA, PIX_FMT_RGBA, 0, 0, 0 },
170 -    {VLC_CODEC_ARGB, PIX_FMT_ARGB, 0, 0, 0 },
171 -    {VLC_CODEC_BGRA, PIX_FMT_BGRA, 0, 0, 0 },
172 -    {VLC_CODEC_GREY, PIX_FMT_GRAY8, 0, 0, 0},
173 +    {VLC_CODEC_RGBA, AV_PIX_FMT_RGBA, 0, 0, 0 },
174 +    {VLC_CODEC_ARGB, AV_PIX_FMT_ARGB, 0, 0, 0 },
175 +    {VLC_CODEC_BGRA, AV_PIX_FMT_BGRA, 0, 0, 0 },
176 +    {VLC_CODEC_GREY, AV_PIX_FMT_GRAY8, 0, 0, 0},
177  
178       /* Paletized RGB */
179 -    {VLC_CODEC_RGBP, PIX_FMT_PAL8, 0, 0, 0},
180 +    {VLC_CODEC_RGBP, AV_PIX_FMT_PAL8, 0, 0, 0},
181  
182  #if LIBAVUTIL_VERSION_CHECK(51, 42, 0, 74,100)
183      {VLC_CODEC_GBR_PLANAR, AV_PIX_FMT_GBRP, 0, 0, 0 },
184 @@ -201,5 +201,5 @@
185      for( int i = 0; chroma_table[i].i_chroma != 0; i++ )
186          if( chroma_table[i].i_chroma == fourcc )
187              return chroma_table[i].i_chroma_id;
188 -    return PIX_FMT_NONE;
189 +    return AV_PIX_FMT_NONE;
190  }
191 diff -ur vlc-2.2.2/modules/codec/avcodec/encoder.c vlc-2.2.2.ffmpeg3/modules/codec/avcodec/encoder.c
192 --- vlc-2.2.2/modules/codec/avcodec/encoder.c   2015-10-21 19:48:45.000000000 +0200
193 +++ vlc-2.2.2.ffmpeg3/modules/codec/avcodec/encoder.c   2016-03-24 14:49:27.040893692 +0100
194 @@ -41,7 +41,6 @@
195  #include <vlc_cpu.h>
196  
197  #include <libavcodec/avcodec.h>
198 -#include <libavutil/audioconvert.h>
199  
200  #include "avcodec.h"
201  #include "avcommon.h"
202 @@ -311,7 +311,7 @@
203      else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
204                               &psz_namecodec ) )
205      {
206 -        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
207 +        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
208              return VLC_EGENERIC; /* handed chroma output */
209  
210          i_cat      = VIDEO_ES;
211 @@ -555,7 +555,7 @@
212  
213          if( p_codec->pix_fmts )
214          {
215 -            const enum PixelFormat *p = p_codec->pix_fmts;
216 +            const enum AVPixelFormat *p = p_codec->pix_fmts;
217              for( ; *p != -1; p++ )
218              {
219                  if( *p == p_context->pix_fmt ) break;
220 @@ -1017,7 +1017,7 @@
221          }
222      }
223  
224 -    p_sys->frame = avcodec_alloc_frame();
225 +    p_sys->frame = av_frame_alloc();
226      if( !p_sys->frame )
227      {
228          goto error;
229 @@ -1088,7 +1088,7 @@
230      AVFrame *frame = NULL;
231      if( likely(p_pict) ) {
232          frame = p_sys->frame;
233 -        avcodec_get_frame_defaults( frame );
234 +        av_frame_unref( frame );
235          for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
236          {
237              p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
238 @@ -1329,7 +1329,7 @@
239      //How much we need to copy from new packet
240      const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
241  
242 -    avcodec_get_frame_defaults( p_sys->frame );
243 +    av_frame_unref( p_sys->frame );
244      p_sys->frame->format     = p_sys->p_context->sample_fmt;
245      p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
246  
247 @@ -1451,7 +1451,7 @@
248      while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
249             ( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
250      {
251 -        avcodec_get_frame_defaults( p_sys->frame );
252 +        av_frame_unref( p_sys->frame );
253          if( p_sys->b_variable )
254              p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
255          else
256 @@ -1514,7 +1514,7 @@
257      encoder_t *p_enc = (encoder_t *)p_this;
258      encoder_sys_t *p_sys = p_enc->p_sys;
259  
260 -    /*FIXME: we should use avcodec_free_frame, but we don't require so new avcodec that has it*/
261 +    /*FIXME: we should use av_frame_free, but we don't require so new avcodec that has it*/
262      av_freep( &p_sys->frame );
263  
264      vlc_avcodec_lock();
265 diff -ur vlc-2.2.2/modules/codec/avcodec/vaapi.c vlc-2.2.2.ffmpeg3/modules/codec/avcodec/vaapi.c
266 --- vlc-2.2.2/modules/codec/avcodec/vaapi.c     2015-02-02 20:42:29.000000000 +0100
267 +++ vlc-2.2.2.ffmpeg3/modules/codec/avcodec/vaapi.c     2016-03-24 14:49:59.504628311 +0100
268 @@ -595,7 +595,7 @@
269          return err;
270  
271      /* Only VLD supported */
272 -    p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
273 +    p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
274      p_va->setup = Setup;
275      p_va->get = Get;
276      p_va->release = Release;
277 diff -ur vlc-2.2.2/modules/codec/avcodec/video.c vlc-2.2.2.ffmpeg3/modules/codec/avcodec/video.c
278 --- vlc-2.2.2/modules/codec/avcodec/video.c     2015-10-21 19:48:45.000000000 +0200
279 +++ vlc-2.2.2.ffmpeg3/modules/codec/avcodec/video.c     2016-03-24 14:47:01.769097935 +0100
280 @@ -108,8 +108,8 @@
281  static int  ffmpeg_GetFrameBuf    ( struct AVCodecContext *, AVFrame * );
282  static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );
283  #endif
284 -static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
285 -                                          const enum PixelFormat * );
286 +static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *,
287 +                                            const enum AVPixelFormat * );
288  
289  static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
290  {
291 @@ -234,7 +234,7 @@
292      p_sys->p_codec = p_codec;
293      p_sys->i_codec_id = i_codec_id;
294      p_sys->psz_namecodec = psz_namecodec;
295 -    p_sys->p_ff_pic = avcodec_alloc_frame();
296 +    p_sys->p_ff_pic = av_frame_alloc();
297      p_sys->b_delayed_open = true;
298      p_sys->p_va = NULL;
299      vlc_sem_init( &p_sys->sem_mt, 0 );
300 @@ -446,7 +446,7 @@
301      if( ffmpeg_OpenCodec( p_dec ) < 0 )
302      {
303          msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
304 -        avcodec_free_frame( &p_sys->p_ff_pic );
305 +        av_frame_free( &p_sys->p_ff_pic );
306          vlc_sem_destroy( &p_sys->sem_mt );
307          free( p_sys );
308          return VLC_EGENERIC;
309 @@ -826,7 +826,7 @@
310      wait_mt( p_sys );
311  
312      if( p_sys->p_ff_pic )
313 -        avcodec_free_frame( &p_sys->p_ff_pic );
314 +        av_frame_free( &p_sys->p_ff_pic );
315  
316      if( p_sys->p_va )
317          vlc_va_Delete( p_sys->p_va );
318 @@ -1004,7 +1004,7 @@
319      if (GetVlcChroma(&dec->fmt_out.video, ctx->pix_fmt) != VLC_SUCCESS)
320          return NULL;
321      dec->fmt_out.i_codec = dec->fmt_out.video.i_chroma;
322 -    if (ctx->pix_fmt == PIX_FMT_PAL8)
323 +    if (ctx->pix_fmt == AV_PIX_FMT_PAL8)
324          return NULL;
325  
326      int width = frame->width;
327 @@ -1180,7 +1180,7 @@
328      if (GetVlcChroma(&p_dec->fmt_out.video, p_context->pix_fmt) != VLC_SUCCESS)
329          goto no_dr;
330  
331 -    if (p_context->pix_fmt == PIX_FMT_PAL8)
332 +    if (p_context->pix_fmt == AV_PIX_FMT_PAL8)
333          goto no_dr;
334  
335      p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
336 @@ -1215,7 +1215,7 @@
337              goto no_dr;
338      }
339  
340 -    if( p_context->pix_fmt == PIX_FMT_YUV422P )
341 +    if( p_context->pix_fmt == AV_PIX_FMT_YUV422P )
342      {
343          if( 2 * p_pic->p[1].i_pitch != p_pic->p[0].i_pitch ||
344              2 * p_pic->p[2].i_pitch != p_pic->p[0].i_pitch )
345 @@ -1313,8 +1313,8 @@
346  }
347  #endif
348  
349 -static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
350 -                                          const enum PixelFormat *pi_fmt )
351 +static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
352 +                                            const enum AVPixelFormat *pi_fmt )
353  {
354      decoder_t *p_dec = p_context->opaque;
355      decoder_sys_t *p_sys = p_dec->p_sys;
356 @@ -1325,7 +1325,7 @@
357  
358      /* Enumerate available formats */
359      bool can_hwaccel = false;
360 -    for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ )
361 +    for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
362      {
363          const AVPixFmtDescriptor *dsc = av_pix_fmt_desc_get(pi_fmt[i]);
364          if (dsc == NULL)
365 @@ -1341,6 +1341,15 @@
366      if (!can_hwaccel)
367          goto end;
368  
369 +#if (LIBAVCODEC_VERSION_MICRO >= 100) /* FFmpeg only */
370 +    if (p_context->active_thread_type)
371 +    {
372 +        msg_Warn(p_dec, "thread type %d: disabling hardware acceleration",
373 +                 p_context->active_thread_type);
374 +        goto end;
375 +    }
376 +#endif
377 +
378      /* Profile and level information is needed now.
379       * TODO: avoid code duplication with avcodec.c */
380      if( p_context->profile != FF_PROFILE_UNKNOWN)
381 @@ -1352,7 +1361,7 @@
382      if( p_va == NULL )
383          goto end;
384  
385 -    for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ )
386 +    for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
387      {
388          if( p_va->pix_fmt != pi_fmt[i] )
389              continue;
390 diff -ur vlc-2.2.2/modules/video_chroma/swscale.c vlc-2.2.2.ffmpeg3/modules/video_chroma/swscale.c
391 --- vlc-2.2.2/modules/video_chroma/swscale.c    2015-10-21 19:48:45.000000000 +0200
392 +++ vlc-2.2.2.ffmpeg3/modules/video_chroma/swscale.c    2016-03-24 14:42:39.442521648 +0100
393 @@ -36,6 +36,7 @@
394  #include <vlc_cpu.h>
395  
396  #include <libswscale/swscale.h>
397 +#include <libswscale/version.h>
398  
399  #ifdef __APPLE__
400  # include <TargetConditionals.h>
401 @@ -235,6 +236,7 @@
402  {
403      int i_sws_cpu = 0;
404  
405 +#if LIBSWSCALE_VERSION_MAJOR < 4
406  #if defined(__i386__) || defined(__x86_64__)
407      if( vlc_CPU_MMX() )
408          i_sws_cpu |= SWS_CPU_CAPS_MMX;
409 @@ -248,6 +250,7 @@
410      if( vlc_CPU_ALTIVEC() )
411          i_sws_cpu |= SWS_CPU_CAPS_ALTIVEC;
412  #endif
413 +#endif
414  
415      return i_sws_cpu;
416  }
417 @@ -257,35 +260,35 @@
418      switch( fmt )
419      {
420      case VLC_CODEC_YUV422A:
421 -        *pi_fmt = PIX_FMT_YUV422P;
422 +        *pi_fmt = AV_PIX_FMT_YUV422P;
423          *pb_has_a = true;
424          break;
425      case VLC_CODEC_YUV420A:
426 -        *pi_fmt = PIX_FMT_YUV420P;
427 +        *pi_fmt = AV_PIX_FMT_YUV420P;
428          *pb_has_a = true;
429          break;
430      case VLC_CODEC_YUVA:
431 -        *pi_fmt = PIX_FMT_YUV444P;
432 +        *pi_fmt = AV_PIX_FMT_YUV444P;
433          *pb_has_a = true;
434          break;
435      case VLC_CODEC_RGBA:
436 -        *pi_fmt = PIX_FMT_BGR32;
437 +        *pi_fmt = AV_PIX_FMT_BGR32;
438          *pb_has_a = true;
439          break;
440      case VLC_CODEC_ARGB:
441 -        *pi_fmt = PIX_FMT_BGR32_1;
442 +        *pi_fmt = AV_PIX_FMT_BGR32_1;
443          *pb_has_a = true;
444          break;
445      case VLC_CODEC_BGRA:
446 -        *pi_fmt = PIX_FMT_RGB32;
447 +        *pi_fmt = AV_PIX_FMT_RGB32;
448          *pb_has_a = true;
449          break;
450      case VLC_CODEC_YV12:
451 -        *pi_fmt = PIX_FMT_YUV420P;
452 +        *pi_fmt = AV_PIX_FMT_YUV420P;
453          *pb_swap_uv = true;
454          break;
455      case VLC_CODEC_YV9:
456 -        *pi_fmt = PIX_FMT_YUV410P;
457 +        *pi_fmt = AV_PIX_FMT_YUV410P;
458          *pb_swap_uv = true;
459          break;
460      default:
461 @@ -314,7 +317,7 @@
462      {
463          if( p_fmti->i_chroma == VLC_CODEC_YUVP && ALLOW_YUVP )
464          {
465 -            i_fmti = i_fmto = PIX_FMT_GRAY8;
466 +            i_fmti = i_fmto = AV_PIX_FMT_GRAY8;
467              i_sws_flags = SWS_POINT;
468          }
469      }
470 @@ -327,9 +330,9 @@
471       * Without SWS_ACCURATE_RND the quality is really bad for some conversions */
472      switch( i_fmto )
473      {
474 -    case PIX_FMT_ARGB:
475 -    case PIX_FMT_RGBA:
476 -    case PIX_FMT_ABGR:
477 +    case AV_PIX_FMT_ARGB:
478 +    case AV_PIX_FMT_RGBA:
479 +    case AV_PIX_FMT_ABGR:
480          i_sws_flags |= SWS_ACCURATE_RND;
481          break;
482      }
483 @@ -403,8 +406,8 @@
484      const unsigned i_fmto_visible_width = p_fmto->i_visible_width * p_sys->i_extend_factor;
485      for( int n = 0; n < (cfg.b_has_a ? 2 : 1); n++ )
486      {
487 -        const int i_fmti = n == 0 ? cfg.i_fmti : PIX_FMT_GRAY8;
488 -        const int i_fmto = n == 0 ? cfg.i_fmto : PIX_FMT_GRAY8;
489 +        const int i_fmti = n == 0 ? cfg.i_fmti : AV_PIX_FMT_GRAY8;
490 +        const int i_fmto = n == 0 ? cfg.i_fmto : AV_PIX_FMT_GRAY8;
491          struct SwsContext *ctx;
492  
493          ctx = sws_getContext( i_fmti_visible_width, p_fmti->i_visible_height, i_fmti,
This page took 0.103845 seconds and 4 git commands to generate.