blob: ba32e33e2122158d186852cf0dc5550528aca31a [file] [log] [blame]
Chih-Wei Huang0d92eda2012-02-07 16:55:49 +08001/*
2 libcamera: An implementation of the library required by Android OS 3.2 so
3 it can access V4L2 devices as cameras.
4
Chih-Wei Huangd5590eb2019-02-26 17:48:45 +08005 (C) 2011 Eduardo José Tagle <ejtagle@tutopia.com>
Chih-Wei Huang0d92eda2012-02-07 16:55:49 +08006
7 Based on several packages:
8 - luvcview: Sdl video Usb Video Class grabber
9 (C) 2005,2006,2007 Laurent Pinchart && Michel Xhaard
10
11 - spcaview
12 (C) 2003,2004,2005,2006 Michel Xhaard
13
14 - JPEG decoder from http://www.bootsplash.org/
15 (C) August 2001 by Michael Schroeder, <mls@suse.de>
16
17 - libcamera V4L for Android 2.2
18 (C) 2009 0xlab.org - http://0xlab.org/
19 (C) 2010 SpectraCore Technologies
20 Author: Venkat Raju <codredruids@spectracoretech.com>
21 Based on a code from http://code.google.com/p/android-m912/downloads/detail?name=v4l2_camera_v2.patch
22
23 - guvcview: http://guvcview.berlios.de
24 Paulo Assis <pj.assis@gmail.com>
25 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
26
27 This program is free software: you can redistribute it and/or modify
28 it under the terms of the GNU General Public License as published by
29 the Free Software Foundation, either version 3 of the License, or
30 (at your option) any later version.
31
32 This program is distributed in the hope that it will be useful,
33 but WITHOUT ANY WARRANTY; without even the implied warranty of
34 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 GNU General Public License for more details.
36
37 You should have received a copy of the GNU General Public License
38 along with this program. If not, see <http://www.gnu.org/licenses/>.
39
40 */
41
42
43#ifndef _UVC_COMPAT_H
44#define _UVC_COMPAT_H
45
46#include <linux/version.h>
47#include <linux/videodev2.h>
48
49#ifndef VIDIOC_ENUM_FRAMESIZES
50
51/*
52 * Frame size and frame rate enumeration
53 *
54 * Included in Linux 2.6.19
55 */
56enum v4l2_frmsizetypes {
57 V4L2_FRMSIZE_TYPE_DISCRETE = 1,
58 V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
59 V4L2_FRMSIZE_TYPE_STEPWISE = 3,
60};
61
62struct v4l2_frmsize_discrete {
63 __u32 width; /* Frame width [pixel] */
64 __u32 height; /* Frame height [pixel] */
65};
66
67struct v4l2_frmsize_stepwise {
68 __u32 min_width; /* Minimum frame width [pixel] */
69 __u32 max_width; /* Maximum frame width [pixel] */
70 __u32 step_width; /* Frame width step size [pixel] */
71 __u32 min_height; /* Minimum frame height [pixel] */
72 __u32 max_height; /* Maximum frame height [pixel] */
73 __u32 step_height; /* Frame height step size [pixel] */
74};
75
76struct v4l2_frmsizeenum {
77 __u32 index; /* Frame size number */
78 __u32 pixel_format; /* Pixel format */
79 __u32 type; /* Frame size type the device supports. */
80
81 union { /* Frame size */
82 struct v4l2_frmsize_discrete discrete;
83 struct v4l2_frmsize_stepwise stepwise;
84 };
85
86 __u32 reserved[2]; /* Reserved space for future use */
87};
88
89#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
90#endif
91
92#ifndef VIDIOC_ENUM_FRAMEINTERVALS
93
94enum v4l2_frmivaltypes {
95 V4L2_FRMIVAL_TYPE_DISCRETE = 1,
96 V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
97 V4L2_FRMIVAL_TYPE_STEPWISE = 3,
98};
99
100struct v4l2_frmival_stepwise {
101 struct v4l2_fract min; /* Minimum frame interval [s] */
102 struct v4l2_fract max; /* Maximum frame interval [s] */
103 struct v4l2_fract step; /* Frame interval step size [s] */
104};
105
106struct v4l2_frmivalenum {
107 __u32 index; /* Frame format index */
108 __u32 pixel_format; /* Pixel format */
109 __u32 width; /* Frame width */
110 __u32 height; /* Frame height */
111 __u32 type; /* Frame interval type the device supports. */
112
113 union { /* Frame interval */
114 struct v4l2_fract discrete;
115 struct v4l2_frmival_stepwise stepwise;
116 };
117
118 __u32 reserved[2]; /* Reserved space for future use */
119};
120
121
122#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
123#endif
124
125#endif /* _UVC_COMPAT_H */