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