Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

ioctl_meteor.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1995 Mark Tinguely and Jim Lowe
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. All advertising materials mentioning features or use of this software
00014  *    must display the following acknowledgement:
00015  *      This product includes software developed by Mark Tinguely and Jim Lowe
00016  * 4. The name of the author may not be used to endorse or promote products 
00017  *    derived from this software without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00020  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00021  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00022  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
00023  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00024  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00025  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00026  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00027  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00028  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00029  * POSSIBILITY OF SUCH DAMAGE.
00030  */
00031 /*
00032  *      ioctl constants for Matrox Meteor Capture card.
00033  */
00034 
00035 #ifndef __IOCTL_METEOR_H__
00036 #define __IOCTL_METEOR_H__
00037 
00038 #define MAX_NUM_FRAMES 256 /* should be the same as meteor.h */
00039 
00040 #ifndef LIBC6
00041 #include <sys/ioctl.h>
00042 #endif
00043 
00044 struct meteor_capframe {
00045         short   command;        /* see below for valid METEORCAPFRM commands */
00046         short   lowat;          /* start transfer if < this number */
00047         short   hiwat;          /* stop transfer if > this number */
00048 } ;
00049 
00050 /* structure for METEOR[GS]ETGEO - get/set geometry  */
00051 struct meteor_geomet {
00052         u_short         rows;
00053         u_short         columns;
00054         u_short         frames;
00055         u_long          oformat;
00056 } ;
00057 
00058 /* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors */
00059 struct meteor_counts {
00060         u_long fifo_errors;     /* count of fifo errors since open */
00061         u_long dma_errors;      /* count of dma errors since open */
00062         u_long frames_captured; /* count of frames captured since open */
00063         u_long even_fields_captured; /* count of even fields captured */
00064         u_long odd_fields_captured; /* count of odd fields captured */
00065 } ;
00066 
00067 /* structure to get the frame offsets in memory */
00068 struct meteor_frame_offset {
00069   u_long frame_offset[MAX_NUM_FRAMES];
00070   u_long fb_size;
00071   u_long mem_off;
00072 } ;
00073 
00074 /* structure for getting and setting direct transfers to vram */
00075 struct meteor_video {
00076         u_long  addr;   /* Address of location to dma to */
00077         u_long  width;  /* Width of memory area */
00078         u_long  banksize;       /* Size of Vram bank */
00079         u_long  ramsize;        /* Size of Vram */
00080 };
00081 
00082 
00083 #define METEORCAPTUR _IOW('x', 1, int)                   /* capture a frame */
00084 #define METEORCAPFRM _IOW('x', 2, struct meteor_capframe)  /* sync capture */
00085 #define METEORSETGEO _IOW('x', 3, struct meteor_geomet)  /* set geometry */
00086 #define METEORGETGEO _IOR('x', 4, struct meteor_geomet)  /* get geometry */
00087 #define METEORSTATUS _IOR('x', 5, unsigned short)       /* get status */
00088 #define METEORSHUE   _IOW('x', 6, signed char)          /* set hue */
00089 #define METEORGHUE   _IOR('x', 6, signed char)          /* get hue */
00090 #define METEORSFMT   _IOW('x', 7, unsigned long)        /* set format */
00091 #define METEORGFMT   _IOR('x', 7, unsigned long)        /* get format */
00092 #define METEORSINPUT _IOW('x', 8, unsigned long)        /* set input dev */
00093 #define METEORGINPUT _IOR('x', 8, unsigned long)        /* get input dev */
00094 #define METEORSCHCV  _IOW('x', 9, unsigned char)        /* set uv gain */
00095 #define METEORGCHCV  _IOR('x', 9, unsigned char)        /* get uv gain */
00096 #define METEORSCOUNT _IOW('x',10, struct meteor_counts)
00097 #define METEORGCOUNT _IOR('x',10, struct meteor_counts)
00098 #define METEORSFPS   _IOW('x',11, unsigned short)       /* set fps */
00099 #define METEORGFPS   _IOR('x',11, unsigned short)       /* get fps */
00100 #define METEORSSIGNAL _IOW('x', 12, unsigned int)       /* set signal */
00101 #define METEORGSIGNAL _IOR('x', 12, unsigned int)       /* get signal */
00102 #define METEORSVIDEO _IOW('x', 13, struct meteor_video) /* set video */
00103 #define METEORGVIDEO _IOR('x', 13, struct meteor_video) /* get video */
00104 #define METEORSBRIG  _IOW('x', 14, unsigned char)       /* set brightness */
00105 #define METEORGBRIG  _IOR('x', 14, unsigned char)       /* get brightness */
00106 #define METEORSCSAT  _IOW('x', 15, unsigned char)       /* set chroma sat */
00107 #define METEORGCSAT  _IOR('x', 15, unsigned char)       /* get uv saturation */
00108 #define METEORSCONT  _IOW('x', 16, unsigned char)       /* set contrast */
00109 #define METEORGCONT  _IOR('x', 16, unsigned char)       /* get contrast */
00110 #define METEORSBT254 _IOW('x', 17, unsigned short)      /* set Bt254 reg */
00111 #define METEORGBT254 _IOR('x', 17, unsigned short)      /* get Bt254 reg */
00112 #define METEORSHWS   _IOW('x', 18, unsigned char)       /* set hor start reg */
00113 #define METEORGHWS   _IOR('x', 18, unsigned char)       /* get hor start reg */
00114 #define METEORSVWS   _IOW('x', 19, unsigned char)       /* set vert start reg */
00115 #define METEORGVWS   _IOR('x', 19, unsigned char)       /* get vert start reg */
00116 #define METEORSTS    _IOW('x', 20, unsigned long)       /* set time stamp */
00117 #define METEORGTS    _IOR('x', 20, unsigned long)       /* get time stamp */
00118 #define METEORGFROFF _IOR('x', 21, struct meteor_frame_offset ) /* get frame offsets */
00119 #define METEORGCAPT  _IOR('x', 22, unsigned long)       /* get saa7116 capt_ctl (0x40) register */
00120 
00121 #define METEOR_STATUS_ID_MASK   0xf000  /* ID of 7196 */
00122 #define METEOR_STATUS_DIR       0x0800  /* Direction of Expansion port YUV */
00123 #define METEOR_STATUS_OEF       0x0200  /* Field detected: Even/Odd */
00124 #define METEOR_STATUS_SVP       0x0100  /* State of VRAM Port:inactive/active */
00125 #define METEOR_STATUS_STTC      0x0080  /* Time Constant: TV/VCR */
00126 #define METEOR_STATUS_HCLK      0x0040  /* Horiz PLL: locked/unlocked */
00127 #define METEOR_STATUS_FIDT      0x0020  /* Field detect: 50/60hz */
00128 #define METEOR_STATUS_ALTD      0x0002  /* Line alt: no line alt/line alt */
00129 #define METEOR_STATUS_CODE      0x0001  /* Colour info: no colour/colour */
00130 
00131                                 /* METEORCAPTUR capture options */
00132 #define METEOR_CAP_SINGLE       0x0001  /* capture one frame */
00133 #define METEOR_CAP_CONTINOUS    0x0002  /* continuously capture */
00134 #define METEOR_CAP_STOP_CONT    0x0004  /* stop the continuous capture */
00135 #define METEOR_CAP_CONT_ONCE    0x0008  /* capture all allocated frames once*/
00136 
00137                                 /* METEORCAPFRM capture commands */
00138 #define METEOR_CAP_N_FRAMES     0x0001  /* capture N frames */
00139 #define METEOR_CAP_STOP_FRAMES  0x0002  /* stop capture N frames */
00140 #define METEOR_HALT_N_FRAMES    0x0003  /* halt of capture N frames */
00141 #define METEOR_CONT_N_FRAMES    0x0004  /* continue after above halt */
00142 
00143                                 /* valid video input formats:  */
00144 #define METEOR_FMT_NTSC         0x00100 /* NTSC --  initialized default */
00145 #define METEOR_FMT_PAL          0x00200 /* PAL */
00146 #define METEOR_FMT_SECAM        0x00400 /* SECAM */
00147 #define METEOR_FMT_AUTOMODE     0x00800 /* auto-mode */
00148 #define METEOR_INPUT_DEV0       0x01000 /* camera input 0 -- default */
00149 #define METEOR_INPUT_DEV_RCA    METEOR_INPUT_DEV0
00150 #define METEOR_INPUT_DEV1       0x02000 /* camera input 1 */
00151 #define METEOR_INPUT_DEV2       0x04000 /* camera input 2 */
00152 #define METEOR_INPUT_DEV3       0x08000 /* camera input 3 */
00153 #define METEOR_INPUT_DEV_RGB    0x0a000 /* for rgb version of meteor */
00154 #define METEOR_INPUT_DEV_SVIDEO 0x06000 /* S-video input port */
00155 
00156                                 /* valid video output formats:  */
00157 #define METEOR_GEO_RGB16        0x0010000 /* packed -- initialized default */
00158 #define METEOR_GEO_RGB24        0x0020000 /* RBG 24 bits packed */
00159                                           /* internally stored in 32 bits */
00160 #define METEOR_GEO_YUV_PACKED   0x0040000 /* 4-2-2 YUV 16 bits packed */
00161 #define METEOR_GEO_YUV_PLANAR   0x0080000 /* 4-2-2 YUV 16 bits planar */
00162 #define METEOR_GEO_YUV_PLANER   METEOR_GEO_YUV_PLANAR
00163 #define METEOR_GEO_UNSIGNED     0x0400000 /* unsigned uv outputs */
00164 #define METEOR_GEO_EVEN_ONLY    0x1000000 /* set for even only field capture */
00165 #define METEOR_GEO_ODD_ONLY     0x2000000 /* set for odd only field capture */
00166 #define METEOR_GEO_FIELD_MASK   0x3000000
00167 #define METEOR_GEO_YUV_422      0x4000000 /* 4-2-2 YUV in Y-U-V combined */
00168 #define METEOR_GEO_OUTPUT_MASK  0x40f0000
00169 #define METEOR_GEO_YUV_12       0x10000000      /* YUV 12 format */
00170 #define METEOR_GEO_YUV_9        0x40000000      /* YUV 9 format */
00171 
00172 #define METEOR_FIELD_MODE       0x80000000
00173 
00174 #define METEOR_SIG_MODE_MASK    0xffff0000
00175 #define METEOR_SIG_FRAME        0x00000000 /* signal every frame */
00176 #define METEOR_SIG_FIELD        0x00010000 /* signal every field */
00177 
00178 
00179 /* following structure is used to coordinate the synchronous */
00180            
00181 struct meteor_mem {
00182                 /* kernel write only  */
00183         int     frame_size;      /* row*columns*depth */
00184         unsigned num_bufs;       /* number of frames in buffer (1-32) */
00185         u_long  frames_captured; /* total frames captured */
00186         int     cur_frame;       /* index of most recent acquisition */
00187         int     cur_field;       /* 0=even, 1=odd */
00188                 /* user and kernel change these */
00189         int     lowat;           /* kernel starts capture if < this number */
00190         int     hiwat;           /* kernel stops capture if > this number.
00191                                     hiwat <= numbufs */
00192         unsigned active;         /* bit mask of active frame buffers
00193                                     kernel sets, user clears */
00194         int     num_active_bufs; /* count of active frame buffer
00195                                     kernel increments, user decrements */
00196                 /* reference to mmapped data */
00197         caddr_t buf;             /* The real space (virtual addr) */
00198 } ;
00199 
00200 #endif /* ifndef __IOCTL_METEOR_H__ */

Generated on Wed Oct 5 14:36:12 2005 for RobotFlow by  doxygen 1.4.4