Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 #include <stdio.h>
  2 #include <sys/ioctl.h>
  3 
  4 #include "videodev.h"
  5 
  6 #include "struct-dump.h"
  7 #include "struct-v4l.h"
  8 
  9 /* ---------------------------------------------------------------------- */
 10 
 11 char *bits_vid_cap[32] = {
 12         "CAPTURE",
 13         "TUNER",
 14         "TELETEXT",
 15         "OVERLAY",
 16         "CHROMAKEY",
 17         "CLIPPING",
 18         "FRAMERAM",
 19         "SCALES",
 20         "MONOCHROME",
 21         "SUBCAPTURE",
 22         "MPEG_DECODER",
 23         "MPEG_ENCODER",
 24         "MJPEG_DECODER",
 25         "MJPEG_ENCODER",
 26 };
 27 
 28 char *bits_chan_flags[32] = {
 29         "TUNER",
 30         "AUDIO",
 31 };
 32 
 33 char *desc_chan_type[] = {
 34         [ VIDEO_TYPE_TV     ] = "TV",
 35         [ VIDEO_TYPE_CAMERA ] = "CAMERA",
 36 };
 37 
 38 char *bits_tuner_flags[32] = {
 39         "PAL",
 40         "NTSC",
 41         "SECAM",
 42         "LOW",
 43         "NORM",
 44         "?",
 45         "?",
 46         "STEREO_ON",
 47         "RDS_ON",
 48         "MBS_ON",
 49 };
 50 
 51 char *desc_tuner_mode[] = {
 52         [ VIDEO_MODE_PAL ]   = "PAL",
 53         [ VIDEO_MODE_NTSC ]  = "NTSC",
 54         [ VIDEO_MODE_SECAM ] = "SECAM",
 55         [ VIDEO_MODE_AUTO ]  = "AUTO",
 56 };
 57 
 58 char *desc_pict_palette[] = {
 59         [ VIDEO_PALETTE_GREY ]    = "GREY",
 60         [ VIDEO_PALETTE_HI240 ]   = "HI240",
 61         [ VIDEO_PALETTE_RGB565 ]  = "RGB565",
 62         [ VIDEO_PALETTE_RGB24 ]   = "RGB24",
 63         [ VIDEO_PALETTE_RGB32 ]   = "RGB32",
 64         [ VIDEO_PALETTE_RGB555 ]  = "RGB555",
 65         [ VIDEO_PALETTE_YUV422 ]  = "YUV422",
 66         [ VIDEO_PALETTE_YUYV ]    = "YUYV",
 67         [ VIDEO_PALETTE_UYVY ]    = "UYVY",
 68         [ VIDEO_PALETTE_YUV420 ]  = "YUV420",
 69         [ VIDEO_PALETTE_YUV411 ]  = "YUV411",
 70         [ VIDEO_PALETTE_RAW ]     = "RAW",
 71         [ VIDEO_PALETTE_YUV422P ] = "YUV422P",
 72         [ VIDEO_PALETTE_YUV411P ] = "YUV411P",
 73         [ VIDEO_PALETTE_YUV420P ] = "YUV420P",
 74         [ VIDEO_PALETTE_YUV410P ] = "YUV410P",
 75 };
 76 
 77 char *bits_audio_flags[32] = {
 78         "MUTE",
 79         "MUTABLE",
 80         "VOLUME",
 81         "BASS",
 82         "TREBLE",
 83         "BALANCE",
 84 };
 85 
 86 char *bits_audio_mode[32] = {
 87         "MONO",
 88         "STEREO",
 89         "LANG1",
 90         "LANG2",
 91 };
 92 
 93 /* ---------------------------------------------------------------------- */
 94 
 95 struct struct_desc desc_video_capability[] = {{
 96         .type   = STRING,
 97         .name   = "name",
 98         .length = 32,
 99 },{
100         .type   = BITS32,
101         .name   = "type",
102         .bits   = bits_vid_cap,
103 },{
104         .type   = SINT32,
105         .name   = "channels",
106 },{
107         .type   = SINT32,
108         .name   = "audios",
109 },{
110         .type   = SINT32,
111         .name   = "maxwidth",
112 },{
113         .type   = SINT32,
114         .name   = "maxheight",
115 },{
116         .type   = SINT32,
117         .name   = "minwidth",
118 },{
119         .type   = SINT32,
120         .name   = "minheight",
121 },{
122         /* end of list */
123 }};
124 
125 struct struct_desc desc_video_channel[] = {{
126         .type   = SINT32,
127         .name   = "channel",
128 },{
129         .type   = STRING,
130         .name   = "name",
131         .length = 32,
132 },{
133         .type   = SINT32,
134         .name   = "tuners",
135 },{
136         .type   = BITS32,
137         .name   = "flags",
138         .bits   = bits_chan_flags
139 },{
140         .type   = ENUM16,
141         .name   = "type",
142         .enums  = desc_chan_type,
143         .length = sizeof(desc_chan_type) / sizeof(char*),
144 },{
145         .type   = UINT16,
146         .name   = "norm",
147 },{
148         /* end of list */
149 }};
150 
151 struct struct_desc desc_video_tuner[] = {{
152         .type   = SINT32,
153         .name   = "tuner",
154 },{
155         .type   = STRING,
156         .name   = "name",
157         .length = 32,
158 },{
159         .type   = UINT32,
160         .name   = "rangelow",
161 },{
162         .type   = UINT32,
163         .name   = "rangehigh",
164 },{
165         .type   = BITS32,
166         .name   = "flags",
167         .bits   = bits_tuner_flags,
168 },{
169         .type   = ENUM16,
170         .name   = "mode",
171         .enums  = desc_tuner_mode,
172         .length = sizeof(desc_tuner_mode) / sizeof(char*),
173 },{
174         .type   = UINT16,
175         .name   = "signal",
176 },{
177         /* end of list */
178 }};
179 
180 struct struct_desc desc_video_picture[] = {{
181         .type   = UINT16,
182         .name   = "brightness",
183 },{
184         .type   = UINT16,
185         .name   = "hue",
186 },{
187         .type   = UINT16,
188         .name   = "colour",
189 },{
190         .type   = UINT16,
191         .name   = "contrast",
192 },{
193         .type   = UINT16,
194         .name   = "whiteness",
195 },{
196         .type   = UINT16,
197         .name   = "depth",
198 },{
199         .type   = ENUM16,
200         .name   = "palette",
201         .enums  = desc_pict_palette,
202         .length = sizeof(desc_pict_palette) / sizeof(char*),
203 },{
204         /* end of list */
205 }};
206 
207 struct struct_desc desc_video_audio[] = {{
208         .type   = SINT32,
209         .name   = "audio",
210 },{
211         .type   = UINT16,
212         .name   = "volume",
213 },{
214         .type   = UINT16,
215         .name   = "bass",
216 },{
217         .type   = UINT16,
218         .name   = "treble",
219 },{
220         .type   = PADDING,
221         .length = 2,
222 },{
223         .type   = BITS32,
224         .name   = "flags",
225         .bits   = bits_audio_flags,
226 },{
227         .type   = STRING,
228         .name   = "name",
229         .length = 16,
230 },{
231         .type   = BITS16,
232         .name   = "mode",
233         .bits   = bits_audio_mode,
234 },{
235         .type   = UINT16,
236         .name   = "balance",
237 },{
238         .type   = UINT16,
239         .name   = "step",
240 },{
241         /* end of list */
242 }};
243 
244 struct struct_desc desc_video_window[] = {{
245         .type   = UINT32,
246         .name   = "x",
247 },{
248         .type   = UINT32,
249         .name   = "y",
250 },{
251         .type   = UINT32,
252         .name   = "width",
253 },{
254         .type   = UINT32,
255         .name   = "height",
256 },{
257         .type   = UINT32,
258         .name   = "chromakey",
259 },{
260         .type   = UINT32,
261         .name   = "flags",
262 },{
263         /* end of list */
264 }};
265 
266 struct struct_desc desc_video_buffer[] = {{
267         .type   = PTR,
268         .name   = "base",
269 },{
270         .type   = SINT32,
271         .name   = "height",
272 },{
273         .type   = SINT32,
274         .name   = "width",
275 },{
276         .type   = SINT32,
277         .name   = "depth",
278 },{
279         .type   = SINT32,
280         .name   = "bytesperline",
281 },{
282         /* end of list */
283 }};
284 
285 struct struct_desc desc_video_mmap[] = {{
286         .type   = UINT32,
287         .name   = "frame",
288 },{
289         .type   = SINT32,
290         .name   = "height",
291 },{
292         .type   = SINT32,
293         .name   = "width",
294 },{
295         .type   = UINT32,
296         .name   = "format",
297 },{
298         /* end of list */
299 }};
300 
301 struct struct_desc desc_video_mbuf[] = {{
302         .type   = SINT32,
303         .name   = "size",
304 },{
305         .type   = SINT32,
306         .name   = "frames",
307 },{
308         .type   = SINT32,
309         .name   = "offsets",
310         /* FIXME len=32 */
311 },{
312         /* end of list */
313 }};
314 
315 /* ---------------------------------------------------------------------- */
316 
317 struct ioctl_desc ioctls_v4l1[256] = {
318         [_IOC_NR(VIDIOCGCAP)] = {
319                 .name = "VIDIOCGCAP",
320                 .desc = desc_video_capability,
321         },
322         [_IOC_NR(VIDIOCGCHAN)] = {
323                 .name = "VIDIOCGCHAN",
324                 .desc = desc_video_channel,
325         },
326         [_IOC_NR(VIDIOCSCHAN)] = {
327                 .name = "VIDIOCSCHAN",
328                 .desc = desc_video_channel,
329         },
330         [_IOC_NR(VIDIOCGTUNER)] = {
331                 .name = "VIDIOCGTUNER",
332                 .desc = desc_video_tuner,
333         },
334         [_IOC_NR(VIDIOCSTUNER)] = {
335                 .name = "VIDIOCSTUNER",
336                 .desc = desc_video_tuner,
337         },
338         [_IOC_NR(VIDIOCGPICT)] = {
339                 .name = "VIDIOCGPICT",
340                 .desc = desc_video_picture,
341         },
342         [_IOC_NR(VIDIOCSPICT)] = {
343                 .name = "VIDIOCSPICT",
344                 .desc = desc_video_picture,
345         },
346         [_IOC_NR(VIDIOCCAPTURE)] = {
347                 .name = "VIDIOCCAPTURE",
348                 .desc = desc_int,
349         },
350         [_IOC_NR(VIDIOCGWIN)] = {
351                 .name = "VIDIOCGWIN",
352                 .desc = desc_video_window,
353         },
354         [_IOC_NR(VIDIOCSWIN)] = {
355                 .name = "VIDIOCSWIN",
356                 .desc = desc_video_window,
357         },
358         [_IOC_NR(VIDIOCGFBUF)] = {
359                 .name = "VIDIOCGFBUF",
360                 .desc = desc_video_buffer,
361         },
362         [_IOC_NR(VIDIOCSFBUF)] = {
363                 .name = "VIDIOCSFBUF",
364                 .desc = desc_video_buffer,
365         },
366         [_IOC_NR(VIDIOCKEY)] = {
367                 .name = "VIDIOCKEY",
368 //              .desc = desc_video_key,
369         },
370         [_IOC_NR(VIDIOCGFREQ)] = {
371                 .name = "VIDIOCGFREQ",
372                 .desc = desc_long,
373         },
374         [_IOC_NR(VIDIOCSFREQ)] = {
375                 .name = "VIDIOCSFREQ",
376                 .desc = desc_long,
377         },
378         [_IOC_NR(VIDIOCGAUDIO)] = {
379                 .name = "VIDIOCGAUDIO",
380                 .desc = desc_video_audio,
381         },
382         [_IOC_NR(VIDIOCSAUDIO)] = {
383                 .name = "VIDIOCSAUDIO",
384                 .desc = desc_video_audio,
385         },
386         [_IOC_NR(VIDIOCSYNC)] = {
387                 .name = "VIDIOCSYNC",
388                 .desc = desc_int,
389         },
390         [_IOC_NR(VIDIOCMCAPTURE)] = {
391                 .name = "VIDIOCMCAPTURE",
392                 .desc = desc_video_mmap,
393         },
394         [_IOC_NR(VIDIOCGMBUF)] = {
395                 .name = "VIDIOCGMBUF",
396                 .desc = desc_video_mbuf,
397         },
398         [_IOC_NR(VIDIOCGUNIT)] = {
399                 .name = "VIDIOCGUNIT",
400 //              .desc = desc_video_unit,
401         },
402         [_IOC_NR(VIDIOCGCAPTURE)] = {
403                 .name = "VIDIOCGCAPTURE",
404 //              .desc = desc_video_capture,
405         },
406         [_IOC_NR(VIDIOCSCAPTURE)] = {
407                 .name = "VIDIOCSCAPTURE",
408 //              .desc = desc_video_capture,
409         },
410         [_IOC_NR(VIDIOCSPLAYMODE)] = {
411                 .name = "VIDIOCSPLAYMODE",
412 //              .desc = desc_video_play_mode,
413         },
414         [_IOC_NR(VIDIOCSWRITEMODE)] = {
415                 .name = "VIDIOCSWRITEMODE",
416                 .desc = desc_int,
417         },
418         [_IOC_NR(VIDIOCGPLAYINFO)] = {
419                 .name = "VIDIOCGPLAYINFO",
420 //              .desc = desc_video_info,
421         },
422         [_IOC_NR(VIDIOCSMICROCODE)] = {
423                 .name = "VIDIOCSMICROCODE",
424 //              .desc = desc_video_code,
425         },
426         [_IOC_NR(VIDIOCGVBIFMT)] = {
427                 .name = "VIDIOCGVBIFMT",
428 //              .desc = desc_vbi_format,
429         },
430         [_IOC_NR(VIDIOCSVBIFMT)] = {
431                 .name = "VIDIOCSVBIFMT",
432 //              .desc = desc_vbi_format,
433         },
434 };
435 
436 /* ---------------------------------------------------------------------- */
437 /*
438  * Local variables:
439  * c-basic-offset: 8
440  * End:
441  */
442 
  This page was automatically generated by the LXR engine.