2 * Header of MARU Virtual Camera device for MacOS.
4 * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
7 * Jun Tian <jun.j.tian@intel.com>
8 * JinHyung Jo <jinhyung.jo@samsung.com>
9 * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
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.
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.
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,
31 #ifndef _MARU_CAMERA_DARWIN_H_
32 #define _MARU_CAMERA_DARWIN_H_
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))
41 #define V4L2_PIX_FMT_RGB555 MAKEFOURCC('R', 'G', 'B', 'O')
43 #define V4L2_PIX_FMT_RGB565 MAKEFOURCC('R', 'G', 'B', 'P')
45 #define V4L2_PIX_FMT_RGB555X MAKEFOURCC('R', 'G', 'B', 'Q')
47 #define V4L2_PIX_FMT_RGB565X MAKEFOURCC('R', 'G', 'B', 'R')
49 #define V4L2_PIX_FMT_BGR24 MAKEFOURCC('B', 'G', 'R', '3')
51 #define V4L2_PIX_FMT_RGB24 MAKEFOURCC('R', 'G', 'B', '3')
53 #define V4L2_PIX_FMT_BGR32 MAKEFOURCC('B', 'G', 'R', '4')
55 #define V4L2_PIX_FMT_RGB32 MAKEFOURCC('R', 'G', 'B', '4')
57 #define V4L2_PIX_FMT_YVU410 MAKEFOURCC('Y', 'V', 'U', '9')
59 #define V4L2_PIX_FMT_YVU420 MAKEFOURCC('Y', 'V', '1', '2')
61 #define V4L2_PIX_FMT_YUYV MAKEFOURCC('Y', 'U', 'Y', 'V')
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')
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')
73 #define V4L2_PIX_FMT_YUV555 MAKEFOURCC('Y', 'U', 'V', 'O')
75 #define V4L2_PIX_FMT_YUV565 MAKEFOURCC('Y', 'U', 'V', 'P')
77 #define V4L2_PIX_FMT_YUV32 MAKEFOURCC('Y', 'U', 'V', '4')
79 #define V4L2_PIX_FMT_YUV410 MAKEFOURCC('Y', 'U', 'V', '9')
81 #define V4L2_PIX_FMT_YUV420 MAKEFOURCC('Y', 'U', '1', '2')
83 #define V4L2_PIX_FMT_YYUV MAKEFOURCC('Y', 'Y', 'U', 'V')
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);
88 #endif /* _MARU_CAMERA_DARWIN_H_ */