dynctrl.h
Go to the documentation of this file.
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 <linux/videodev2.h>
00026 #include "v4l2uvc.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 
00044 /*this should realy be replaced by V4L2_CID_FOCUS_ABSOLUTE in libwebcam*/
00045 #define V4L2_CID_FOCUS_LOGITECH             V4L2_CID_BASE_LOGITECH+3
00046 #define V4L2_CID_LED1_MODE_LOGITECH         V4L2_CID_BASE_LOGITECH+4
00047 #define V4L2_CID_LED1_FREQUENCY_LOGITECH        V4L2_CID_BASE_LOGITECH+5
00048 #define V4L2_CID_DISABLE_PROCESSING_LOGITECH        V4L2_CID_BASE_LOGITECH+0x70
00049 #define V4L2_CID_RAW_BITS_PER_PIXEL_LOGITECH        V4L2_CID_BASE_LOGITECH+0x71
00050 #define V4L2_CID_LAST_EXTCTR                V4L2_CID_RAW_BITS_PER_PIXEL_LOGITECH
00051 
00052 #define UVC_GUID_LOGITECH_VIDEO_PIPE        {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x50}
00053 #define UVC_GUID_LOGITECH_MOTOR_CONTROL     {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x56}
00054 #define UVC_GUID_LOGITECH_USER_HW_CONTROL   {0x82, 0x06, 0x61, 0x63, 0x70, 0x50, 0xab, 0x49, 0xb8, 0xcc, 0xb3, 0x85, 0x5e, 0x8d, 0x22, 0x1f}
00055 
00056 #define XU_HW_CONTROL_LED1          1
00057 #define XU_MOTORCONTROL_PANTILT_RELATIVE    1
00058 #define XU_MOTORCONTROL_PANTILT_RESET       2
00059 #define XU_MOTORCONTROL_FOCUS           3
00060 #define XU_COLOR_PROCESSING_DISABLE     5
00061 #define XU_RAW_DATA_BITS_PER_PIXEL      8
00062 
00063 #define UVC_CONTROL_SET_CUR (1 << 0)
00064 #define UVC_CONTROL_GET_CUR (1 << 1)
00065 #define UVC_CONTROL_GET_MIN (1 << 2)
00066 #define UVC_CONTROL_GET_MAX (1 << 3)
00067 #define UVC_CONTROL_GET_RES (1 << 4)
00068 #define UVC_CONTROL_GET_DEF (1 << 5)
00069 /* Control should be saved at suspend and restored at resume. */
00070 #define UVC_CONTROL_RESTORE (1 << 6)
00071 /* Control can be updated by the camera. */
00072 #define UVC_CONTROL_AUTO_UPDATE (1 << 7)
00073 
00074 #define UVC_CONTROL_GET_RANGE   (UVC_CONTROL_GET_CUR | UVC_CONTROL_GET_MIN | \
00075                                  UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES | \
00076                                  UVC_CONTROL_GET_DEF)
00077 
00078 struct uvc_xu_control_info {
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     __u32 id;
00088     __u8 name[32];
00089     __u8 entity[16];
00090     __u8 selector;
00091 
00092     __u8 size;
00093     __u8 offset;
00094     enum v4l2_ctrl_type v4l2_type;
00095     __u32 data_type;
00096 };
00097 
00098 struct uvc_xu_control {
00099     __u8 unit;
00100     __u8 selector;
00101     __u16 size;
00102     __u8 *data;
00103 };
00104 
00105 #define UVCIOC_CTRL_ADD     _IOW('U', 1, struct uvc_xu_control_info)
00106 #define UVCIOC_CTRL_MAP     _IOWR('U', 2, struct uvc_xu_control_mapping)
00107 #define UVCIOC_CTRL_GET     _IOWR('U', 3, struct uvc_xu_control)
00108 #define UVCIOC_CTRL_SET     _IOW('U', 4, struct uvc_xu_control)
00109 
00110 int initDynCtrls(int fd);
00111 int uvcPanTilt(int dev, int pan, int tilt, int reset);
00112 #endif


corobot_pantilt
Author(s): Morgan Cormier/mcormier@coroware.com
autogenerated on Tue Jan 7 2014 11:39:02