update source for tizen_2.1
[sdk/emulator/qemu.git] / tizen / src / hw / maru_camera_darwin.h
1 /*
2  * Header of MARU Virtual Camera device for MacOS.
3  *
4  * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
5  *
6  * Contact:
7  * Jun Tian <jun.j.tian@intel.com>
8  * JinHyung Jo <jinhyung.jo@samsung.com>
9  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24  * MA  02110-1301, USA.
25  *
26  * Contributors:
27  * - S-Core Co., Ltd
28  *
29  */
30
31 #ifndef _MARU_CAMERA_DARWIN_H_
32 #define _MARU_CAMERA_DARWIN_H_
33
34 #define MAKEFOURCC(a, b, c, d) \
35     (((uint32_t)(a) << 0) | \
36      ((uint32_t)(b) << 8) | \
37      ((uint32_t)(c) << 16) | \
38      ((uint32_t)(d) << 24))
39
40 /* 16  RGB-5-5-5     */
41 #define V4L2_PIX_FMT_RGB555  MAKEFOURCC('R', 'G', 'B', 'O')
42 /* 16  RGB-5-6-5     */
43 #define V4L2_PIX_FMT_RGB565  MAKEFOURCC('R', 'G', 'B', 'P')
44 /* 16  RGB-5-5-5 BE  */
45 #define V4L2_PIX_FMT_RGB555X MAKEFOURCC('R', 'G', 'B', 'Q')
46 /* 16  RGB-5-6-5 BE  */
47 #define V4L2_PIX_FMT_RGB565X MAKEFOURCC('R', 'G', 'B', 'R')
48 /* 24  BGR-8-8-8     */
49 #define V4L2_PIX_FMT_BGR24   MAKEFOURCC('B', 'G', 'R', '3')
50 /* 24  RGB-8-8-8     */
51 #define V4L2_PIX_FMT_RGB24   MAKEFOURCC('R', 'G', 'B', '3')
52 /* 32  BGR-8-8-8-8   */
53 #define V4L2_PIX_FMT_BGR32   MAKEFOURCC('B', 'G', 'R', '4')
54 /* 32  RGB-8-8-8-8   */
55 #define V4L2_PIX_FMT_RGB32   MAKEFOURCC('R', 'G', 'B', '4')
56 /*  9  YVU 4:1:0     */
57 #define V4L2_PIX_FMT_YVU410  MAKEFOURCC('Y', 'V', 'U', '9')
58 /* 12  YVU 4:2:0     */
59 #define V4L2_PIX_FMT_YVU420  MAKEFOURCC('Y', 'V', '1', '2')
60 /* 16  YUV 4:2:2     */
61 #define V4L2_PIX_FMT_YUYV    MAKEFOURCC('Y', 'U', 'Y', 'V')
62 /* 16  YUV 4:2:2     */
63 #define V4L2_PIX_FMT_UYVY    MAKEFOURCC('U', 'Y', 'V', 'Y')
64 /* 16  YVU422 planar */
65 #define V4L2_PIX_FMT_YUV422P MAKEFOURCC('4', '2', '2', 'P')
66 /* 16  YVU411 planar */
67 #define V4L2_PIX_FMT_YUV411P MAKEFOURCC('4', '1', '1', 'P')
68 /* 12  YUV 4:1:1     */
69 #define V4L2_PIX_FMT_Y41P    MAKEFOURCC('Y', '4', '1', 'P')
70 /* 16  xxxxyyyy uuuuvvvv */
71 #define V4L2_PIX_FMT_YUV444  MAKEFOURCC('Y', '4', '4', '4')
72 /* 16  YUV-5-5-5     */
73 #define V4L2_PIX_FMT_YUV555  MAKEFOURCC('Y', 'U', 'V', 'O')
74 /* 16  YUV-5-6-5     */
75 #define V4L2_PIX_FMT_YUV565  MAKEFOURCC('Y', 'U', 'V', 'P')
76 /* 32  YUV-8-8-8-8   */
77 #define V4L2_PIX_FMT_YUV32   MAKEFOURCC('Y', 'U', 'V', '4')
78 /*  9  YUV 4:1:0     */
79 #define V4L2_PIX_FMT_YUV410  MAKEFOURCC('Y', 'U', 'V', '9')
80 /* 12  YUV 4:2:0     */
81 #define V4L2_PIX_FMT_YUV420  MAKEFOURCC('Y', 'U', '1', '2')
82 /* 16  YUV 4:2:2     */
83 #define V4L2_PIX_FMT_YYUV    MAKEFOURCC('Y', 'Y', 'U', 'V')
84
85 void convert_frame(uint32_t pixel_format, int frame_width, int frame_height,
86                    size_t frame_size, void *frame_pixels, void *video_buf);
87
88 #endif /* _MARU_CAMERA_DARWIN_H_ */