Mercurial > mplayer.hg
annotate fmt-conversion.h @ 25371:657c63d001ae
implemented frame selection for savage driver
synchronized with vidix.sf.net r325
author | ben |
---|---|
date | Fri, 14 Dec 2007 18:38:08 +0000 |
parents | bc46e44e1f69 |
children | 4129c8cfa742 |
rev | line source |
---|---|
24156 | 1 #ifndef FMT_CONVERSION_H |
2 #define FMT_CONVERSION_H | |
3 | |
21778
bf1fbe97cc40
Fix build with shared libavutil. Approved by Diego.
rathann
parents:
19930
diff
changeset
|
4 #ifdef USE_LIBAVUTIL_SO |
bf1fbe97cc40
Fix build with shared libavutil. Approved by Diego.
rathann
parents:
19930
diff
changeset
|
5 #include <ffmpeg/avutil.h> |
bf1fbe97cc40
Fix build with shared libavutil. Approved by Diego.
rathann
parents:
19930
diff
changeset
|
6 #else |
19872 | 7 #include "avutil.h" |
21778
bf1fbe97cc40
Fix build with shared libavutil. Approved by Diego.
rathann
parents:
19930
diff
changeset
|
8 #endif |
19872 | 9 #include "img_format.h" |
10 | |
11 enum PixelFormat imgfmt2pixfmt(int fmt) | |
12 { | |
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: | |
19916 | 54 case IMGFMT_Y8: |
19872 | 55 return PIX_FMT_GRAY8; |
56 case IMGFMT_IF09: | |
57 case IMGFMT_YVU9: | |
58 return PIX_FMT_YUV410P; | |
19930
5d0eaf70e1bc
Add missing conversion from IMGFMT_I420 to PIX_FMT_YUV420P.
corey
parents:
19916
diff
changeset
|
59 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
|
60 case IMGFMT_IYUV: |
19872 | 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)); | |
71 } | |
72 | |
73 return PIX_FMT_NONE; | |
74 } | |
24156 | 75 |
76 #endif /* FMT_CONVERSION_H */ |