25e480796e040bda5efb8837153bd3ca2839c502
[sdk/emulator/qemu.git] / tizen / src / hw / maru_camera_darwin.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
15  * MA 02110-1301, USA.
16  *
17  */
18
19 #ifndef _MARU_CAMERA_DARWIN_H_
20 #define _MARU_CAMERA_DARWIN_H_
21
22 #define MAKEFOURCC(a,b,c,d)\
23     (((uint32_t)(a)<<0)|((uint32_t)(b)<<8)|((uint32_t)(c)<<16)|((uint32_t)(d)<<24))
24
25 /*      Pixel format         FOURCC                        depth  Description  */
26 #define V4L2_PIX_FMT_RGB555  MAKEFOURCC('R','G','B','O') /* 16  RGB-5-5-5     */
27 #define V4L2_PIX_FMT_RGB565  MAKEFOURCC('R','G','B','P') /* 16  RGB-5-6-5     */
28 #define V4L2_PIX_FMT_RGB555X MAKEFOURCC('R','G','B','Q') /* 16  RGB-5-5-5 BE  */
29 #define V4L2_PIX_FMT_RGB565X MAKEFOURCC('R','G','B','R') /* 16  RGB-5-6-5 BE  */
30 #define V4L2_PIX_FMT_BGR24   MAKEFOURCC('B','G','R','3') /* 24  BGR-8-8-8     */
31 #define V4L2_PIX_FMT_RGB24   MAKEFOURCC('R','G','B','3') /* 24  RGB-8-8-8     */
32 #define V4L2_PIX_FMT_BGR32   MAKEFOURCC('B','G','R','4') /* 32  BGR-8-8-8-8   */
33 #define V4L2_PIX_FMT_RGB32   MAKEFOURCC('R','G','B','4') /* 32  RGB-8-8-8-8   */
34 #define V4L2_PIX_FMT_YVU410  MAKEFOURCC('Y','V','U','9') /*  9  YVU 4:1:0     */
35 #define V4L2_PIX_FMT_YVU420  MAKEFOURCC('Y','V','1','2') /* 12  YVU 4:2:0     */
36 #define V4L2_PIX_FMT_YUYV    MAKEFOURCC('Y','U','Y','V') /* 16  YUV 4:2:2     */
37 #define V4L2_PIX_FMT_UYVY    MAKEFOURCC('U','Y','V','Y') /* 16  YUV 4:2:2     */
38 #define V4L2_PIX_FMT_YUV422P MAKEFOURCC('4','2','2','P') /* 16  YVU422 planar */
39 #define V4L2_PIX_FMT_YUV411P MAKEFOURCC('4','1','1','P') /* 16  YVU411 planar */
40 #define V4L2_PIX_FMT_Y41P    MAKEFOURCC('Y','4','1','P') /* 12  YUV 4:1:1     */
41 #define V4L2_PIX_FMT_YUV444  MAKEFOURCC('Y','4','4','4') /* 16  xxxxyyyy uuuuvvvv */
42 #define V4L2_PIX_FMT_YUV555  MAKEFOURCC('Y','U','V','O') /* 16  YUV-5-5-5     */
43 #define V4L2_PIX_FMT_YUV565  MAKEFOURCC('Y','U','V','P') /* 16  YUV-5-6-5     */
44 #define V4L2_PIX_FMT_YUV32   MAKEFOURCC('Y','U','V','4') /* 32  YUV-8-8-8-8   */
45 #define V4L2_PIX_FMT_YUV410  MAKEFOURCC('Y','U','V','9') /*  9  YUV 4:1:0     */
46 #define V4L2_PIX_FMT_YUV420  MAKEFOURCC('Y','U','1','2') /* 12  YUV 4:2:0     */
47 #define V4L2_PIX_FMT_YYUV    MAKEFOURCC('Y','Y','U','V') /* 16  YUV 4:2:2     */
48
49 void convert_frame(uint32_t pixel_format, int frame_width, int frame_height,
50                    size_t frame_size, void* frame_pixels, void* video_buf);
51
52 #endif /* _MARU_CAMERA_DARWIN_H_ */