add new arch m32c (newlib toolchain)
[openadk.git] / package / kodi / patches / patch-xbmc_cores_dvdplayer_DVDCodecs_DVDCodecUtils_cpp
blobcd6c53c417691f438d17af7f9c5253349540bd1d
1 --- xbmc-16.0-Jarvis.orig/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp      2016-02-20 16:21:19.000000000 +0100
2 +++ xbmc-16.0-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp   2016-03-19 18:38:18.610025667 +0100
3 @@ -39,7 +39,7 @@ extern "C" {
4  #include "libswscale/swscale.h"
5  }
6  
7 -// allocate a new picture (PIX_FMT_YUV420P)
8 +// allocate a new picture (AV_PIX_FMT_YUV420P)
9  DVDVideoPicture* CDVDCodecUtils::AllocatePicture(int iWidth, int iHeight)
10  {
11    DVDVideoPicture* pPicture = new DVDVideoPicture;
12 @@ -264,13 +264,13 @@ DVDVideoPicture* CDVDCodecUtils::Convert
14          int dstformat;
15          if (format == RENDER_FMT_UYVY422)
16 -          dstformat = PIX_FMT_UYVY422;
17 +          dstformat = AV_PIX_FMT_UYVY422;
18          else
19 -          dstformat = PIX_FMT_YUYV422;
20 +          dstformat = AV_PIX_FMT_YUYV422;
22 -        struct SwsContext *ctx = sws_getContext(pSrc->iWidth, pSrc->iHeight, PIX_FMT_YUV420P,
23 +        struct SwsContext *ctx = sws_getContext(pSrc->iWidth, pSrc->iHeight, AV_PIX_FMT_YUV420P,
24                                                             pPicture->iWidth, pPicture->iHeight, (AVPixelFormat)dstformat,
25 -                                                           SWS_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
26 +                                                           SWS_BILINEAR, NULL, NULL, NULL);
27          sws_scale(ctx, src, srcStride, 0, pSrc->iHeight, dst, dstStride);
28          sws_freeContext(ctx);
29        }
30 @@ -403,25 +403,25 @@ double CDVDCodecUtils::NormalizeFramedur
31  }
33  struct EFormatMap {
34 -  PixelFormat   pix_fmt;
35 +  AVPixelFormat   pix_fmt;
36    ERenderFormat format;
37  };
39  static const EFormatMap g_format_map[] = {
40 -   { PIX_FMT_YUV420P,     RENDER_FMT_YUV420P    }
41 -,  { PIX_FMT_YUVJ420P,    RENDER_FMT_YUV420P    }
42 -,  { PIX_FMT_YUV420P10,   RENDER_FMT_YUV420P10  }
43 -,  { PIX_FMT_YUV420P16,   RENDER_FMT_YUV420P16  }
44 -,  { PIX_FMT_UYVY422,     RENDER_FMT_UYVY422    }
45 -,  { PIX_FMT_YUYV422,     RENDER_FMT_YUYV422    }
46 -,  { PIX_FMT_VAAPI_VLD,   RENDER_FMT_VAAPI      }
47 -,  { PIX_FMT_DXVA2_VLD,   RENDER_FMT_DXVA       }
48 -,  { PIX_FMT_NONE     ,   RENDER_FMT_NONE       }
49 +   { AV_PIX_FMT_YUV420P,     RENDER_FMT_YUV420P    }
50 +,  { AV_PIX_FMT_YUVJ420P,    RENDER_FMT_YUV420P    }
51 +,  { AV_PIX_FMT_YUV420P10,   RENDER_FMT_YUV420P10  }
52 +,  { AV_PIX_FMT_YUV420P16,   RENDER_FMT_YUV420P16  }
53 +,  { AV_PIX_FMT_UYVY422,     RENDER_FMT_UYVY422    }
54 +,  { AV_PIX_FMT_YUYV422,     RENDER_FMT_YUYV422    }
55 +,  { AV_PIX_FMT_VAAPI_VLD,   RENDER_FMT_VAAPI      }
56 +,  { AV_PIX_FMT_DXVA2_VLD,   RENDER_FMT_DXVA       }
57 +,  { AV_PIX_FMT_NONE     ,   RENDER_FMT_NONE       }
58  };
60  ERenderFormat CDVDCodecUtils::EFormatFromPixfmt(int fmt)
61  {
62 -  for(const EFormatMap *p = g_format_map; p->pix_fmt != PIX_FMT_NONE; ++p)
63 +  for(const EFormatMap *p = g_format_map; p->pix_fmt != AV_PIX_FMT_NONE; ++p)
64    {
65      if(p->pix_fmt == fmt)
66        return p->format;
67 @@ -431,10 +431,10 @@ ERenderFormat CDVDCodecUtils::EFormatFro
69  int CDVDCodecUtils::PixfmtFromEFormat(ERenderFormat fmt)
70  {
71 -  for(const EFormatMap *p = g_format_map; p->pix_fmt != PIX_FMT_NONE; ++p)
72 +  for(const EFormatMap *p = g_format_map; p->pix_fmt != AV_PIX_FMT_NONE; ++p)
73    {
74      if(p->format == fmt)
75        return p->pix_fmt;
76    }
77 -  return PIX_FMT_NONE;
78 +  return AV_PIX_FMT_NONE;
79  }