Mercurial > mplayer.hg
annotate fmt-conversion.h @ 26118:468db9b6860c
cosmetics: prettyprinting and alphabetical order
author | diego |
---|---|
date | Mon, 03 Mar 2008 18:15:35 +0000 |
parents | 1318e956c092 |
children | 83c95bd31aab |
rev | line source |
---|---|
26029 | 1 #ifndef MPLAYER_FMT_CONVERSION_H |
2 #define MPLAYER_FMT_CONVERSION_H | |
24156 | 3 |
26069
1318e956c092
FFmpeg now uses different (unified) #include paths.
diego
parents:
26029
diff
changeset
|
4 #include "libavutil/avutil.h" |
19872 | 5 #include "img_format.h" |
6 | |
7 enum PixelFormat imgfmt2pixfmt(int fmt) | |
8 { | |
9 switch (fmt) { | |
10 case IMGFMT_BGR32: | |
11 return PIX_FMT_RGB32; | |
12 case IMGFMT_BGR24: | |
13 return PIX_FMT_BGR24; | |
14 case IMGFMT_BGR16: | |
15 return PIX_FMT_BGR565; | |
16 case IMGFMT_BGR15: | |
17 return PIX_FMT_BGR555; | |
18 case IMGFMT_BGR8: | |
19 return PIX_FMT_BGR8; | |
20 case IMGFMT_BGR4: | |
21 return PIX_FMT_BGR4; | |
22 case IMGFMT_BGR1: | |
23 case IMGFMT_RGB1: | |
24 return PIX_FMT_MONOBLACK; | |
25 case IMGFMT_RG4B: | |
26 return PIX_FMT_RGB4_BYTE; | |
27 case IMGFMT_BG4B: | |
28 return PIX_FMT_BGR4_BYTE; | |
29 case IMGFMT_RGB32: | |
30 return PIX_FMT_BGR32; | |
31 case IMGFMT_RGB24: | |
32 return PIX_FMT_RGB24; | |
33 case IMGFMT_RGB16: | |
34 return PIX_FMT_RGB565; | |
35 case IMGFMT_RGB15: | |
36 return PIX_FMT_RGB555; | |
37 case IMGFMT_RGB8: | |
38 return PIX_FMT_RGB8; | |
39 case IMGFMT_RGB4: | |
40 return PIX_FMT_RGB4; | |
41 case IMGFMT_YUY2: | |
42 return PIX_FMT_YUYV422; | |
43 case IMGFMT_UYVY: | |
44 return PIX_FMT_UYVY422; | |
45 case IMGFMT_NV12: | |
46 return PIX_FMT_NV12; | |
47 case IMGFMT_NV21: | |
48 return PIX_FMT_NV21; | |
49 case IMGFMT_Y800: | |
19916 | 50 case IMGFMT_Y8: |
19872 | 51 return PIX_FMT_GRAY8; |
52 case IMGFMT_IF09: | |
53 case IMGFMT_YVU9: | |
54 return PIX_FMT_YUV410P; | |
19930
5d0eaf70e1bc
Add missing conversion from IMGFMT_I420 to PIX_FMT_YUV420P.
corey
parents:
19916
diff
changeset
|
55 case IMGFMT_I420: |
24416
bc46e44e1f69
DOCS/tech/colorspaces.txt says I420 and IYUV are the same, so add IYUV at the
reimar
parents:
24156
diff
changeset
|
56 case IMGFMT_IYUV: |
19872 | 57 case IMGFMT_YV12: |
58 return PIX_FMT_YUV420P; | |
59 case IMGFMT_411P: | |
60 return PIX_FMT_YUV411P; | |
61 case IMGFMT_422P: | |
62 return PIX_FMT_YUV422P; | |
63 case IMGFMT_444P: | |
64 return PIX_FMT_YUV444P; | |
65 default: | |
66 fprintf(stderr, "Unsupported format %s\n", vo_format_name(fmt)); | |
67 } | |
68 | |
69 return PIX_FMT_NONE; | |
70 } | |
24156 | 71 |
26029 | 72 #endif /* MPLAYER_FMT_CONVERSION_H */ |