Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _UVC_COMPAT_H
00027 #define _UVC_COMPAT_H
00028
00029 #include <linux/version.h>
00030 #ifndef __KERNEL__
00031 #ifndef __user
00032 #define __user
00033 #endif
00034 #endif
00035
00036 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
00037
00038
00039
00040 struct v4l2_ext_control
00041 {
00042 __u32 id;
00043 __u32 reserved2[2];
00044 union {
00045 __s32 value;
00046 __s64 value64;
00047 void *reserved;
00048 };
00049 } __attribute__ ((packed));
00050
00051 struct v4l2_ext_controls
00052 {
00053 __u32 ctrl_class;
00054 __u32 count;
00055 __u32 error_idx;
00056 __u32 reserved[2];
00057 struct v4l2_ext_control *controls;
00058 };
00059
00060
00061 #define V4L2_CTRL_CLASS_USER 0x00980000
00062 #define V4L2_CTRL_CLASS_MPEG 0x00990000
00063
00064 #define V4L2_CTRL_ID_MASK (0x0fffffff)
00065 #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
00066 #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
00067
00068 #define V4L2_CTRL_FLAG_READ_ONLY 0x0004
00069 #define V4L2_CTRL_FLAG_UPDATE 0x0008
00070 #define V4L2_CTRL_FLAG_INACTIVE 0x0010
00071 #define V4L2_CTRL_FLAG_SLIDER 0x0020
00072
00073
00074 #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
00075
00076
00077 #undef V4L2_CID_BASE
00078 #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
00079 #define V4L2_CID_USER_BASE V4L2_CID_BASE
00080 #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
00081
00082 #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
00083 #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
00084 #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
00085
00086 #endif
00087
00088 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
00089
00090
00091
00092
00093
00094 enum v4l2_frmsizetypes
00095 {
00096 V4L2_FRMSIZE_TYPE_DISCRETE = 1,
00097 V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
00098 V4L2_FRMSIZE_TYPE_STEPWISE = 3
00099 };
00100
00101 struct v4l2_frmsize_discrete
00102 {
00103 __u32 width;
00104 __u32 height;
00105 };
00106
00107 struct v4l2_frmsize_stepwise
00108 {
00109 __u32 min_width;
00110 __u32 max_width;
00111 __u32 step_width;
00112 __u32 min_height;
00113 __u32 max_height;
00114 __u32 step_height;
00115 };
00116
00117 struct v4l2_frmsizeenum
00118 {
00119 __u32 index;
00120 __u32 pixel_format;
00121 __u32 type;
00122
00123 union {
00124 struct v4l2_frmsize_discrete discrete;
00125 struct v4l2_frmsize_stepwise stepwise;
00126 };
00127
00128 __u32 reserved[2];
00129 };
00130
00131 enum v4l2_frmivaltypes
00132 {
00133 V4L2_FRMIVAL_TYPE_DISCRETE = 1,
00134 V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
00135 V4L2_FRMIVAL_TYPE_STEPWISE = 3
00136 };
00137
00138 struct v4l2_frmival_stepwise
00139 {
00140 struct v4l2_fract min;
00141 struct v4l2_fract max;
00142 struct v4l2_fract step;
00143 };
00144
00145 struct v4l2_frmivalenum
00146 {
00147 __u32 index;
00148 __u32 pixel_format;
00149 __u32 width;
00150 __u32 height;
00151 __u32 type;
00152
00153 union {
00154 struct v4l2_fract discrete;
00155 struct v4l2_frmival_stepwise stepwise;
00156 };
00157
00158 __u32 reserved[2];
00159 };
00160
00161 #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum)
00162 #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum)
00163 #endif
00164
00165
00166 #endif
00167