Line 0
Link Here
|
|
|
1 |
--- fmt-conversion.c.orig 2013-07-09 16:33:12 UTC |
2 |
+++ fmt-conversion.c |
3 |
@@ -24,117 +24,117 @@ |
4 |
|
5 |
static const struct { |
6 |
int fmt; |
7 |
- enum PixelFormat pix_fmt; |
8 |
+ enum AVPixelFormat pix_fmt; |
9 |
} conversion_map[] = { |
10 |
- {IMGFMT_ARGB, PIX_FMT_ARGB}, |
11 |
- {IMGFMT_BGRA, PIX_FMT_BGRA}, |
12 |
- {IMGFMT_BGR24, PIX_FMT_BGR24}, |
13 |
- {IMGFMT_BGR16BE, PIX_FMT_RGB565BE}, |
14 |
- {IMGFMT_BGR16LE, PIX_FMT_RGB565LE}, |
15 |
- {IMGFMT_BGR15BE, PIX_FMT_RGB555BE}, |
16 |
- {IMGFMT_BGR15LE, PIX_FMT_RGB555LE}, |
17 |
- {IMGFMT_BGR12BE, PIX_FMT_RGB444BE}, |
18 |
- {IMGFMT_BGR12LE, PIX_FMT_RGB444LE}, |
19 |
- {IMGFMT_BGR8, PIX_FMT_RGB8}, |
20 |
- {IMGFMT_BGR4, PIX_FMT_RGB4}, |
21 |
- {IMGFMT_BGR1, PIX_FMT_MONOBLACK}, |
22 |
- {IMGFMT_RGB1, PIX_FMT_MONOBLACK}, |
23 |
- {IMGFMT_RG4B, PIX_FMT_BGR4_BYTE}, |
24 |
- {IMGFMT_BG4B, PIX_FMT_RGB4_BYTE}, |
25 |
- {IMGFMT_RGB48LE, PIX_FMT_RGB48LE}, |
26 |
- {IMGFMT_RGB48BE, PIX_FMT_RGB48BE}, |
27 |
- {IMGFMT_ABGR, PIX_FMT_ABGR}, |
28 |
- {IMGFMT_RGBA, PIX_FMT_RGBA}, |
29 |
- {IMGFMT_RGB24, PIX_FMT_RGB24}, |
30 |
- {IMGFMT_RGB16BE, PIX_FMT_BGR565BE}, |
31 |
- {IMGFMT_RGB16LE, PIX_FMT_BGR565LE}, |
32 |
- {IMGFMT_RGB15BE, PIX_FMT_BGR555BE}, |
33 |
- {IMGFMT_RGB15LE, PIX_FMT_BGR555LE}, |
34 |
- {IMGFMT_RGB12BE, PIX_FMT_BGR444BE}, |
35 |
- {IMGFMT_RGB12LE, PIX_FMT_BGR444LE}, |
36 |
- {IMGFMT_RGB8, PIX_FMT_BGR8}, |
37 |
- {IMGFMT_RGB4, PIX_FMT_BGR4}, |
38 |
- {IMGFMT_BGR8, PIX_FMT_PAL8}, |
39 |
- {IMGFMT_GBRP, PIX_FMT_GBRP}, |
40 |
- {IMGFMT_GBRP9, PIX_FMT_GBRP9}, |
41 |
- {IMGFMT_GBRP10, PIX_FMT_GBRP10}, |
42 |
- {IMGFMT_YUY2, PIX_FMT_YUYV422}, |
43 |
- {IMGFMT_UYVY, PIX_FMT_UYVY422}, |
44 |
- {IMGFMT_NV12, PIX_FMT_NV12}, |
45 |
- {IMGFMT_NV21, PIX_FMT_NV21}, |
46 |
- {IMGFMT_Y800, PIX_FMT_GRAY8}, |
47 |
- {IMGFMT_Y8, PIX_FMT_GRAY8}, |
48 |
- {IMGFMT_YVU9, PIX_FMT_YUV410P}, |
49 |
- {IMGFMT_IF09, PIX_FMT_YUV410P}, |
50 |
- {IMGFMT_YV12, PIX_FMT_YUV420P}, |
51 |
- {IMGFMT_I420, PIX_FMT_YUV420P}, |
52 |
- {IMGFMT_IYUV, PIX_FMT_YUV420P}, |
53 |
- {IMGFMT_411P, PIX_FMT_YUV411P}, |
54 |
- {IMGFMT_422P, PIX_FMT_YUV422P}, |
55 |
- {IMGFMT_444P, PIX_FMT_YUV444P}, |
56 |
- {IMGFMT_440P, PIX_FMT_YUV440P}, |
57 |
+ {IMGFMT_ARGB, AV_PIX_FMT_ARGB}, |
58 |
+ {IMGFMT_BGRA, AV_PIX_FMT_BGRA}, |
59 |
+ {IMGFMT_BGR24, AV_PIX_FMT_BGR24}, |
60 |
+ {IMGFMT_BGR16BE, AV_PIX_FMT_RGB565BE}, |
61 |
+ {IMGFMT_BGR16LE, AV_PIX_FMT_RGB565LE}, |
62 |
+ {IMGFMT_BGR15BE, AV_PIX_FMT_RGB555BE}, |
63 |
+ {IMGFMT_BGR15LE, AV_PIX_FMT_RGB555LE}, |
64 |
+ {IMGFMT_BGR12BE, AV_PIX_FMT_RGB444BE}, |
65 |
+ {IMGFMT_BGR12LE, AV_PIX_FMT_RGB444LE}, |
66 |
+ {IMGFMT_BGR8, AV_PIX_FMT_RGB8}, |
67 |
+ {IMGFMT_BGR4, AV_PIX_FMT_RGB4}, |
68 |
+ {IMGFMT_BGR1, AV_PIX_FMT_MONOBLACK}, |
69 |
+ {IMGFMT_RGB1, AV_PIX_FMT_MONOBLACK}, |
70 |
+ {IMGFMT_RG4B, AV_PIX_FMT_BGR4_BYTE}, |
71 |
+ {IMGFMT_BG4B, AV_PIX_FMT_RGB4_BYTE}, |
72 |
+ {IMGFMT_RGB48LE, AV_PIX_FMT_RGB48LE}, |
73 |
+ {IMGFMT_RGB48BE, AV_PIX_FMT_RGB48BE}, |
74 |
+ {IMGFMT_ABGR, AV_PIX_FMT_ABGR}, |
75 |
+ {IMGFMT_RGBA, AV_PIX_FMT_RGBA}, |
76 |
+ {IMGFMT_RGB24, AV_PIX_FMT_RGB24}, |
77 |
+ {IMGFMT_RGB16BE, AV_PIX_FMT_BGR565BE}, |
78 |
+ {IMGFMT_RGB16LE, AV_PIX_FMT_BGR565LE}, |
79 |
+ {IMGFMT_RGB15BE, AV_PIX_FMT_BGR555BE}, |
80 |
+ {IMGFMT_RGB15LE, AV_PIX_FMT_BGR555LE}, |
81 |
+ {IMGFMT_RGB12BE, AV_PIX_FMT_BGR444BE}, |
82 |
+ {IMGFMT_RGB12LE, AV_PIX_FMT_BGR444LE}, |
83 |
+ {IMGFMT_RGB8, AV_PIX_FMT_BGR8}, |
84 |
+ {IMGFMT_RGB4, AV_PIX_FMT_BGR4}, |
85 |
+ {IMGFMT_BGR8, AV_PIX_FMT_PAL8}, |
86 |
+ {IMGFMT_GBRP, AV_PIX_FMT_GBRP}, |
87 |
+ {IMGFMT_GBRP9, AV_PIX_FMT_GBRP9}, |
88 |
+ {IMGFMT_GBRP10, AV_PIX_FMT_GBRP10}, |
89 |
+ {IMGFMT_YUY2, AV_PIX_FMT_YUYV422}, |
90 |
+ {IMGFMT_UYVY, AV_PIX_FMT_UYVY422}, |
91 |
+ {IMGFMT_NV12, AV_PIX_FMT_NV12}, |
92 |
+ {IMGFMT_NV21, AV_PIX_FMT_NV21}, |
93 |
+ {IMGFMT_Y800, AV_PIX_FMT_GRAY8}, |
94 |
+ {IMGFMT_Y8, AV_PIX_FMT_GRAY8}, |
95 |
+ {IMGFMT_YVU9, AV_PIX_FMT_YUV410P}, |
96 |
+ {IMGFMT_IF09, AV_PIX_FMT_YUV410P}, |
97 |
+ {IMGFMT_YV12, AV_PIX_FMT_YUV420P}, |
98 |
+ {IMGFMT_I420, AV_PIX_FMT_YUV420P}, |
99 |
+ {IMGFMT_IYUV, AV_PIX_FMT_YUV420P}, |
100 |
+ {IMGFMT_411P, AV_PIX_FMT_YUV411P}, |
101 |
+ {IMGFMT_422P, AV_PIX_FMT_YUV422P}, |
102 |
+ {IMGFMT_444P, AV_PIX_FMT_YUV444P}, |
103 |
+ {IMGFMT_440P, AV_PIX_FMT_YUV440P}, |
104 |
|
105 |
- {IMGFMT_420A, PIX_FMT_YUVA420P}, |
106 |
+ {IMGFMT_420A, AV_PIX_FMT_YUVA420P}, |
107 |
|
108 |
- {IMGFMT_420P16_LE, PIX_FMT_YUV420P16LE}, |
109 |
- {IMGFMT_420P16_BE, PIX_FMT_YUV420P16BE}, |
110 |
- {IMGFMT_420P9_LE, PIX_FMT_YUV420P9LE}, |
111 |
- {IMGFMT_420P9_BE, PIX_FMT_YUV420P9BE}, |
112 |
- {IMGFMT_420P10_LE, PIX_FMT_YUV420P10LE}, |
113 |
- {IMGFMT_420P10_BE, PIX_FMT_YUV420P10BE}, |
114 |
- {IMGFMT_422P10_LE, PIX_FMT_YUV422P10LE}, |
115 |
- {IMGFMT_422P10_BE, PIX_FMT_YUV422P10BE}, |
116 |
- {IMGFMT_444P9_BE , PIX_FMT_YUV444P9BE}, |
117 |
- {IMGFMT_444P9_LE , PIX_FMT_YUV444P9LE}, |
118 |
- {IMGFMT_444P10_BE, PIX_FMT_YUV444P10BE}, |
119 |
- {IMGFMT_444P10_LE, PIX_FMT_YUV444P10LE}, |
120 |
- {IMGFMT_422P16_LE, PIX_FMT_YUV422P16LE}, |
121 |
- {IMGFMT_422P16_BE, PIX_FMT_YUV422P16BE}, |
122 |
- {IMGFMT_422P9_LE, PIX_FMT_YUV422P9LE}, |
123 |
- {IMGFMT_422P9_BE, PIX_FMT_YUV422P9BE}, |
124 |
- {IMGFMT_444P16_LE, PIX_FMT_YUV444P16LE}, |
125 |
- {IMGFMT_444P16_BE, PIX_FMT_YUV444P16BE}, |
126 |
+ {IMGFMT_420P16_LE, AV_PIX_FMT_YUV420P16LE}, |
127 |
+ {IMGFMT_420P16_BE, AV_PIX_FMT_YUV420P16BE}, |
128 |
+ {IMGFMT_420P9_LE, AV_PIX_FMT_YUV420P9LE}, |
129 |
+ {IMGFMT_420P9_BE, AV_PIX_FMT_YUV420P9BE}, |
130 |
+ {IMGFMT_420P10_LE, AV_PIX_FMT_YUV420P10LE}, |
131 |
+ {IMGFMT_420P10_BE, AV_PIX_FMT_YUV420P10BE}, |
132 |
+ {IMGFMT_422P10_LE, AV_PIX_FMT_YUV422P10LE}, |
133 |
+ {IMGFMT_422P10_BE, AV_PIX_FMT_YUV422P10BE}, |
134 |
+ {IMGFMT_444P9_BE , AV_PIX_FMT_YUV444P9BE}, |
135 |
+ {IMGFMT_444P9_LE , AV_PIX_FMT_YUV444P9LE}, |
136 |
+ {IMGFMT_444P10_BE, AV_PIX_FMT_YUV444P10BE}, |
137 |
+ {IMGFMT_444P10_LE, AV_PIX_FMT_YUV444P10LE}, |
138 |
+ {IMGFMT_422P16_LE, AV_PIX_FMT_YUV422P16LE}, |
139 |
+ {IMGFMT_422P16_BE, AV_PIX_FMT_YUV422P16BE}, |
140 |
+ {IMGFMT_422P9_LE, AV_PIX_FMT_YUV422P9LE}, |
141 |
+ {IMGFMT_422P9_BE, AV_PIX_FMT_YUV422P9BE}, |
142 |
+ {IMGFMT_444P16_LE, AV_PIX_FMT_YUV444P16LE}, |
143 |
+ {IMGFMT_444P16_BE, AV_PIX_FMT_YUV444P16BE}, |
144 |
|
145 |
// YUVJ are YUV formats that use the full Y range and not just |
146 |
// 16 - 235 (see colorspaces.txt). |
147 |
// Currently they are all treated the same way. |
148 |
- {IMGFMT_YV12, PIX_FMT_YUVJ420P}, |
149 |
- {IMGFMT_422P, PIX_FMT_YUVJ422P}, |
150 |
- {IMGFMT_444P, PIX_FMT_YUVJ444P}, |
151 |
- {IMGFMT_440P, PIX_FMT_YUVJ440P}, |
152 |
+ {IMGFMT_YV12, AV_PIX_FMT_YUVJ420P}, |
153 |
+ {IMGFMT_422P, AV_PIX_FMT_YUVJ422P}, |
154 |
+ {IMGFMT_444P, AV_PIX_FMT_YUVJ444P}, |
155 |
+ {IMGFMT_440P, AV_PIX_FMT_YUVJ440P}, |
156 |
|
157 |
- {IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1}, |
158 |
- {IMGFMT_VDPAU_MPEG2, PIX_FMT_VDPAU_MPEG2}, |
159 |
- {IMGFMT_VDPAU_H264, PIX_FMT_VDPAU_H264}, |
160 |
- {IMGFMT_VDPAU_WMV3, PIX_FMT_VDPAU_WMV3}, |
161 |
- {IMGFMT_VDPAU_VC1, PIX_FMT_VDPAU_VC1}, |
162 |
- {IMGFMT_VDPAU_MPEG4, PIX_FMT_VDPAU_MPEG4}, |
163 |
- {0, PIX_FMT_NONE} |
164 |
+ {IMGFMT_VDPAU_MPEG1, AV_PIX_FMT_VDPAU_MPEG1}, |
165 |
+ {IMGFMT_VDPAU_MPEG2, AV_PIX_FMT_VDPAU_MPEG2}, |
166 |
+ {IMGFMT_VDPAU_H264, AV_PIX_FMT_VDPAU_H264}, |
167 |
+ {IMGFMT_VDPAU_WMV3, AV_PIX_FMT_VDPAU_WMV3}, |
168 |
+ {IMGFMT_VDPAU_VC1, AV_PIX_FMT_VDPAU_VC1}, |
169 |
+ {IMGFMT_VDPAU_MPEG4, AV_PIX_FMT_VDPAU_MPEG4}, |
170 |
+ {0, AV_PIX_FMT_NONE} |
171 |
}; |
172 |
|
173 |
-enum PixelFormat imgfmt2pixfmt(int fmt) |
174 |
+enum AVPixelFormat imgfmt2pixfmt(int fmt) |
175 |
{ |
176 |
int i; |
177 |
- enum PixelFormat pix_fmt; |
178 |
+ enum AVPixelFormat pix_fmt; |
179 |
for (i = 0; conversion_map[i].fmt; i++) |
180 |
if (conversion_map[i].fmt == fmt) |
181 |
break; |
182 |
pix_fmt = conversion_map[i].pix_fmt; |
183 |
- if (pix_fmt == PIX_FMT_NONE) |
184 |
+ if (pix_fmt == AV_PIX_FMT_NONE) |
185 |
mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported format %s\n", vo_format_name(fmt)); |
186 |
return pix_fmt; |
187 |
} |
188 |
|
189 |
-int pixfmt2imgfmt(enum PixelFormat pix_fmt) |
190 |
+int pixfmt2imgfmt(enum AVPixelFormat pix_fmt) |
191 |
{ |
192 |
int i; |
193 |
- for (i = 0; conversion_map[i].pix_fmt != PIX_FMT_NONE; i++) |
194 |
+ for (i = 0; conversion_map[i].pix_fmt != AV_PIX_FMT_NONE; i++) |
195 |
if (conversion_map[i].pix_fmt == pix_fmt) |
196 |
break; |
197 |
int fmt = conversion_map[i].fmt; |
198 |
if (!fmt) { |
199 |
const char *fmtname = av_get_pix_fmt_name(pix_fmt); |
200 |
- mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %s (%d)\n", |
201 |
+ mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported AVPixelFormat %s (%d)\n", |
202 |
fmtname ? fmtname : "INVALID", pix_fmt); |
203 |
} |
204 |
return fmt; |