v4l2_dyna_ctrls.h
00001 /*******************************************************************************#
00002 #           guvcview              http://guvcview.berlios.de                    #
00003 #                                                                               #
00004 #           Paulo Assis <pj.assis@gmail.com>                                    #
00005 #                                                                               #
00006 # This program is free software; you can redistribute it and/or modify          #
00007 # it under the terms of the GNU General Public License as published by          #
00008 # the Free Software Foundation; either version 2 of the License, or             #
00009 # (at your option) any later version.                                           #
00010 #                                                                               #
00011 # This program is distributed in the hope that it will be useful,               #
00012 # but WITHOUT ANY WARRANTY; without even the implied warranty of                #
00013 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 #
00014 # GNU General Public License for more details.                                  #
00015 #                                                                               #
00016 # You should have received a copy of the GNU General Public License             #
00017 # along with this program; if not, write to the Free Software                   #
00018 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA     #
00019 #                                                                               #
00020 ********************************************************************************/
00021 
00022 #ifndef V4L2_DYNA_CTRLS_H
00023 #define V4L2_DYNA_CTRLS_H
00024 
00025 #include <sys/types.h>
00026 #include <linux/videodev2.h>
00027 /*
00028  * Dynamic controls
00029  */
00030 
00031 #define UVC_CTRL_DATA_TYPE_RAW          0
00032 #define UVC_CTRL_DATA_TYPE_SIGNED       1
00033 #define UVC_CTRL_DATA_TYPE_UNSIGNED     2
00034 #define UVC_CTRL_DATA_TYPE_BOOLEAN      3
00035 #define UVC_CTRL_DATA_TYPE_ENUM         4
00036 #define UVC_CTRL_DATA_TYPE_BITMASK      5
00037 
00038 #define V4L2_CID_BASE_EXTCTR                            0x0A046D01
00039 #define V4L2_CID_BASE_LOGITECH                          V4L2_CID_BASE_EXTCTR
00040 //#define V4L2_CID_PAN_RELATIVE_LOGITECH                V4L2_CID_BASE_LOGITECH
00041 //#define V4L2_CID_TILT_RELATIVE_LOGITECH               V4L2_CID_BASE_LOGITECH+1
00042 #define V4L2_CID_PANTILT_RESET_LOGITECH                 V4L2_CID_BASE_LOGITECH+2
00043 #define V4L2_CID_FOCUS_LOGITECH                         V4L2_CID_BASE_LOGITECH+3
00044 #define V4L2_CID_LED1_MODE_LOGITECH                     V4L2_CID_BASE_LOGITECH+4
00045 #define V4L2_CID_LED1_FREQUENCY_LOGITECH                V4L2_CID_BASE_LOGITECH+5
00046 #define V4L2_CID_DISABLE_PROCESSING_LOGITECH            V4L2_CID_BASE_LOGITECH+0x70
00047 #define V4L2_CID_RAW_BITS_PER_PIXEL_LOGITECH            V4L2_CID_BASE_LOGITECH+0x71
00048 #define V4L2_CID_LAST_EXTCTR                            V4L2_CID_RAW_BITS_PER_PIXEL_LOGITECH
00049 
00050 #define UVC_GUID_LOGITECH_VIDEO_PIPE            {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x50}
00051 #define UVC_GUID_LOGITECH_MOTOR_CONTROL         {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x56}
00052 #define UVC_GUID_LOGITECH_USER_HW_CONTROL       {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x1f}
00053 
00054 #define XU_HW_CONTROL_LED1                      1
00055 #define XU_MOTORCONTROL_PANTILT_RELATIVE        1
00056 #define XU_MOTORCONTROL_PANTILT_RESET           2
00057 #define XU_MOTORCONTROL_FOCUS                   3
00058 #define XU_COLOR_PROCESSING_DISABLE             5
00059 #define XU_RAW_DATA_BITS_PER_PIXEL              8
00060 
00061 #define UVC_CONTROL_SET_CUR     (1 << 0)
00062 #define UVC_CONTROL_GET_CUR     (1 << 1)
00063 #define UVC_CONTROL_GET_MIN     (1 << 2)
00064 #define UVC_CONTROL_GET_MAX     (1 << 3)
00065 #define UVC_CONTROL_GET_RES     (1 << 4)
00066 #define UVC_CONTROL_GET_DEF     (1 << 5)
00067 /* Control should be saved at suspend and restored at resume. */
00068 #define UVC_CONTROL_RESTORE     (1 << 6)
00069 /* Control can be updated by the camera. */
00070 #define UVC_CONTROL_AUTO_UPDATE (1 << 7)
00071 
00072 #define UVC_CONTROL_GET_RANGE   (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
00073                                  UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
00074                                  UVC_CONTROL_GET_DEF)
00075 
00076 
00077 struct uvc_xu_control_info 
00078 {
00079         __u8 entity[16];
00080         __u8 index;
00081         __u8 selector;
00082         __u16 size;
00083         __u32 flags;
00084 };
00085 
00086 struct uvc_xu_control_mapping 
00087 {
00088         __u32 id;
00089         __u8 name[32];
00090         __u8 entity[16];
00091         __u8 selector;
00092 
00093         __u8 size;
00094         __u8 offset;
00095         enum v4l2_ctrl_type v4l2_type;
00096         __u32 data_type;
00097 };
00098 
00099 struct uvc_xu_control 
00100 {
00101         __u8 unit;
00102         __u8 selector;
00103         __u16 size;
00104         //__u8 __user *data;
00105         __u8 *data;
00106 };
00107 
00108 #define UVCIOC_CTRL_ADD         _IOW  ('U', 1, struct uvc_xu_control_info)
00109 #define UVCIOC_CTRL_MAP         _IOWR ('U', 2, struct uvc_xu_control_mapping)
00110 #define UVCIOC_CTRL_GET         _IOWR ('U', 3, struct uvc_xu_control)
00111 #define UVCIOC_CTRL_SET         _IOW  ('U', 4, struct uvc_xu_control)
00112 
00113 #endif

Last updated 12 September 2005 21:38:45