annotate fmt-conversion.h @ 28445:c6cef3c6768f

Give _XOPEN_SOURCE #define an explicit 600 value. Fixes build on Open Solaris. patch by Imran Syed, freakabcd gmail com
author diego
date Sat, 07 Feb 2009 17:34:45 +0000
parents b519c68ec868
children 21efa4282730
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 24416
diff changeset
1 #ifndef MPLAYER_FMT_CONVERSION_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 24416
diff changeset
2 #define MPLAYER_FMT_CONVERSION_H
24156
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
3
26131
83c95bd31aab Add necessary #includes to pass 'make checkheaders'.
diego
parents: 26069
diff changeset
4 #include <stdio.h>
26069
1318e956c092 FFmpeg now uses different (unified) #include paths.
diego
parents: 26029
diff changeset
5 #include "libavutil/avutil.h"
26131
83c95bd31aab Add necessary #includes to pass 'make checkheaders'.
diego
parents: 26069
diff changeset
6 #include "libmpcodecs/img_format.h"
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
7
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
8 enum PixelFormat imgfmt2pixfmt(int fmt)
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
9 {
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
10 switch (fmt) {
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
11 case IMGFMT_BGR32:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
12 return PIX_FMT_RGB32;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
13 case IMGFMT_BGR24:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
14 return PIX_FMT_BGR24;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
15 case IMGFMT_BGR16:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
16 return PIX_FMT_RGB565;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
17 case IMGFMT_BGR15:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
18 return PIX_FMT_RGB555;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
19 case IMGFMT_BGR8:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
20 return PIX_FMT_RGB8;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
21 case IMGFMT_BGR4:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
22 return PIX_FMT_RGB4;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
23 case IMGFMT_BGR1:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
24 case IMGFMT_RGB1:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
25 return PIX_FMT_MONOBLACK;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
26 case IMGFMT_RG4B:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
27 return PIX_FMT_BGR4_BYTE;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
28 case IMGFMT_BG4B:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
29 return PIX_FMT_RGB4_BYTE;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
30 case IMGFMT_RGB32:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
31 return PIX_FMT_BGR32;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
32 case IMGFMT_RGB24:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
33 return PIX_FMT_RGB24;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
34 case IMGFMT_RGB16:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
35 return PIX_FMT_BGR565;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
36 case IMGFMT_RGB15:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
37 return PIX_FMT_BGR555;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
38 case IMGFMT_RGB8:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
39 return PIX_FMT_BGR8;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
40 case IMGFMT_RGB4:
27601
b519c68ec868 Fix mapping between MPlayer and FFmpeg colorspaces after libswscale changes.
diego
parents: 26131
diff changeset
41 return PIX_FMT_BGR4;
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
42 case IMGFMT_YUY2:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
43 return PIX_FMT_YUYV422;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
44 case IMGFMT_UYVY:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
45 return PIX_FMT_UYVY422;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
46 case IMGFMT_NV12:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
47 return PIX_FMT_NV12;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
48 case IMGFMT_NV21:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
49 return PIX_FMT_NV21;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
50 case IMGFMT_Y800:
19916
3c9f5824444e Add conversion from IMGFMT_Y8 to PIX_FMT_GRAY8
lucabe
parents: 19872
diff changeset
51 case IMGFMT_Y8:
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
52 return PIX_FMT_GRAY8;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
53 case IMGFMT_IF09:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
54 case IMGFMT_YVU9:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
55 return PIX_FMT_YUV410P;
19930
5d0eaf70e1bc Add missing conversion from IMGFMT_I420 to PIX_FMT_YUV420P.
corey
parents: 19916
diff changeset
56 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
57 case IMGFMT_IYUV:
19872
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
58 case IMGFMT_YV12:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
59 return PIX_FMT_YUV420P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
60 case IMGFMT_411P:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
61 return PIX_FMT_YUV411P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
62 case IMGFMT_422P:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
63 return PIX_FMT_YUV422P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
64 case IMGFMT_444P:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
65 return PIX_FMT_YUV444P;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
66 default:
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
67 fprintf(stderr, "Unsupported format %s\n", vo_format_name(fmt));
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
68 }
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
69
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
70 return PIX_FMT_NONE;
8e50cba9fe03 Remove the dependency of libswscale on img_format.h
lucabe
parents:
diff changeset
71 }
24156
5e3665b6213e Add multiple inclusion guards.
diego
parents: 21778
diff changeset
72
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 24416
diff changeset
73 #endif /* MPLAYER_FMT_CONVERSION_H */