kstars
pwc-ioctl.h
Go to the documentation of this file.00001 #ifndef PWC_IOCTL_H 00002 #define PWC_IOCTL_H 00003 00004 /* (C) 2001-2002 Nemosoft Unv. webcam@smcc.demon.nl 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 /* This is pwc-ioctl.h belonging to PWC 8.6 */ 00022 00023 /* 00024 Changes 00025 2001/08/03 Alvarado Added ioctl constants to access methods for 00026 changing white balance and red/blue gains 00027 */ 00028 00029 /* These are private ioctl() commands, specific for the Philips webcams. 00030 They contain functions not found in other webcams, and settings not 00031 specified in the Video4Linux API. 00032 00033 The #define names are built up like follows: 00034 VIDIOC VIDeo IOCtl prefix 00035 PWC Philps WebCam 00036 G optional: Get 00037 S optional: Set 00038 ... the function 00039 */ 00040 00041 00042 00043 00044 /* The frame rate is encoded in the video_window.flags parameter using 00045 the upper 16 bits, since some flags are defined nowadays. The following 00046 defines provide a mask and shift to filter out this value. 00047 00048 In 'Snapshot' mode the camera freezes its automatic exposure and colour 00049 balance controls. 00050 */ 00051 #define PWC_FPS_SHIFT 16 00052 #define PWC_FPS_MASK 0x00FF0000 00053 #define PWC_FPS_FRMASK 0x003F0000 00054 #define PWC_FPS_SNAPSHOT 0x00400000 00055 00056 00057 00058 struct pwc_probe 00059 { 00060 char name[32]; 00061 int type; 00062 }; 00063 00064 00065 /* pwc_whitebalance.mode values */ 00066 #define PWC_WB_INDOOR 0 00067 #define PWC_WB_OUTDOOR 1 00068 #define PWC_WB_FL 2 00069 #define PWC_WB_MANUAL 3 00070 #define PWC_WB_AUTO 4 00071 00072 /* Used with VIDIOCPWC[SG]AWB (Auto White Balance). 00073 Set mode to one of the PWC_WB_* values above. 00074 *red and *blue are the respective gains of these colour components inside 00075 the camera; range 0..65535 00076 When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read; 00077 otherwise undefined. 00078 'read_red' and 'read_blue' are read-only. 00079 */ 00080 00081 struct pwc_whitebalance 00082 { 00083 int mode; 00084 int manual_red, manual_blue; /* R/W */ 00085 int read_red, read_blue; /* R/O */ 00086 }; 00087 00088 /* 00089 'control_speed' and 'control_delay' are used in automatic whitebalance mode, 00090 and tell the camera how fast it should react to changes in lighting, and 00091 with how much delay. Valid values are 0..65535. 00092 */ 00093 struct pwc_wb_speed 00094 { 00095 int control_speed; 00096 int control_delay; 00097 00098 }; 00099 00100 /* Used with VIDIOCPWC[SG]LED */ 00101 struct pwc_leds 00102 { 00103 int led_on; /* Led on-time; range = 0..25000 */ 00104 int led_off; /* Led off-time; range = 0..25000 */ 00105 }; 00106 00107 00108 00109 /* Restore user settings */ 00110 #define VIDIOCPWCRUSER _IO('v', 192) 00111 /* Save user settings */ 00112 #define VIDIOCPWCSUSER _IO('v', 193) 00113 /* Restore factory settings */ 00114 #define VIDIOCPWCFACTORY _IO('v', 194) 00115 00116 /* You can manipulate the compression factor. A compression preference of 0 00117 means use uncompressed modes when available; 1 is low compression, 2 is 00118 medium and 3 is high compression preferred. Of course, the higher the 00119 compression, the lower the bandwidth used but more chance of artefacts 00120 in the image. The driver automatically chooses a higher compression when 00121 the preferred mode is not available. 00122 */ 00123 /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */ 00124 #define VIDIOCPWCSCQUAL _IOW('v', 195, int) 00125 /* Get preferred compression quality */ 00126 #define VIDIOCPWCGCQUAL _IOR('v', 195, int) 00127 00128 00129 /* This is a probe function; since so many devices are supported, it 00130 becomes difficult to include all the names in programs that want to 00131 check for the enhanced Philips stuff. So in stead, try this PROBE; 00132 it returns a structure with the original name, and the corresponding 00133 Philips type. 00134 To use, fill the structure with zeroes, call PROBE and if that succeeds, 00135 compare the name with that returned from VIDIOCGCAP; they should be the 00136 same. If so, you can be assured it is a Philips (OEM) cam and the type 00137 is valid. 00138 */ 00139 #define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe) 00140 00141 /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */ 00142 #define VIDIOCPWCSAGC _IOW('v', 200, int) 00143 /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */ 00144 #define VIDIOCPWCGAGC _IOR('v', 200, int) 00145 /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */ 00146 #define VIDIOCPWCSSHUTTER _IOW('v', 201, int) 00147 00148 /* Color compensation (Auto White Balance) */ 00149 #define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance) 00150 #define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance) 00151 00152 /* Auto WB speed */ 00153 #define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed) 00154 #define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed) 00155 00156 /* LEDs on/off/blink; int range 0..65535 */ 00157 #define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds) 00158 #define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds) 00159 00160 /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */ 00161 #define VIDIOCPWCSCONTOUR _IOW('v', 206, int) 00162 #define VIDIOCPWCGCONTOUR _IOR('v', 206, int) 00163 00164 /* Backlight compensation; 0 = off, otherwise on */ 00165 #define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int) 00166 #define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int) 00167 00168 /* Flickerless mode; = 0 off, otherwise on */ 00169 #define VIDIOCPWCSFLICKER _IOW('v', 208, int) 00170 #define VIDIOCPWCGFLICKER _IOR('v', 208, int) 00171 00172 /* Dynamic noise reduction; 0 off, 3 = high noise reduction */ 00173 #define VIDIOCPWCSDYNNOISE _IOW('v', 209, int) 00174 #define VIDIOCPWCGDYNNOISE _IOR('v', 209, int) 00175 00176 #endif