v4l2_dyna_ctrls.h
1 /*******************************************************************************#
2 # guvcview http://guvcview.berlios.de #
3 # #
4 # Paulo Assis <pj.assis@gmail.com> #
5 # #
6 # This program is free software; you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation; either version 2 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program; if not, write to the Free Software #
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #
19 # #
20 ********************************************************************************/
21 
22 #ifndef V4L2_DYNA_CTRLS_H
23 #define V4L2_DYNA_CTRLS_H
24 
25 #include <sys/types.h>
26 #include <linux/videodev2.h>
27 /*
28  * Dynamic controls
29  */
30 
31 #define UVC_CTRL_DATA_TYPE_RAW 0
32 #define UVC_CTRL_DATA_TYPE_SIGNED 1
33 #define UVC_CTRL_DATA_TYPE_UNSIGNED 2
34 #define UVC_CTRL_DATA_TYPE_BOOLEAN 3
35 #define UVC_CTRL_DATA_TYPE_ENUM 4
36 #define UVC_CTRL_DATA_TYPE_BITMASK 5
37 
38 #define V4L2_CID_BASE_EXTCTR 0x0A046D01
39 #define V4L2_CID_BASE_LOGITECH V4L2_CID_BASE_EXTCTR
40 //#define V4L2_CID_PAN_RELATIVE_LOGITECH V4L2_CID_BASE_LOGITECH
41 //#define V4L2_CID_TILT_RELATIVE_LOGITECH V4L2_CID_BASE_LOGITECH+1
42 #define V4L2_CID_PANTILT_RESET_LOGITECH V4L2_CID_BASE_LOGITECH+2
43 #define V4L2_CID_FOCUS_LOGITECH V4L2_CID_BASE_LOGITECH+3
44 #define V4L2_CID_LED1_MODE_LOGITECH V4L2_CID_BASE_LOGITECH+4
45 #define V4L2_CID_LED1_FREQUENCY_LOGITECH V4L2_CID_BASE_LOGITECH+5
46 #define V4L2_CID_DISABLE_PROCESSING_LOGITECH V4L2_CID_BASE_LOGITECH+0x70
47 #define V4L2_CID_RAW_BITS_PER_PIXEL_LOGITECH V4L2_CID_BASE_LOGITECH+0x71
48 #define V4L2_CID_LAST_EXTCTR V4L2_CID_RAW_BITS_PER_PIXEL_LOGITECH
49 
50 #define UVC_GUID_LOGITECH_VIDEO_PIPE {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x50}
51 #define UVC_GUID_LOGITECH_MOTOR_CONTROL {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x56}
52 #define UVC_GUID_LOGITECH_USER_HW_CONTROL {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x1f}
53 
54 #define XU_HW_CONTROL_LED1 1
55 #define XU_MOTORCONTROL_PANTILT_RELATIVE 1
56 #define XU_MOTORCONTROL_PANTILT_RESET 2
57 #define XU_MOTORCONTROL_FOCUS 3
58 #define XU_COLOR_PROCESSING_DISABLE 5
59 #define XU_RAW_DATA_BITS_PER_PIXEL 8
60 
61 #define UVC_CONTROL_SET_CUR (1 << 0)
62 #define UVC_CONTROL_GET_CUR (1 << 1)
63 #define UVC_CONTROL_GET_MIN (1 << 2)
64 #define UVC_CONTROL_GET_MAX (1 << 3)
65 #define UVC_CONTROL_GET_RES (1 << 4)
66 #define UVC_CONTROL_GET_DEF (1 << 5)
67 /* Control should be saved at suspend and restored at resume. */
68 #define UVC_CONTROL_RESTORE (1 << 6)
69 /* Control can be updated by the camera. */
70 #define UVC_CONTROL_AUTO_UPDATE (1 << 7)
71 
72 #define UVC_CONTROL_GET_RANGE (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
73  UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
74  UVC_CONTROL_GET_DEF)
75 
76 
78 {
79  __u8 entity[16];
80  __u8 index;
81  __u8 selector;
82  __u16 size;
83  __u32 flags;
84 };
85 
87 {
88  __u32 id;
89  __u8 name[32];
90  __u8 entity[16];
91  __u8 selector;
92 
93  __u8 size;
94  __u8 offset;
95  enum v4l2_ctrl_type v4l2_type;
96  __u32 data_type;
97 };
98 
100 {
101  __u8 unit;
102  __u8 selector;
103  __u16 size;
104  //__u8 __user *data;
105  __u8 *data;
106 };
107 
108 #define UVCIOC_CTRL_ADD _IOW ('U', 1, struct uvc_xu_control_info)
109 #define UVCIOC_CTRL_MAP _IOWR ('U', 2, struct uvc_xu_control_mapping)
110 #define UVCIOC_CTRL_GET _IOWR ('U', 3, struct uvc_xu_control)
111 #define UVCIOC_CTRL_SET _IOW ('U', 4, struct uvc_xu_control)
112 
113 #endif
Definition: v4l2_dyna_ctrls.h:99
Definition: v4l2_dyna_ctrls.h:77
Definition: v4l2_dyna_ctrls.h:86