pwc-ioctl.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:4k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #ifndef PWC_IOCTL_H
  2. #define PWC_IOCTL_H
  3. /* (C) 2001 Nemosoft Unv.    webcam@smcc.demon.nl
  4.    
  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 2 of the License, or
  8.    (at your option) any later version.
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.    You should have received a copy of the GNU General Public License
  14.    along with this program; if not, write to the Free Software
  15.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  16. */
  17. /*
  18.    Changes
  19.    2001/08/03  Alvarado   Added ioctl constants to access methods for 
  20.                           changing white balance and red/blue gains
  21.  */
  22. /* These are private ioctl() commands, specific for the Philips webcams.
  23.    They contain functions not found in other webcams, and settings not
  24.    specified in the Video4Linux API. 
  25.    
  26.    The #define names are built up like follows:
  27.    VIDIOC VIDeo IOCtl prefix
  28.          PWC Philps WebCam
  29.             G           optional: Get
  30.             S           optional: Set
  31.              ...  the function
  32.  */
  33. /* The frame rate is encoded in the video_window.flags parameter using
  34.    the upper 16 bits, since some flags are defined nowadays. The following
  35.    defines provide a mask and shift to filter out this value.
  36.    
  37.    In 'Snapshot' mode the camera freezes its automatic exposure and colour 
  38.    balance controls.
  39.  */
  40. #define PWC_FPS_SHIFT 16
  41. #define PWC_FPS_MASK 0x00FF0000
  42. #define PWC_FPS_FRMASK 0x003F0000
  43. #define PWC_FPS_SNAPSHOT 0x00400000
  44. /* pwc_whitebalance.mode values */
  45. #define PWC_WB_INDOOR 0
  46. #define PWC_WB_OUTDOOR 1
  47. #define PWC_WB_FL 2
  48. #define PWC_WB_MANUAL 3
  49. #define PWC_WB_AUTO 4
  50. /* Used with VIDIOCPWC[SG]AWB (Auto White Balance). 
  51.    Set mode to one of the PWC_WB_* values above.
  52.    *red and *blue are the respective gains of these colour components inside 
  53.    the camera; range 0..65535
  54.    When mode == PWC_WB_MANUAL, manual_red and manual_blue are set or read; 
  55.    otherwise undefined.
  56.    read_red and read_blue are read-only.
  57. */   
  58.    
  59. struct pwc_whitebalance
  60. {
  61. int mode;
  62. int manual_red, manual_blue; /* R/W */
  63. int read_red, read_blue; /* R/O */
  64. };
  65. /* Used with VIDIOCPWC[SG]LED */
  66. struct pwc_leds
  67. {
  68. int led_on; /* Led on-time; range = 0..25000 */
  69. int led_off; /* Led off-time; range = 0..25000  */
  70. };
  71.  /* Restore user settings */
  72. #define VIDIOCPWCRUSER _IO('v', 192)
  73.  /* Save user settings */
  74. #define VIDIOCPWCSUSER _IO('v', 193)
  75.  /* Restore factory settings */
  76. #define VIDIOCPWCFACTORY _IO('v', 194)
  77.  /* You can manipulate the compression factor. A compression preference of 0
  78.     means use uncompressed modes when available; 1 is low compression, 2 is
  79.     medium and 3 is high compression preferred. Of course, the higher the
  80.     compression, the lower the bandwidth used but more chance of artefacts
  81.     in the image. The driver automatically chooses a higher compression when
  82.     the preferred mode is not available.
  83.   */
  84.  /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */
  85. #define VIDIOCPWCSCQUAL _IOW('v', 195, int)
  86.  /* Get preferred compression quality */
  87. #define VIDIOCPWCGCQUAL _IOR('v', 195, int)
  88.  /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */
  89. #define VIDIOCPWCSAGC _IOW('v', 200, int)
  90.  /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */
  91. #define VIDIOCPWCGAGC _IOR('v', 200, int)
  92.  /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */
  93. #define VIDIOCPWCSSHUTTER _IOW('v', 201, int)
  94.  /* Color compensation (Auto White Balance) */
  95. #define VIDIOCPWCSAWB           _IOW('v', 202, struct pwc_whitebalance)
  96. #define VIDIOCPWCGAWB           _IOR('v', 202, struct pwc_whitebalance)
  97.  /* Turn LED on/off ; int range 0..65535 */
  98. #define VIDIOCPWCSLED           _IOW('v', 205, struct pwc_leds)
  99.  /* Get state of LED; int range 0..65535 */
  100. #define VIDIOCPWCGLED           _IOR('v', 205, struct pwc_leds)
  101. #endif