Define profiles_t as const to fix a warning. Prevent profiles[] from been exported.
[mplayer/glamo.git] / fmt-conversion.h
bloba0619c5a55b31a07ceae1835ebcb65ce6e2b5201
1 #ifndef FMT_CONVERSION_H
2 #define FMT_CONVERSION_H
4 #ifdef USE_LIBAVUTIL_SO
5 #include <ffmpeg/avutil.h>
6 #else
7 #include "avutil.h"
8 #endif
9 #include "img_format.h"
11 enum PixelFormat imgfmt2pixfmt(int fmt)
13 switch (fmt) {
14 case IMGFMT_BGR32:
15 return PIX_FMT_RGB32;
16 case IMGFMT_BGR24:
17 return PIX_FMT_BGR24;
18 case IMGFMT_BGR16:
19 return PIX_FMT_BGR565;
20 case IMGFMT_BGR15:
21 return PIX_FMT_BGR555;
22 case IMGFMT_BGR8:
23 return PIX_FMT_BGR8;
24 case IMGFMT_BGR4:
25 return PIX_FMT_BGR4;
26 case IMGFMT_BGR1:
27 case IMGFMT_RGB1:
28 return PIX_FMT_MONOBLACK;
29 case IMGFMT_RG4B:
30 return PIX_FMT_RGB4_BYTE;
31 case IMGFMT_BG4B:
32 return PIX_FMT_BGR4_BYTE;
33 case IMGFMT_RGB32:
34 return PIX_FMT_BGR32;
35 case IMGFMT_RGB24:
36 return PIX_FMT_RGB24;
37 case IMGFMT_RGB16:
38 return PIX_FMT_RGB565;
39 case IMGFMT_RGB15:
40 return PIX_FMT_RGB555;
41 case IMGFMT_RGB8:
42 return PIX_FMT_RGB8;
43 case IMGFMT_RGB4:
44 return PIX_FMT_RGB4;
45 case IMGFMT_YUY2:
46 return PIX_FMT_YUYV422;
47 case IMGFMT_UYVY:
48 return PIX_FMT_UYVY422;
49 case IMGFMT_NV12:
50 return PIX_FMT_NV12;
51 case IMGFMT_NV21:
52 return PIX_FMT_NV21;
53 case IMGFMT_Y800:
54 case IMGFMT_Y8:
55 return PIX_FMT_GRAY8;
56 case IMGFMT_IF09:
57 case IMGFMT_YVU9:
58 return PIX_FMT_YUV410P;
59 case IMGFMT_I420:
60 case IMGFMT_IYUV:
61 case IMGFMT_YV12:
62 return PIX_FMT_YUV420P;
63 case IMGFMT_411P:
64 return PIX_FMT_YUV411P;
65 case IMGFMT_422P:
66 return PIX_FMT_YUV422P;
67 case IMGFMT_444P:
68 return PIX_FMT_YUV444P;
69 default:
70 fprintf(stderr, "Unsupported format %s\n", vo_format_name(fmt));
73 return PIX_FMT_NONE;
76 #endif /* FMT_CONVERSION_H */