package/x11r7/xdriver_xf86-video-openchrome: bump version to 0.5.0
[buildroot-gz.git] / package / kodi / 0006-ffmpeg30.patch
blob9164d48ad71a80b28b67c0ec8719abcee24f6e68
1 Add support for ffmpeg 3.0
3 Changes from original commit are only in file paths & quilt refresh.
5 commit c31b7d374062f87c7512d9872cbceac920465913
6 Author: Philip Langdale <philipl@overt.org>
7 Date: Mon Sep 21 19:49:36 2015 -0700
9 ffmpeg: Update AVPixelFormat and AV_PIX_FMT_* to compile with master
11 The deprecated PixelFormat and PIX_FMT_* names have been removed in
12 ffmpeg master.
14 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
15 [Downloaded from
16 https://gitweb.gentoo.org/repo/gentoo.git/tree/media-tv/kodi/files/kodi-16-ffmpeg3.patch]
18 Index: xbmc-16.0-Jarvis/xbmc/cores/FFmpeg.h
19 ===================================================================
20 --- xbmc-16.0-Jarvis.orig/xbmc/cores/FFmpeg.h
21 +++ xbmc-16.0-Jarvis/xbmc/cores/FFmpeg.h
22 @@ -24,7 +24,6 @@
23 #include "utils/CPUInfo.h"
25 extern "C" {
26 -#include "libswscale/swscale.h"
27 #include "libavcodec/avcodec.h"
28 #include "libavformat/avformat.h"
29 #include "libavutil/avutil.h"
30 @@ -33,23 +32,6 @@ extern "C" {
31 #include "libpostproc/postprocess.h"
34 -inline int SwScaleCPUFlags()
36 - unsigned int cpuFeatures = g_cpuInfo.GetCPUFeatures();
37 - int flags = 0;
39 - if (cpuFeatures & CPU_FEATURE_MMX)
40 - flags |= SWS_CPU_CAPS_MMX;
41 - if (cpuFeatures & CPU_FEATURE_MMX2)
42 - flags |= SWS_CPU_CAPS_MMX2;
43 - if (cpuFeatures & CPU_FEATURE_3DNOW)
44 - flags |= SWS_CPU_CAPS_3DNOW;
45 - if (cpuFeatures & CPU_FEATURE_ALTIVEC)
46 - flags |= SWS_CPU_CAPS_ALTIVEC;
48 - return flags;
51 inline int PPCPUFlags()
53 unsigned int cpuFeatures = g_cpuInfo.GetCPUFeatures();
54 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
55 ===================================================================
56 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
57 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
58 @@ -39,7 +39,7 @@ extern "C" {
59 #include "libswscale/swscale.h"
62 -// allocate a new picture (PIX_FMT_YUV420P)
63 +// allocate a new picture (AV_PIX_FMT_YUV420P)
64 DVDVideoPicture* CDVDCodecUtils::AllocatePicture(int iWidth, int iHeight)
66 DVDVideoPicture* pPicture = new DVDVideoPicture;
67 @@ -264,13 +264,13 @@ DVDVideoPicture* CDVDCodecUtils::Convert
69 int dstformat;
70 if (format == RENDER_FMT_UYVY422)
71 - dstformat = PIX_FMT_UYVY422;
72 + dstformat = AV_PIX_FMT_UYVY422;
73 else
74 - dstformat = PIX_FMT_YUYV422;
75 + dstformat = AV_PIX_FMT_YUYV422;
77 - struct SwsContext *ctx = sws_getContext(pSrc->iWidth, pSrc->iHeight, PIX_FMT_YUV420P,
78 + struct SwsContext *ctx = sws_getContext(pSrc->iWidth, pSrc->iHeight, AV_PIX_FMT_YUV420P,
79 pPicture->iWidth, pPicture->iHeight, (AVPixelFormat)dstformat,
80 - SWS_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
81 + SWS_BILINEAR, NULL, NULL, NULL);
82 sws_scale(ctx, src, srcStride, 0, pSrc->iHeight, dst, dstStride);
83 sws_freeContext(ctx);
85 @@ -403,25 +403,25 @@ double CDVDCodecUtils::NormalizeFramedur
88 struct EFormatMap {
89 - PixelFormat pix_fmt;
90 + AVPixelFormat pix_fmt;
91 ERenderFormat format;
94 static const EFormatMap g_format_map[] = {
95 - { PIX_FMT_YUV420P, RENDER_FMT_YUV420P }
96 -, { PIX_FMT_YUVJ420P, RENDER_FMT_YUV420P }
97 -, { PIX_FMT_YUV420P10, RENDER_FMT_YUV420P10 }
98 -, { PIX_FMT_YUV420P16, RENDER_FMT_YUV420P16 }
99 -, { PIX_FMT_UYVY422, RENDER_FMT_UYVY422 }
100 -, { PIX_FMT_YUYV422, RENDER_FMT_YUYV422 }
101 -, { PIX_FMT_VAAPI_VLD, RENDER_FMT_VAAPI }
102 -, { PIX_FMT_DXVA2_VLD, RENDER_FMT_DXVA }
103 -, { PIX_FMT_NONE , RENDER_FMT_NONE }
104 + { AV_PIX_FMT_YUV420P, RENDER_FMT_YUV420P }
105 +, { AV_PIX_FMT_YUVJ420P, RENDER_FMT_YUV420P }
106 +, { AV_PIX_FMT_YUV420P10, RENDER_FMT_YUV420P10 }
107 +, { AV_PIX_FMT_YUV420P16, RENDER_FMT_YUV420P16 }
108 +, { AV_PIX_FMT_UYVY422, RENDER_FMT_UYVY422 }
109 +, { AV_PIX_FMT_YUYV422, RENDER_FMT_YUYV422 }
110 +, { AV_PIX_FMT_VAAPI_VLD, RENDER_FMT_VAAPI }
111 +, { AV_PIX_FMT_DXVA2_VLD, RENDER_FMT_DXVA }
112 +, { AV_PIX_FMT_NONE , RENDER_FMT_NONE }
115 ERenderFormat CDVDCodecUtils::EFormatFromPixfmt(int fmt)
117 - for(const EFormatMap *p = g_format_map; p->pix_fmt != PIX_FMT_NONE; ++p)
118 + for(const EFormatMap *p = g_format_map; p->pix_fmt != AV_PIX_FMT_NONE; ++p)
120 if(p->pix_fmt == fmt)
121 return p->format;
122 @@ -431,10 +431,10 @@ ERenderFormat CDVDCodecUtils::EFormatFro
124 int CDVDCodecUtils::PixfmtFromEFormat(ERenderFormat fmt)
126 - for(const EFormatMap *p = g_format_map; p->pix_fmt != PIX_FMT_NONE; ++p)
127 + for(const EFormatMap *p = g_format_map; p->pix_fmt != AV_PIX_FMT_NONE; ++p)
129 if(p->format == fmt)
130 return p->pix_fmt;
132 - return PIX_FMT_NONE;
133 + return AV_PIX_FMT_NONE;
135 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
136 ===================================================================
137 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
138 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
139 @@ -77,8 +77,8 @@ enum DecoderState
140 STATE_SW_MULTI
143 -enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
144 - , const PixelFormat * fmt )
145 +enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
146 + , const AVPixelFormat * fmt )
148 CDVDVideoCodecFFmpeg* ctx = (CDVDVideoCodecFFmpeg*)avctx->opaque;
150 @@ -104,8 +104,8 @@ enum PixelFormat CDVDVideoCodecFFmpeg::G
151 avctx->hwaccel_context = 0;
154 - const PixelFormat * cur = fmt;
155 - while(*cur != PIX_FMT_NONE)
156 + const AVPixelFormat * cur = fmt;
157 + while(*cur != AV_PIX_FMT_NONE)
159 #ifdef HAVE_LIBVDPAU
160 if(VDPAU::CDecoder::IsVDPAUFormat(*cur) && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDPAU))
161 @@ -137,7 +137,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::G
162 #endif
163 #ifdef HAVE_LIBVA
164 // mpeg4 vaapi decoding is disabled
165 - if(*cur == PIX_FMT_VAAPI_VLD && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVAAPI))
166 + if(*cur == AV_PIX_FMT_VAAPI_VLD && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVAAPI))
168 VAAPI::CDecoder* dec = new VAAPI::CDecoder();
169 if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount) == true)
170 @@ -214,11 +214,11 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStre
172 for(std::vector<ERenderFormat>::iterator it = options.m_formats.begin(); it != options.m_formats.end(); ++it)
174 - m_formats.push_back((PixelFormat)CDVDCodecUtils::PixfmtFromEFormat(*it));
175 + m_formats.push_back((AVPixelFormat)CDVDCodecUtils::PixfmtFromEFormat(*it));
176 if(*it == RENDER_FMT_YUV420P)
177 - m_formats.push_back(PIX_FMT_YUVJ420P);
178 + m_formats.push_back(AV_PIX_FMT_YUVJ420P);
180 - m_formats.push_back(PIX_FMT_NONE); /* always add none to get a terminated list in ffmpeg world */
181 + m_formats.push_back(AV_PIX_FMT_NONE); /* always add none to get a terminated list in ffmpeg world */
183 pCodec = avcodec_find_decoder(hints.codec);
185 @@ -655,7 +655,7 @@ bool CDVDVideoCodecFFmpeg::GetPictureCom
186 pDvdVideoPicture->color_transfer = m_pCodecContext->color_trc;
187 pDvdVideoPicture->color_matrix = m_pCodecContext->colorspace;
188 if(m_pCodecContext->color_range == AVCOL_RANGE_JPEG
189 - || m_pCodecContext->pix_fmt == PIX_FMT_YUVJ420P)
190 + || m_pCodecContext->pix_fmt == AV_PIX_FMT_YUVJ420P)
191 pDvdVideoPicture->color_range = 1;
192 else
193 pDvdVideoPicture->color_range = 0;
194 @@ -738,8 +738,8 @@ bool CDVDVideoCodecFFmpeg::GetPicture(DV
195 pDvdVideoPicture->iFlags |= pDvdVideoPicture->data[0] ? 0 : DVP_FLAG_DROPPED;
196 pDvdVideoPicture->extended_format = 0;
198 - PixelFormat pix_fmt;
199 - pix_fmt = (PixelFormat)m_pFrame->format;
200 + AVPixelFormat pix_fmt;
201 + pix_fmt = (AVPixelFormat)m_pFrame->format;
203 pDvdVideoPicture->format = CDVDCodecUtils::EFormatFromPixfmt(pix_fmt);
204 return true;
205 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
206 ===================================================================
207 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
208 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h
209 @@ -46,7 +46,7 @@ public:
210 public:
211 IHardwareDecoder() {}
212 virtual ~IHardwareDecoder() {};
213 - virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat, unsigned int surfaces) = 0;
214 + virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces) = 0;
215 virtual int Decode (AVCodecContext* avctx, AVFrame* frame) = 0;
216 virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture) = 0;
217 virtual int Check (AVCodecContext* avctx) = 0;
218 @@ -77,7 +77,7 @@ public:
219 void SetHardware(IHardwareDecoder* hardware);
221 protected:
222 - static enum PixelFormat GetFormat(struct AVCodecContext * avctx, const PixelFormat * fmt);
223 + static enum AVPixelFormat GetFormat(struct AVCodecContext * avctx, const AVPixelFormat * fmt);
225 int FilterOpen(const std::string& filters, bool scale);
226 void FilterClose();
227 @@ -119,7 +119,7 @@ protected:
228 int m_iLastKeyframe;
229 double m_dts;
230 bool m_started;
231 - std::vector<PixelFormat> m_formats;
232 + std::vector<AVPixelFormat> m_formats;
233 double m_decoderPts;
234 int m_skippedDeint;
235 bool m_requestSkipDeint;
236 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
237 ===================================================================
238 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
239 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp
240 @@ -554,11 +554,11 @@ void CDVDVideoCodecVDA::DisplayQueuePop(
242 void CDVDVideoCodecVDA::UYVY422_to_YUV420P(uint8_t *yuv422_ptr, int yuv422_stride, DVDVideoPicture *picture)
244 - // convert PIX_FMT_UYVY422 to PIX_FMT_YUV420P.
245 + // convert AV_PIX_FMT_UYVY422 to AV_PIX_FMT_YUV420P.
246 struct SwsContext *swcontext = sws_getContext(
247 - m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_UYVY422,
248 - m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_YUV420P,
249 - SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
250 + m_videobuffer.iWidth, m_videobuffer.iHeight, AV_PIX_FMT_UYVY422,
251 + m_videobuffer.iWidth, m_videobuffer.iHeight, AV_PIX_FMT_YUV420P,
252 + SWS_FAST_BILINEAR, NULL, NULL, NULL);
253 if (swcontext)
255 uint8_t *src[] = { yuv422_ptr, 0, 0, 0 };
256 @@ -574,11 +574,11 @@ void CDVDVideoCodecVDA::UYVY422_to_YUV42
258 void CDVDVideoCodecVDA::BGRA_to_YUV420P(uint8_t *bgra_ptr, int bgra_stride, DVDVideoPicture *picture)
260 - // convert PIX_FMT_BGRA to PIX_FMT_YUV420P.
261 + // convert AV_PIX_FMT_BGRA to AV_PIX_FMT_YUV420P.
262 struct SwsContext *swcontext = sws_getContext(
263 - m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_BGRA,
264 - m_videobuffer.iWidth, m_videobuffer.iHeight, PIX_FMT_YUV420P,
265 - SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
266 + m_videobuffer.iWidth, m_videobuffer.iHeight, AV_PIX_FMT_BGRA,
267 + m_videobuffer.iWidth, m_videobuffer.iHeight, AV_PIX_FMT_YUV420P,
268 + SWS_FAST_BILINEAR, NULL, NULL, NULL);
269 if (swcontext)
271 uint8_t *src[] = { bgra_ptr, 0, 0, 0 };
272 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
273 ===================================================================
274 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
275 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
276 @@ -886,7 +886,7 @@ static bool CheckCompatibility(AVCodecCo
277 return true;
280 -bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum PixelFormat fmt, unsigned int surfaces)
281 +bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixelFormat fmt, unsigned int surfaces)
283 if (!CheckCompatibility(avctx))
284 return false;
285 @@ -1135,9 +1135,9 @@ bool CDecoder::OpenDecoder()
286 return true;
289 -bool CDecoder::Supports(enum PixelFormat fmt)
290 +bool CDecoder::Supports(enum AVPixelFormat fmt)
292 - if(fmt == PIX_FMT_DXVA2_VLD)
293 + if(fmt == AV_PIX_FMT_DXVA2_VLD)
294 return true;
295 return false;
297 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
298 ===================================================================
299 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
300 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
301 @@ -141,7 +141,7 @@ class CDecoder
302 public:
303 CDecoder();
304 ~CDecoder();
305 - virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat, unsigned int surfaces);
306 + virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces);
307 virtual int Decode (AVCodecContext* avctx, AVFrame* frame);
308 virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture);
309 virtual int Check (AVCodecContext* avctx);
310 @@ -154,7 +154,7 @@ public:
311 int GetBuffer(AVCodecContext *avctx, AVFrame *pic, int flags);
312 void RelBuffer(uint8_t *data);
314 - static bool Supports(enum PixelFormat fmt);
315 + static bool Supports(enum AVPixelFormat fmt);
317 void CloseDXVADecoder();
319 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
320 ===================================================================
321 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
322 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
323 @@ -479,7 +479,7 @@ CDecoder::~CDecoder()
324 Close();
327 -bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat fmt, unsigned int surfaces)
328 +bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat fmt, unsigned int surfaces)
330 // don't support broken wrappers by default
331 // nvidia cards with a vaapi to vdpau wrapper
332 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
333 ===================================================================
334 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
335 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
336 @@ -406,7 +406,7 @@ public:
337 CDecoder();
338 virtual ~CDecoder();
340 - virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat, unsigned int surfaces = 0);
341 + virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces = 0);
342 virtual int Decode (AVCodecContext* avctx, AVFrame* frame);
343 virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture);
344 virtual void Reset();
345 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.cpp
346 ===================================================================
347 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.cpp
348 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.cpp
349 @@ -186,7 +186,7 @@ void CDecoder::Close()
350 m_bitstream = NULL;
353 -bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum PixelFormat fmt, unsigned int surfaces)
354 +bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixelFormat fmt, unsigned int surfaces)
356 Close();
358 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h
359 ===================================================================
360 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h
361 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDA.h
362 @@ -35,7 +35,7 @@ class CDecoder
363 public:
364 CDecoder();
365 ~CDecoder();
366 - virtual bool Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat, unsigned int surfaces = 0);
367 + virtual bool Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces = 0);
368 virtual int Decode(AVCodecContext* avctx, AVFrame* frame);
369 virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture);
370 virtual int Check(AVCodecContext* avctx);
371 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
372 ===================================================================
373 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
374 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
375 @@ -486,7 +486,7 @@ CDecoder::CDecoder() : m_vdpauOutput(&m_
376 m_vdpauConfig.context = 0;
379 -bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat fmt, unsigned int surfaces)
380 +bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat fmt, unsigned int surfaces)
382 // check if user wants to decode this format with VDPAU
383 std::string gpuvendor = g_Windowing.GetRenderVendor();
384 @@ -760,7 +760,7 @@ int CDecoder::Check(AVCodecContext* avct
385 return 0;
388 -bool CDecoder::IsVDPAUFormat(PixelFormat format)
389 +bool CDecoder::IsVDPAUFormat(AVPixelFormat format)
391 if (format == AV_PIX_FMT_VDPAU)
392 return true;
393 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
394 ===================================================================
395 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
396 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
397 @@ -556,7 +556,7 @@ public:
398 CDecoder();
399 virtual ~CDecoder();
401 - virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum PixelFormat, unsigned int surfaces = 0);
402 + virtual bool Open (AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces = 0);
403 virtual int Decode (AVCodecContext* avctx, AVFrame* frame);
404 virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture);
405 virtual void Reset();
406 @@ -571,7 +571,7 @@ public:
407 bool Supports(VdpVideoMixerFeature feature);
408 bool Supports(EINTERLACEMETHOD method);
409 EINTERLACEMETHOD AutoInterlaceMethod();
410 - static bool IsVDPAUFormat(PixelFormat fmt);
411 + static bool IsVDPAUFormat(AVPixelFormat fmt);
413 static void FFReleaseBuffer(void *opaque, uint8_t *data);
414 static int FFGetBuffer(AVCodecContext *avctx, AVFrame *pic, int flags);
415 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
416 ===================================================================
417 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
418 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
419 @@ -1638,7 +1638,7 @@ void CDVDDemuxFFmpeg::ParsePacket(AVPack
421 // for video we need a decoder to get desired information into codec context
422 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->codec->extradata &&
423 - (!st->codec->width || st->codec->pix_fmt == PIX_FMT_NONE))
424 + (!st->codec->width || st->codec->pix_fmt == AV_PIX_FMT_NONE))
426 // open a decoder, it will be cleared down by ffmpeg on closing the stream
427 if (!st->codec->codec)
428 @@ -1695,7 +1695,7 @@ bool CDVDDemuxFFmpeg::IsVideoReady()
429 st = m_pFormatContext->streams[idx];
430 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
432 - if (st->codec->width && st->codec->pix_fmt != PIX_FMT_NONE)
433 + if (st->codec->width && st->codec->pix_fmt != AV_PIX_FMT_NONE)
434 return true;
435 hasVideo = true;
437 @@ -1708,7 +1708,7 @@ bool CDVDDemuxFFmpeg::IsVideoReady()
438 st = m_pFormatContext->streams[i];
439 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
441 - if (st->codec->width && st->codec->pix_fmt != PIX_FMT_NONE)
442 + if (st->codec->width && st->codec->pix_fmt != AV_PIX_FMT_NONE)
443 return true;
444 hasVideo = true;
446 Index: xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDFileInfo.cpp
447 ===================================================================
448 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDFileInfo.cpp
449 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDFileInfo.cpp
450 @@ -275,7 +275,7 @@ bool CDVDFileInfo::ExtractThumb(const st
452 uint8_t *pOutBuf = new uint8_t[nWidth * nHeight * 4];
453 struct SwsContext *context = sws_getContext(picture.iWidth, picture.iHeight,
454 - PIX_FMT_YUV420P, nWidth, nHeight, PIX_FMT_BGRA, SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
455 + AV_PIX_FMT_YUV420P, nWidth, nHeight, AV_PIX_FMT_BGRA, SWS_FAST_BILINEAR, NULL, NULL, NULL);
457 if (context)
459 Index: xbmc-16.0-Jarvis/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
460 ===================================================================
461 --- xbmc-16.0-Jarvis.orig/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
462 +++ xbmc-16.0-Jarvis/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
463 @@ -2932,7 +2932,7 @@ void CLinuxRendererGL::ToRGBFrame(YV12Im
465 else if (m_format == RENDER_FMT_NV12)
467 - srcFormat = PIX_FMT_NV12;
468 + srcFormat = AV_PIX_FMT_NV12;
469 for (int i = 0; i < 2; i++)
471 src[i] = im->plane[i];
472 @@ -2941,13 +2941,13 @@ void CLinuxRendererGL::ToRGBFrame(YV12Im
474 else if (m_format == RENDER_FMT_YUYV422)
476 - srcFormat = PIX_FMT_YUYV422;
477 + srcFormat = AV_PIX_FMT_YUYV422;
478 src[0] = im->plane[0];
479 srcStride[0] = im->stride[0];
481 else if (m_format == RENDER_FMT_UYVY422)
483 - srcFormat = PIX_FMT_UYVY422;
484 + srcFormat = AV_PIX_FMT_UYVY422;
485 src[0] = im->plane[0];
486 srcStride[0] = im->stride[0];
488 @@ -2965,8 +2965,8 @@ void CLinuxRendererGL::ToRGBFrame(YV12Im
490 m_context = sws_getCachedContext(m_context,
491 im->width, im->height, (AVPixelFormat)srcFormat,
492 - im->width, im->height, (AVPixelFormat)PIX_FMT_BGRA,
493 - SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
494 + im->width, im->height, (AVPixelFormat)AV_PIX_FMT_BGRA,
495 + SWS_FAST_BILINEAR, NULL, NULL, NULL);
497 uint8_t *dst[] = { m_rgbBuffer, 0, 0, 0 };
498 int dstStride[] = { (int)m_sourceWidth * 4, 0, 0, 0 };
499 @@ -2995,7 +2995,7 @@ void CLinuxRendererGL::ToRGBFields(YV12I
501 if (m_format == RENDER_FMT_YUV420P)
503 - srcFormat = PIX_FMT_YUV420P;
504 + srcFormat = AV_PIX_FMT_YUV420P;
505 for (int i = 0; i < 3; i++)
507 srcTop[i] = im->plane[i];
508 @@ -3006,7 +3006,7 @@ void CLinuxRendererGL::ToRGBFields(YV12I
510 else if (m_format == RENDER_FMT_NV12)
512 - srcFormat = PIX_FMT_NV12;
513 + srcFormat = AV_PIX_FMT_NV12;
514 for (int i = 0; i < 2; i++)
516 srcTop[i] = im->plane[i];
517 @@ -3017,7 +3017,7 @@ void CLinuxRendererGL::ToRGBFields(YV12I
519 else if (m_format == RENDER_FMT_YUYV422)
521 - srcFormat = PIX_FMT_YUYV422;
522 + srcFormat = AV_PIX_FMT_YUYV422;
523 srcTop[0] = im->plane[0];
524 srcStrideTop[0] = im->stride[0] * 2;
525 srcBot[0] = im->plane[0] + im->stride[0];
526 @@ -3025,7 +3025,7 @@ void CLinuxRendererGL::ToRGBFields(YV12I
528 else if (m_format == RENDER_FMT_UYVY422)
530 - srcFormat = PIX_FMT_UYVY422;
531 + srcFormat = AV_PIX_FMT_UYVY422;
532 srcTop[0] = im->plane[0];
533 srcStrideTop[0] = im->stride[0] * 2;
534 srcBot[0] = im->plane[0] + im->stride[0];
535 @@ -3045,8 +3045,8 @@ void CLinuxRendererGL::ToRGBFields(YV12I
537 m_context = sws_getCachedContext(m_context,
538 im->width, im->height >> 1, (AVPixelFormat)srcFormat,
539 - im->width, im->height >> 1, (AVPixelFormat)PIX_FMT_BGRA,
540 - SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
541 + im->width, im->height >> 1, (AVPixelFormat)AV_PIX_FMT_BGRA,
542 + SWS_FAST_BILINEAR, NULL, NULL, NULL);
543 uint8_t *dstTop[] = { m_rgbBuffer, 0, 0, 0 };
544 uint8_t *dstBot[] = { m_rgbBuffer + m_sourceWidth * m_sourceHeight * 2, 0, 0, 0 };
545 int dstStride[] = { (int)m_sourceWidth * 4, 0, 0, 0 };
546 Index: xbmc-16.0-Jarvis/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
547 ===================================================================
548 --- xbmc-16.0-Jarvis.orig/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
549 +++ xbmc-16.0-Jarvis/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
550 @@ -2006,8 +2006,8 @@ void CLinuxRendererGLES::UploadYV12Textu
551 #endif
553 m_sw_context = sws_getCachedContext(m_sw_context,
554 - im->width, im->height, PIX_FMT_YUV420P,
555 - im->width, im->height, PIX_FMT_RGBA,
556 + im->width, im->height, AV_PIX_FMT_YUV420P,
557 + im->width, im->height, AV_PIX_FMT_RGBA,
558 SWS_FAST_BILINEAR, NULL, NULL, NULL);
560 uint8_t *src[] = { im->plane[0], im->plane[1], im->plane[2], 0 };
561 Index: xbmc-16.0-Jarvis/xbmc/cores/VideoRenderers/WinRenderer.cpp
562 ===================================================================
563 --- xbmc-16.0-Jarvis.orig/xbmc/cores/VideoRenderers/WinRenderer.cpp
564 +++ xbmc-16.0-Jarvis/xbmc/cores/VideoRenderers/WinRenderer.cpp
565 @@ -94,16 +94,16 @@ CWinRenderer::~CWinRenderer()
566 UnInit();
569 -static enum PixelFormat PixelFormatFromFormat(ERenderFormat format)
570 +static enum AVPixelFormat PixelFormatFromFormat(ERenderFormat format)
572 - if (format == RENDER_FMT_DXVA) return PIX_FMT_NV12;
573 - if (format == RENDER_FMT_YUV420P) return PIX_FMT_YUV420P;
574 - if (format == RENDER_FMT_YUV420P10) return PIX_FMT_YUV420P10;
575 - if (format == RENDER_FMT_YUV420P16) return PIX_FMT_YUV420P16;
576 - if (format == RENDER_FMT_NV12) return PIX_FMT_NV12;
577 - if (format == RENDER_FMT_UYVY422) return PIX_FMT_UYVY422;
578 - if (format == RENDER_FMT_YUYV422) return PIX_FMT_YUYV422;
579 - return PIX_FMT_NONE;
580 + if (format == RENDER_FMT_DXVA) return AV_PIX_FMT_NV12;
581 + if (format == RENDER_FMT_YUV420P) return AV_PIX_FMT_YUV420P;
582 + if (format == RENDER_FMT_YUV420P10) return AV_PIX_FMT_YUV420P10;
583 + if (format == RENDER_FMT_YUV420P16) return AV_PIX_FMT_YUV420P16;
584 + if (format == RENDER_FMT_NV12) return AV_PIX_FMT_NV12;
585 + if (format == RENDER_FMT_UYVY422) return AV_PIX_FMT_UYVY422;
586 + if (format == RENDER_FMT_YUYV422) return AV_PIX_FMT_YUYV422;
587 + return AV_PIX_FMT_NONE;
590 void CWinRenderer::ManageTextures()
591 @@ -719,13 +719,13 @@ void CWinRenderer::Render(DWORD flags)
593 void CWinRenderer::RenderSW()
595 - enum PixelFormat format = PixelFormatFromFormat(m_format);
596 + enum AVPixelFormat format = PixelFormatFromFormat(m_format);
598 // 1. convert yuv to rgb
599 m_sw_scale_ctx = sws_getCachedContext(m_sw_scale_ctx,
600 m_sourceWidth, m_sourceHeight, format,
601 - m_sourceWidth, m_sourceHeight, PIX_FMT_BGRA,
602 - SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
603 + m_sourceWidth, m_sourceHeight, AV_PIX_FMT_BGRA,
604 + SWS_FAST_BILINEAR, NULL, NULL, NULL);
606 YUVBuffer* buf = (YUVBuffer*)m_VideoBuffers[m_iYV12RenderBuffer];
608 Index: xbmc-16.0-Jarvis/xbmc/pictures/Picture.cpp
609 ===================================================================
610 --- xbmc-16.0-Jarvis.orig/xbmc/pictures/Picture.cpp
611 +++ xbmc-16.0-Jarvis/xbmc/pictures/Picture.cpp
612 @@ -342,9 +342,9 @@ bool CPicture::ScaleImage(uint8_t *in_pi
613 uint8_t *out_pixels, unsigned int out_width, unsigned int out_height, unsigned int out_pitch,
614 CPictureScalingAlgorithm::Algorithm scalingAlgorithm /* = CPictureScalingAlgorithm::NoAlgorithm */)
616 - struct SwsContext *context = sws_getContext(in_width, in_height, PIX_FMT_BGRA,
617 - out_width, out_height, PIX_FMT_BGRA,
618 - CPictureScalingAlgorithm::ToSwscale(scalingAlgorithm) | SwScaleCPUFlags(), NULL, NULL, NULL);
619 + struct SwsContext *context = sws_getContext(in_width, in_height, AV_PIX_FMT_BGRA,
620 + out_width, out_height, AV_PIX_FMT_BGRA,
621 + CPictureScalingAlgorithm::ToSwscale(scalingAlgorithm), NULL, NULL, NULL);
623 uint8_t *src[] = { in_pixels, 0, 0, 0 };
624 int srcStride[] = { (int)in_pitch, 0, 0, 0 };
625 Index: xbmc-16.0-Jarvis/xbmc/video/FFmpegVideoDecoder.cpp
626 ===================================================================
627 --- xbmc-16.0-Jarvis.orig/xbmc/video/FFmpegVideoDecoder.cpp
628 +++ xbmc-16.0-Jarvis/xbmc/video/FFmpegVideoDecoder.cpp
629 @@ -252,7 +252,7 @@ bool FFmpegVideoDecoder::nextFrame( CBas
630 return false;
632 // Due to a bug in swsscale we need to allocate one extra line of data
633 - if ( avpicture_alloc( m_pFrameRGB, PIX_FMT_RGB32, m_frameRGBwidth, m_frameRGBheight + 1 ) < 0 )
634 + if ( avpicture_alloc( m_pFrameRGB, AV_PIX_FMT_RGB32, m_frameRGBwidth, m_frameRGBheight + 1 ) < 0 )
635 return false;
638 @@ -287,7 +287,7 @@ bool FFmpegVideoDecoder::nextFrame( CBas
640 // We got the video frame, render it into the picture buffer
641 struct SwsContext * context = sws_getContext( m_pCodecCtx->width, m_pCodecCtx->height, m_pCodecCtx->pix_fmt,
642 - m_frameRGBwidth, m_frameRGBheight, PIX_FMT_RGB32, SWS_FAST_BILINEAR, NULL, NULL, NULL );
643 + m_frameRGBwidth, m_frameRGBheight, AV_PIX_FMT_RGB32, SWS_FAST_BILINEAR, NULL, NULL, NULL );
645 sws_scale( context, m_pFrame->data, m_pFrame->linesize, 0, m_pCodecCtx->height,
646 m_pFrameRGB->data, m_pFrameRGB->linesize );