~ubuntu-branches/ubuntu/gutsy/amsn/gutsy

« back to all changes in this revision

Viewing changes to utils/linux/capture/structs/struct-v4l2.c

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Karkoulis
  • Date: 2006-01-04 15:26:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104152602-ipe1yg00rl3nlklv
Tags: 0.95-1
New Upstream Release (closes: #345052, #278575).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <sys/ioctl.h>
 
3
#include <sys/time.h>
 
4
 
 
5
#include <asm/types.h>
 
6
#include "videodev2.h"
 
7
 
 
8
#include "struct-dump.h"
 
9
#include "struct-v4l2.h"
 
10
 
 
11
/* ---------------------------------------------------------------------- */
 
12
 
 
13
char *desc_v4l2_field[] = {
 
14
        [V4L2_FIELD_ANY]        = "ANY",
 
15
        [V4L2_FIELD_NONE]       = "NONE",
 
16
        [V4L2_FIELD_TOP]        = "TOP",
 
17
        [V4L2_FIELD_BOTTOM]     = "BOTTOM",
 
18
        [V4L2_FIELD_INTERLACED] = "INTERLACED",
 
19
        [V4L2_FIELD_SEQ_TB]     = "SEQ_TB",
 
20
        [V4L2_FIELD_SEQ_BT]     = "SEQ_BT",
 
21
        [V4L2_FIELD_ALTERNATE]  = "ALTERNATE",
 
22
};
 
23
 
 
24
char *desc_v4l2_buf_type[] = {
 
25
        [V4L2_BUF_TYPE_VIDEO_CAPTURE] = "VIDEO_CAPTURE",
 
26
        [V4L2_BUF_TYPE_VIDEO_OUTPUT]  = "VIDEO_OUTPUT",
 
27
        [V4L2_BUF_TYPE_VIDEO_OVERLAY] = "VIDEO_OVERLAY",
 
28
        [V4L2_BUF_TYPE_VBI_CAPTURE]   = "VBI_CAPTURE",
 
29
        [V4L2_BUF_TYPE_VBI_OUTPUT]    = "VBI_OUTPUT",
 
30
        [V4L2_BUF_TYPE_PRIVATE]       = "PRIVATE",
 
31
};
 
32
 
 
33
char *desc_v4l2_ctrl_type[] = {
 
34
        [V4L2_CTRL_TYPE_INTEGER] = "INTEGER",
 
35
        [V4L2_CTRL_TYPE_BOOLEAN] = "BOOLEAN",
 
36
        [V4L2_CTRL_TYPE_MENU]    = "MENU",
 
37
        [V4L2_CTRL_TYPE_BUTTON]  = "BUTTON",
 
38
};
 
39
 
 
40
char *desc_v4l2_tuner_type[] = {
 
41
        [V4L2_TUNER_RADIO]     = "RADIO",
 
42
        [V4L2_TUNER_ANALOG_TV] = "ANALOG_TV",
 
43
};
 
44
 
 
45
char *desc_v4l2_memory[] = {
 
46
        [V4L2_MEMORY_MMAP]    = "MMAP",
 
47
        [V4L2_MEMORY_USERPTR] = "USERPTR",
 
48
        [V4L2_MEMORY_OVERLAY] = "OVERLAY",
 
49
};
 
50
 
 
51
char *desc_v4l2_colorspace[] = {
 
52
        [V4L2_COLORSPACE_SMPTE170M]     = "SMPTE170M",
 
53
        [V4L2_COLORSPACE_SMPTE240M]     = "SMPTE240M",
 
54
        [V4L2_COLORSPACE_REC709]        = "REC709",
 
55
        [V4L2_COLORSPACE_BT878]         = "BT878",
 
56
        [V4L2_COLORSPACE_470_SYSTEM_M]  = "470_SYSTEM_M",
 
57
        [V4L2_COLORSPACE_470_SYSTEM_BG] = "470_SYSTEM_BG",
 
58
        [V4L2_COLORSPACE_JPEG]          = "JPEG",
 
59
        [V4L2_COLORSPACE_SRGB]          = "SRGB",
 
60
};
 
61
 
 
62
char *bits_capabilities[32] = {
 
63
        "VIDEO_CAPTURE", "VIDEO_OUTPUT", "VIDEO_OVERLAY", "",
 
64
        "VBI_CAPTURE", "VBI_OUTPUT",   "?","?",
 
65
        "RDS_CAPTURE", "?", "?", "?",
 
66
        "?", "?", "?", "?",
 
67
        "TUNER", "AUDIO", "?", "?",
 
68
        "?", "?", "?", "?",
 
69
        "READWRITE", "ASYNCIO", "STREAMING", "?",
 
70
};
 
71
 
 
72
char *bits_standard[64] = {
 
73
        "PAL_B",      "PAL_B1",      "PAL_G",   "PAL_H",
 
74
        "PAL_I",      "PAL_D",       "PAL_D1",  "PAL_K",
 
75
        "PAL_M",      "PAL_N",       "PAL_Nc",  "PAL_60",
 
76
        "NTSC_M",     "NTSC_M_JP",   "?", "?",
 
77
        "SECAM_B",    "SECAM_D",     "SECAM_G", "SECAM_H",
 
78
        "SECAM_K",    "SECAM_K1",    "SECAM_L", "?"
 
79
        "ATSC_8_VSB", "ATSC_16_VSB",
 
80
};
 
81
 
 
82
char *bits_buf_flags[32] = {
 
83
        "MAPPED",
 
84
        "QUEUED",
 
85
        "DONE",
 
86
        "KEYFRAME",
 
87
        "PFRAME",
 
88
        "BFRAME",
 
89
        "?", "?",
 
90
        "TIMECODE",
 
91
};
 
92
 
 
93
char *bits_fbuf_cap[32] = {
 
94
        "EXTERNOVERLAY",
 
95
        "CHROMAKEY",
 
96
        "LIST_CLIPPING",
 
97
        "BITMAP_CLIPPING",
 
98
};
 
99
 
 
100
char *bits_fbuf_flags[32] = {
 
101
        "PRIMARY",
 
102
        "OVERLAY",
 
103
        "CHROMAKEY",
 
104
};
 
105
 
 
106
char *desc_input_type[32] = {
 
107
        [ V4L2_INPUT_TYPE_TUNER ]  = "TUNER",
 
108
        [ V4L2_INPUT_TYPE_CAMERA ] = "CAMERA",
 
109
};
 
110
 
 
111
char *bits_input_status[32] = {
 
112
        "NO_POWER", "NO_SIGNAL", "NO_COLOR", "?",
 
113
        "?","?","?","?",
 
114
        "NO_H_LOCK", "COLOR_KILL", "?", "?",
 
115
        "?","?","?","?",
 
116
        "NO_SYNC", "NO_EQU", "NO_CARRIER", "?",
 
117
        "?","?","?","?",
 
118
        "MACROVISION", "NO_ACCESS", "VTR", "?",
 
119
        "?","?","?","?",
 
120
};
 
121
 
 
122
char *bits_tuner_cap[32] = {
 
123
        "LOW", "NORM", "?", "?",
 
124
        "STEREO", "LANG2", "LANG1", "?",
 
125
};
 
126
 
 
127
char *bits_tuner_rx[32] = {
 
128
        "MONO",
 
129
        "STEREO",
 
130
        "LANG2",
 
131
        "LANG1",
 
132
};
 
133
 
 
134
char *desc_tuner2_mode[] = {
 
135
        [ V4L2_TUNER_MODE_MONO ]   = "MONO",
 
136
        [ V4L2_TUNER_MODE_STEREO ] = "STEREO",
 
137
        [ V4L2_TUNER_MODE_LANG2 ]  = "LANG2",
 
138
        [ V4L2_TUNER_MODE_LANG1 ]  = "LANG1",
 
139
};
 
140
 
 
141
/* ---------------------------------------------------------------------- */
 
142
 
 
143
struct struct_desc desc_v4l2_rect[] = {{
 
144
        .type   = SINT32,
 
145
        .name   = "left",
 
146
},{
 
147
        .type   = SINT32,
 
148
        .name   = "top",
 
149
},{
 
150
        .type   = SINT32,
 
151
        .name   = "width",
 
152
},{
 
153
        .type   = SINT32,
 
154
        .name   = "height",
 
155
},{
 
156
        /* end of list */
 
157
}};
 
158
 
 
159
struct struct_desc desc_v4l2_fract[] = {{
 
160
        .type   = UINT32,
 
161
        .name   = "numerator",
 
162
},{
 
163
        .type   = UINT32,
 
164
        .name   = "denominator",
 
165
},{
 
166
        /* end of list */
 
167
}};
 
168
 
 
169
struct struct_desc desc_v4l2_capability[] = {{
 
170
        .type   = STRING,
 
171
        .name   = "driver",
 
172
        .length = 16,
 
173
},{
 
174
        .type   = STRING,
 
175
        .name   = "card",
 
176
        .length = 32,
 
177
},{
 
178
        .type   = STRING,
 
179
        .name   = "bus_info",
 
180
        .length = 32,
 
181
},{
 
182
        .type   = VER,
 
183
        .name   = "version",
 
184
},{
 
185
        .type   = BITS32,
 
186
        .name   = "capabilities",
 
187
        .bits   = bits_capabilities,
 
188
},{
 
189
        /* end of list */
 
190
}};
 
191
 
 
192
struct struct_desc desc_v4l2_pix_format[] = {{
 
193
        .type   = UINT32,
 
194
        .name   = "width",
 
195
},{
 
196
        .type   = UINT32,
 
197
        .name   = "height",
 
198
},{
 
199
        .type   = FOURCC,
 
200
        .name   = "pixelformat",
 
201
},{
 
202
        .type   = ENUM32,
 
203
        .name   = "field",
 
204
        .enums  = desc_v4l2_field,
 
205
        .length = sizeof(desc_v4l2_field) / sizeof(char*),
 
206
},{
 
207
        .type   = UINT32,
 
208
        .name   = "bytesperline",
 
209
},{
 
210
        .type   = UINT32,
 
211
        .name   = "sizeimage",
 
212
},{
 
213
        .type   = ENUM32,
 
214
        .name   = "colorspace",
 
215
        .enums  = desc_v4l2_colorspace,
 
216
        .length = sizeof(desc_v4l2_colorspace) / sizeof(char*),
 
217
},{
 
218
        .type   = UINT32,
 
219
        .name   = "priv",
 
220
},{
 
221
        /* end of list */
 
222
}};
 
223
 
 
224
struct struct_desc desc_v4l2_fmtdesc[] = {{
 
225
        .type   = UINT32,
 
226
        .name   = "index",
 
227
},{
 
228
        .type   = ENUM32,
 
229
        .name   = "type",
 
230
        .enums  = desc_v4l2_buf_type,
 
231
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
232
},{
 
233
        .type   = UINT32,
 
234
        .name   = "flags",
 
235
},{
 
236
        .type   = STRING,
 
237
        .name   = "description",
 
238
        .length = 32,
 
239
},{
 
240
        .type   = FOURCC,
 
241
        .name   = "pixelformat",
 
242
},{
 
243
        /* end of list */
 
244
}};
 
245
 
 
246
struct struct_desc desc_v4l2_timecode[] = {{
 
247
        .type   = UINT32,
 
248
        .name   = "type",
 
249
},{
 
250
        .type   = UINT32,
 
251
        .name   = "flags",
 
252
},{
 
253
        .type   = UINT8,
 
254
        .name   = "frames",
 
255
},{
 
256
        .type   = UINT8,
 
257
        .name   = "seconds",
 
258
},{
 
259
        .type   = UINT8,
 
260
        .name   = "minutes",
 
261
},{
 
262
        .type   = UINT8,
 
263
        .name   = "hours",
 
264
},{
 
265
        .type   = STRING,
 
266
        .name   = "userbits",
 
267
        .length = 4,
 
268
},{
 
269
        /* end of list */
 
270
}};
 
271
 
 
272
struct struct_desc desc_v4l2_compression[] = {{
 
273
        .type   = UINT32,
 
274
        .name   = "quality",
 
275
},{
 
276
        .type   = UINT32,
 
277
        .name   = "keyframerate",
 
278
},{
 
279
        .type   = UINT32,
 
280
        .name   = "pframerate",
 
281
},{
 
282
        /* end of list */
 
283
}};
 
284
 
 
285
struct struct_desc desc_v4l2_jpegcompression[] = {{
 
286
        .type   = SINT32,
 
287
        .name   = "quality",
 
288
},{
 
289
        .type   = SINT32,
 
290
        .name   = "APPn",
 
291
},{
 
292
        .type   = SINT32,
 
293
        .name   = "APP_len",
 
294
},{
 
295
        .type   = STRING,
 
296
        .name   = "APP_data",
 
297
        .length = 60,
 
298
},{
 
299
        .type   = SINT32,
 
300
        .name   = "COM_len",
 
301
},{
 
302
        .type   = STRING,
 
303
        .name   = "COM_data",
 
304
        .length = 60,
 
305
},{
 
306
        .type   = UINT32,
 
307
        .name   = "jpeg_markers",
 
308
},{
 
309
        /* end of list */
 
310
}};
 
311
 
 
312
struct struct_desc desc_v4l2_requestbuffers[] = {{
 
313
        .type   = UINT32,
 
314
        .name   = "count",
 
315
},{
 
316
        .type   = ENUM32,
 
317
        .name   = "type",
 
318
        .enums  = desc_v4l2_buf_type,
 
319
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
320
},{
 
321
        .type   = ENUM32,
 
322
        .name   = "memory",
 
323
        .enums  = desc_v4l2_memory,
 
324
        .length = sizeof(desc_v4l2_memory) / sizeof(char*),
 
325
},{
 
326
        /* end of list */
 
327
}};
 
328
 
 
329
struct struct_desc desc_v4l2_buffer[] = {{
 
330
        .type   = UINT32,
 
331
        .name   = "index",
 
332
},{
 
333
        .type   = ENUM32,
 
334
        .name   = "type",
 
335
        .enums  = desc_v4l2_buf_type,
 
336
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
337
},{
 
338
        .type   = UINT32,
 
339
        .name   = "bytesused",
 
340
},{
 
341
        .type   = BITS32,
 
342
        .name   = "flags",
 
343
        .bits   = bits_buf_flags,
 
344
},{
 
345
        .type   = ENUM32,
 
346
        .name   = "field",
 
347
        .enums  = desc_v4l2_field,
 
348
        .length = sizeof(desc_v4l2_field) / sizeof(char*),
 
349
},{
 
350
        .type   = STRUCT,
 
351
        .name   = "timestamp",
 
352
        .desc   = desc_timeval,
 
353
        .length = sizeof(struct timeval),
 
354
},{
 
355
        .type   = STRUCT,
 
356
        .name   = "timecode",
 
357
        .desc   = desc_v4l2_timecode,
 
358
        .length = sizeof(struct v4l2_timecode),
 
359
},{
 
360
        .type   = UINT32,
 
361
        .name   = "sequence",
 
362
},{
 
363
        .type   = ENUM32,
 
364
        .name   = "memory",
 
365
        .enums  = desc_v4l2_memory,
 
366
        .length = sizeof(desc_v4l2_memory) / sizeof(char*),
 
367
},{
 
368
        /* FIXME ... */
 
369
        /* end of list */
 
370
}};
 
371
 
 
372
struct struct_desc desc_v4l2_framebuffer[] = {{
 
373
        .type   = BITS32,
 
374
        .name   = "capability",
 
375
        .bits   = bits_fbuf_cap,
 
376
},{
 
377
        .type   = BITS32,
 
378
        .name   = "flags",
 
379
        .bits   = bits_fbuf_flags,
 
380
},{
 
381
        .type   = PTR,
 
382
        .name   = "base",
 
383
},{
 
384
        .type   = STRUCT,
 
385
        .name   = "fmt",
 
386
        .desc   = desc_v4l2_pix_format,
 
387
        .length = sizeof(struct v4l2_pix_format),
 
388
},{
 
389
        /* end of list */
 
390
}};
 
391
 
 
392
struct struct_desc desc_v4l2_clip[] = {{
 
393
        .type   = STRUCT,
 
394
        .name   = "c",
 
395
        .desc   = desc_v4l2_rect,
 
396
        .length = sizeof(struct v4l2_rect),
 
397
},{
 
398
        /* end of list */
 
399
}};
 
400
 
 
401
struct struct_desc desc_v4l2_window[] = {{
 
402
        .type   = STRUCT,
 
403
        .name   = "w",
 
404
        .desc   = desc_v4l2_rect,
 
405
        .length = sizeof(struct v4l2_rect),
 
406
},{
 
407
        .type   = ENUM32,
 
408
        .name   = "field",
 
409
        .enums  = desc_v4l2_field,
 
410
        .length = sizeof(desc_v4l2_field) / sizeof(char*),
 
411
},{
 
412
        .type   = UINT32,
 
413
        .name   = "chromakey",
 
414
},{
 
415
        .type   = PTR,
 
416
        .name   = "clips",
 
417
},{
 
418
        .type   = UINT32,
 
419
        .name   = "clipcount",
 
420
},{
 
421
        .type   = PTR,
 
422
        .name   = "bitmap",
 
423
},{
 
424
        /* end of list */
 
425
}};
 
426
 
 
427
struct struct_desc desc_v4l2_captureparm[] = {{
 
428
        .type   = UINT32,
 
429
        .name   = "capability",
 
430
},{
 
431
        .type   = UINT32,
 
432
        .name   = "capturemode",
 
433
},{
 
434
        .type   = STRUCT,
 
435
        .name   = "timeperframe",
 
436
        .desc   = desc_v4l2_fract,
 
437
        .length = sizeof(struct v4l2_fract),
 
438
},{
 
439
        .type   = UINT32,
 
440
        .name   = "extendedmode",
 
441
},{
 
442
        .type   = UINT32,
 
443
        .name   = "readbuffers",
 
444
},{
 
445
        /* end of list */
 
446
}};
 
447
 
 
448
struct struct_desc desc_v4l2_outputparm[] = {{
 
449
        .type   = UINT32,
 
450
        .name   = "capability",
 
451
},{
 
452
        .type   = UINT32,
 
453
        .name   = "outputmode",
 
454
},{
 
455
        .type   = STRUCT,
 
456
        .name   = "timeperframe",
 
457
        .desc   = desc_v4l2_fract,
 
458
        .length = sizeof(struct v4l2_fract),
 
459
},{
 
460
        .type   = UINT32,
 
461
        .name   = "extendedmode",
 
462
},{
 
463
        .type   = UINT32,
 
464
        .name   = "writebuffers",
 
465
},{
 
466
        /* end of list */
 
467
}};
 
468
 
 
469
struct struct_desc desc_v4l2_cropcap[] = {{
 
470
        .type   = ENUM32,
 
471
        .name   = "type",
 
472
        .enums  = desc_v4l2_buf_type,
 
473
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
474
},{
 
475
        .type   = STRUCT,
 
476
        .name   = "bounds",
 
477
        .desc   = desc_v4l2_rect,
 
478
        .length = sizeof(struct v4l2_rect),
 
479
},{
 
480
        .type   = STRUCT,
 
481
        .name   = "defrect",
 
482
        .desc   = desc_v4l2_rect,
 
483
        .length = sizeof(struct v4l2_rect),
 
484
},{
 
485
        .type   = STRUCT,
 
486
        .name   = "pixelaspect",
 
487
        .desc   = desc_v4l2_fract,
 
488
        .length = sizeof(struct v4l2_fract),
 
489
},{
 
490
        /* end of list */
 
491
}};
 
492
 
 
493
struct struct_desc desc_v4l2_crop[] = {{
 
494
        .type   = ENUM32,
 
495
        .name   = "type",
 
496
        .enums  = desc_v4l2_buf_type,
 
497
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
498
},{
 
499
        .type   = STRUCT,
 
500
        .name   = "c",
 
501
        .desc   = desc_v4l2_rect,
 
502
        .length = sizeof(struct v4l2_rect),
 
503
},{
 
504
        /* end of list */
 
505
}};
 
506
 
 
507
struct struct_desc desc_v4l2_standard[] = {{
 
508
        .type   = UINT32,
 
509
        .name   = "index",
 
510
},{
 
511
        .type   = BITS64,
 
512
        .name   = "id",
 
513
        .bits   = bits_standard,
 
514
},{
 
515
        .type   = STRING,
 
516
        .name   = "name",
 
517
        .length = 24,
 
518
},{
 
519
        .type   = STRUCT,
 
520
        .name   = "frameperiod",
 
521
        .desc   = desc_v4l2_fract,
 
522
        .length = sizeof(struct v4l2_fract),
 
523
},{
 
524
        .type   = UINT32,
 
525
        .name   = "framelines",
 
526
},{
 
527
        /* end of list */
 
528
}};
 
529
 
 
530
struct struct_desc desc_v4l2_input[] = {{
 
531
        .type   = UINT32,
 
532
        .name   = "index",
 
533
},{
 
534
        .type   = STRING,
 
535
        .name   = "name",
 
536
        .length = 32,
 
537
},{
 
538
        .type   = ENUM32,
 
539
        .name   = "type",
 
540
        .enums  = desc_input_type,
 
541
        .length = sizeof(desc_input_type) / sizeof(char*),
 
542
},{
 
543
        .type   = UINT32,
 
544
        .name   = "audioset",
 
545
},{
 
546
        .type   = UINT32,
 
547
        .name   = "tuner",
 
548
},{
 
549
        .type   = BITS64,
 
550
        .name   = "std",
 
551
        .bits   = bits_standard
 
552
},{
 
553
        .type   = BITS32,
 
554
        .name   = "status",
 
555
        .bits   = bits_input_status,
 
556
},{
 
557
        /* end of list */
 
558
}};
 
559
 
 
560
struct struct_desc desc_v4l2_output[] = {{
 
561
        .type   = UINT32,
 
562
        .name   = "index",
 
563
},{
 
564
        .type   = STRING,
 
565
        .name   = "name",
 
566
        .length = 32,
 
567
},{
 
568
        .type   = UINT32,
 
569
        .name   = "type",
 
570
},{
 
571
        .type   = UINT32,
 
572
        .name   = "audioset",
 
573
},{
 
574
        .type   = UINT32,
 
575
        .name   = "modulator",
 
576
},{
 
577
        .type   = BITS64,
 
578
        .name   = "std",
 
579
        .bits   = bits_standard
 
580
},{
 
581
        /* end of list */
 
582
}};
 
583
 
 
584
struct struct_desc desc_v4l2_control[] = {{
 
585
        .type   = UINT32,
 
586
        .name   = "id",
 
587
},{
 
588
        .type   = SINT32,
 
589
        .name   = "value",
 
590
},{
 
591
        /* end of list */
 
592
}};
 
593
 
 
594
struct struct_desc desc_v4l2_queryctrl[] = {{
 
595
        .type   = UINT32,
 
596
        .name   = "id",
 
597
},{
 
598
        .type   = ENUM32,
 
599
        .name   = "type",
 
600
        .enums  = desc_v4l2_ctrl_type,
 
601
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
602
},{
 
603
        .type   = STRING,
 
604
        .name   = "name",
 
605
        .length = 32,
 
606
},{
 
607
        .type   = SINT32,
 
608
        .name   = "minimum",
 
609
},{
 
610
        .type   = SINT32,
 
611
        .name   = "maximum",
 
612
},{
 
613
        .type   = SINT32,
 
614
        .name   = "step",
 
615
},{
 
616
        .type   = SINT32,
 
617
        .name   = "default_value",
 
618
},{
 
619
        .type   = UINT32,
 
620
        .name   = "flags",
 
621
},{
 
622
        /* end of list */
 
623
}};
 
624
 
 
625
struct struct_desc desc_v4l2_querymenu[] = {{
 
626
        .type   = UINT32,
 
627
        .name   = "id",
 
628
},{
 
629
        .type   = UINT32,
 
630
        .name   = "index",
 
631
},{
 
632
        .type   = STRING,
 
633
        .name   = "name",
 
634
        .length = 32,
 
635
},{
 
636
        .type   = UINT32,
 
637
        .name   = "reserved",
 
638
},{
 
639
        /* end of list */
 
640
}};
 
641
 
 
642
struct struct_desc desc_v4l2_tuner[] = {{
 
643
        .type   = UINT32,
 
644
        .name   = "index",
 
645
},{
 
646
        .type   = STRING,
 
647
        .name   = "name",
 
648
        .length = 32,
 
649
},{
 
650
        .type   = ENUM32,
 
651
        .name   = "type",
 
652
        .enums  = desc_v4l2_tuner_type,
 
653
        .length = sizeof(desc_v4l2_tuner_type) / sizeof(char*),
 
654
},{
 
655
        .type   = BITS32,
 
656
        .name   = "capability",
 
657
        .bits   = bits_tuner_cap,
 
658
},{
 
659
        .type   = UINT32,
 
660
        .name   = "rangelow",
 
661
},{
 
662
        .type   = UINT32,
 
663
        .name   = "rangehigh",
 
664
},{
 
665
        .type   = BITS32,
 
666
        .name   = "rxsubchans",
 
667
        .bits   = bits_tuner_rx,
 
668
},{
 
669
        .type   = ENUM32,
 
670
        .name   = "audmode",
 
671
        .enums  = desc_tuner2_mode,
 
672
        .length = sizeof(desc_tuner2_mode) / sizeof(char*),
 
673
},{
 
674
        .type   = SINT32,
 
675
        .name   = "signal",
 
676
},{
 
677
        .type   = SINT32,
 
678
        .name   = "afc",
 
679
},{
 
680
        /* end of list */
 
681
}};
 
682
 
 
683
struct struct_desc desc_v4l2_modulator[] = {{
 
684
        .type   = UINT32,
 
685
        .name   = "index",
 
686
},{
 
687
        .type   = STRING,
 
688
        .name   = "name",
 
689
        .length = 32,
 
690
},{
 
691
        .type   = UINT32,
 
692
        .name   = "capability",
 
693
},{
 
694
        .type   = UINT32,
 
695
        .name   = "rangelow",
 
696
},{
 
697
        .type   = UINT32,
 
698
        .name   = "rangehigh",
 
699
},{
 
700
        .type   = UINT32,
 
701
        .name   = "txsubchans",
 
702
},{
 
703
        /* end of list */
 
704
}};
 
705
 
 
706
struct struct_desc desc_v4l2_frequency[] = {{
 
707
        .type   = UINT32,
 
708
        .name   = "tuner",
 
709
},{
 
710
        .type   = ENUM32,
 
711
        .name   = "type",
 
712
        .enums  = desc_v4l2_tuner_type,
 
713
        .length = sizeof(desc_v4l2_tuner_type) / sizeof(char*),
 
714
},{
 
715
        .type   = UINT32,
 
716
        .name   = "frequency",
 
717
},{
 
718
        /* end of list */
 
719
}};
 
720
 
 
721
struct struct_desc desc_v4l2_audio[] = {{
 
722
        .type   = UINT32,
 
723
        .name   = "index",
 
724
},{
 
725
        .type   = STRING,
 
726
        .name   = "name",
 
727
        .length = 32,
 
728
},{
 
729
        .type   = UINT32,
 
730
        .name   = "capability",
 
731
},{
 
732
        .type   = UINT32,
 
733
        .name   = "mode",
 
734
},{
 
735
        /* end of list */
 
736
}};
 
737
 
 
738
struct struct_desc desc_v4l2_audioout[] = {{
 
739
        .type   = UINT32,
 
740
        .name   = "index",
 
741
},{
 
742
        .type   = STRING,
 
743
        .name   = "name",
 
744
        .length = 32,
 
745
},{
 
746
        .type   = UINT32,
 
747
        .name   = "capability",
 
748
},{
 
749
        .type   = UINT32,
 
750
        .name   = "mode",
 
751
},{
 
752
        /* end of list */
 
753
}};
 
754
 
 
755
struct struct_desc desc_v4l2_vbi_format[] = {{
 
756
        .type   = UINT32,
 
757
        .name   = "sampling_rate",
 
758
},{
 
759
        .type   = UINT32,
 
760
        .name   = "offset",
 
761
},{
 
762
        .type   = UINT32,
 
763
        .name   = "samples_per_line",
 
764
},{
 
765
        .type   = FOURCC,
 
766
        .name   = "sample_format",
 
767
},{
 
768
        .type   = UINT32,
 
769
        .name   = "start[0]",
 
770
},{
 
771
        .type   = UINT32,
 
772
        .name   = "start[1]",
 
773
},{
 
774
        .type   = UINT32,
 
775
        .name   = "count[0]",
 
776
},{
 
777
        .type   = UINT32,
 
778
        .name   = "count[1]",
 
779
},{
 
780
        .type   = UINT32,
 
781
        .name   = "flags",
 
782
},{
 
783
        /* end of list */
 
784
}};
 
785
 
 
786
struct struct_desc desc_v4l2_format[] = {{
 
787
        .type   = ENUM32,
 
788
        .name   = "type",
 
789
        .enums  = desc_v4l2_buf_type,
 
790
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
791
},{
 
792
        .type   = UNION,
 
793
        .name   = "fmt",
 
794
        .u = {{
 
795
                .value = V4L2_BUF_TYPE_VIDEO_CAPTURE,
 
796
                .name  = "pix",
 
797
                .desc  = desc_v4l2_pix_format,
 
798
        },{
 
799
                .value = V4L2_BUF_TYPE_VIDEO_OVERLAY,
 
800
                .name  = "win",
 
801
                .desc  = desc_v4l2_window,
 
802
        },{
 
803
                .value = V4L2_BUF_TYPE_VBI_CAPTURE,
 
804
                .name  = "vbi",
 
805
                .desc  = desc_v4l2_vbi_format,
 
806
        },{
 
807
                /* end of list */
 
808
        }},
 
809
},{
 
810
        /* end of list */
 
811
}};
 
812
 
 
813
struct struct_desc desc_v4l2_streamparm[] = {{
 
814
        .type   = ENUM32,
 
815
        .name   = "type",
 
816
        .enums  = desc_v4l2_buf_type,
 
817
        .length = sizeof(desc_v4l2_buf_type) / sizeof(char*),
 
818
},{
 
819
        /* FIXME ... */
 
820
        /* end of list */
 
821
}};
 
822
 
 
823
struct struct_desc desc_v4l2_std_id[] = {{
 
824
        .type   = BITS64,
 
825
        .name   = "std",
 
826
        .bits   = bits_standard,
 
827
},{
 
828
        /* end of list */
 
829
}};
 
830
 
 
831
/* ---------------------------------------------------------------------- */
 
832
 
 
833
struct ioctl_desc ioctls_v4l2[256] = {
 
834
        [_IOC_NR(VIDIOC_QUERYCAP)] = {
 
835
                .name = "VIDIOC_QUERYCAP",
 
836
                .desc = desc_v4l2_capability,
 
837
        },
 
838
        [_IOC_NR(VIDIOC_ENUM_FMT)] = {
 
839
                .name = "VIDIOC_ENUM_FMT",
 
840
                .desc = desc_v4l2_fmtdesc,
 
841
        },
 
842
        [_IOC_NR(VIDIOC_G_FMT)] = {
 
843
                .name = "VIDIOC_G_FMT",
 
844
                .desc = desc_v4l2_format,
 
845
        },
 
846
        [_IOC_NR(VIDIOC_S_FMT)] = {
 
847
                .name = "VIDIOC_S_FMT",
 
848
                .desc = desc_v4l2_format,
 
849
        },
 
850
#if 0
 
851
        [_IOC_NR(VIDIOC_G_COMP)] = {
 
852
                .name = "VIDIOC_G_COMP",
 
853
                .desc = desc_v4l2_compression,
 
854
        },
 
855
        [_IOC_NR(VIDIOC_S_COMP)] = {
 
856
                .name = "VIDIOC_S_COMP",
 
857
                .desc = desc_v4l2_compression,
 
858
        },
 
859
#endif
 
860
        [_IOC_NR(VIDIOC_REQBUFS)] = {
 
861
                .name = "VIDIOC_REQBUFS",
 
862
                .desc = desc_v4l2_requestbuffers,
 
863
        },
 
864
        [_IOC_NR(VIDIOC_QUERYBUF)] = {
 
865
                .name = "VIDIOC_QUERYBUF",
 
866
                .desc = desc_v4l2_buffer,
 
867
        },
 
868
        [_IOC_NR(VIDIOC_G_FBUF)] = {
 
869
                .name = "VIDIOC_G_FBUF",
 
870
                .desc = desc_v4l2_framebuffer,
 
871
        },
 
872
        [_IOC_NR(VIDIOC_S_FBUF)] = {
 
873
                .name = "VIDIOC_S_FBUF",
 
874
                .desc = desc_v4l2_framebuffer,
 
875
        },
 
876
        [_IOC_NR(VIDIOC_OVERLAY)] = {
 
877
                .name = "VIDIOC_OVERLAY",
 
878
                .desc = desc_int,
 
879
        },
 
880
        [_IOC_NR(VIDIOC_QBUF)] = {
 
881
                .name = "VIDIOC_QBUF",
 
882
                .desc = desc_v4l2_buffer,
 
883
        },
 
884
        [_IOC_NR(VIDIOC_DQBUF)] = {
 
885
                .name = "VIDIOC_DQBUF",
 
886
                .desc = desc_v4l2_buffer,
 
887
        },
 
888
        [_IOC_NR(VIDIOC_STREAMON)] = {
 
889
                .name = "VIDIOC_STREAMON",
 
890
                .desc = desc_int,
 
891
        },
 
892
        [_IOC_NR(VIDIOC_STREAMOFF)] = {
 
893
                .name = "VIDIOC_STREAMOFF",
 
894
                .desc = desc_int,
 
895
        },
 
896
        [_IOC_NR(VIDIOC_G_PARM)] = {
 
897
                .name = "VIDIOC_G_PARM",
 
898
                .desc = desc_v4l2_streamparm,
 
899
        },
 
900
        [_IOC_NR(VIDIOC_S_PARM)] = {
 
901
                .name = "VIDIOC_S_PARM",
 
902
                .desc = desc_v4l2_streamparm,
 
903
        },
 
904
        [_IOC_NR(VIDIOC_G_STD)] = {
 
905
                .name = "VIDIOC_G_STD",
 
906
                .desc = desc_v4l2_std_id,
 
907
        },
 
908
        [_IOC_NR(VIDIOC_S_STD)] = {
 
909
                .name = "VIDIOC_S_STD",
 
910
                .desc = desc_v4l2_std_id,
 
911
        },
 
912
        [_IOC_NR(VIDIOC_ENUMSTD)] = {
 
913
                .name = "VIDIOC_ENUMSTD",
 
914
                .desc = desc_v4l2_standard,
 
915
        },
 
916
        [_IOC_NR(VIDIOC_ENUMINPUT)] = {
 
917
                .name = "VIDIOC_ENUMINPUT",
 
918
                .desc = desc_v4l2_input,
 
919
        },
 
920
        [_IOC_NR(VIDIOC_G_CTRL)] = {
 
921
                .name = "VIDIOC_G_CTRL",
 
922
                .desc = desc_v4l2_control,
 
923
        },
 
924
        [_IOC_NR(VIDIOC_S_CTRL)] = {
 
925
                .name = "VIDIOC_S_CTRL",
 
926
                .desc = desc_v4l2_control,
 
927
        },
 
928
        [_IOC_NR(VIDIOC_G_TUNER)] = {
 
929
                .name = "VIDIOC_G_TUNER",
 
930
                .desc = desc_v4l2_tuner,
 
931
        },
 
932
        [_IOC_NR(VIDIOC_S_TUNER)] = {
 
933
                .name = "VIDIOC_S_TUNER",
 
934
                .desc = desc_v4l2_tuner,
 
935
        },
 
936
        [_IOC_NR(VIDIOC_G_AUDIO)] = {
 
937
                .name = "VIDIOC_G_AUDIO",
 
938
                .desc = desc_v4l2_audio,
 
939
        },
 
940
        [_IOC_NR(VIDIOC_S_AUDIO)] = {
 
941
                .name = "VIDIOC_S_AUDIO",
 
942
                .desc = desc_v4l2_audio,
 
943
        },
 
944
        [_IOC_NR(VIDIOC_QUERYCTRL)] = {
 
945
                .name = "VIDIOC_QUERYCTRL",
 
946
                .desc = desc_v4l2_queryctrl,
 
947
        },
 
948
        [_IOC_NR(VIDIOC_QUERYMENU)] = {
 
949
                .name = "VIDIOC_QUERYMENU",
 
950
                .desc = desc_v4l2_querymenu,
 
951
        },
 
952
        [_IOC_NR(VIDIOC_G_INPUT)] = {
 
953
                .name = "VIDIOC_G_INPUT",
 
954
                .desc = desc_int,
 
955
        },
 
956
        [_IOC_NR(VIDIOC_S_INPUT)] = {
 
957
                .name = "VIDIOC_S_INPUT",
 
958
                .desc = desc_int,
 
959
        },
 
960
        [_IOC_NR(VIDIOC_G_OUTPUT)] = {
 
961
                .name = "VIDIOC_G_OUTPUT",
 
962
                .desc = desc_int,
 
963
        },
 
964
        [_IOC_NR(VIDIOC_S_OUTPUT)] = {
 
965
                .name = "VIDIOC_S_OUTPUT",
 
966
                .desc = desc_int,
 
967
        },
 
968
        [_IOC_NR(VIDIOC_ENUMOUTPUT)] = {
 
969
                .name = "VIDIOC_ENUMOUTPUT",
 
970
                .desc = desc_v4l2_output,
 
971
        },
 
972
        [_IOC_NR(VIDIOC_G_AUDOUT)] = {
 
973
                .name = "VIDIOC_G_AUDOUT",
 
974
                .desc = desc_v4l2_audioout,
 
975
        },
 
976
        [_IOC_NR(VIDIOC_S_AUDOUT)] = {
 
977
                .name = "VIDIOC_S_AUDOUT",
 
978
                .desc = desc_v4l2_audioout,
 
979
        },
 
980
        [_IOC_NR(VIDIOC_G_MODULATOR)] = {
 
981
                .name = "VIDIOC_G_MODULATOR",
 
982
                .desc = desc_v4l2_modulator,
 
983
        },
 
984
        [_IOC_NR(VIDIOC_S_MODULATOR)] = {
 
985
                .name = "VIDIOC_S_MODULATOR",
 
986
                .desc = desc_v4l2_modulator,
 
987
        },
 
988
        [_IOC_NR(VIDIOC_G_FREQUENCY)] = {
 
989
                .name = "VIDIOC_G_FREQUENCY",
 
990
                .desc = desc_v4l2_frequency,
 
991
        },
 
992
        [_IOC_NR(VIDIOC_S_FREQUENCY)] = {
 
993
                .name = "VIDIOC_S_FREQUENCY",
 
994
                .desc = desc_v4l2_frequency,
 
995
        },
 
996
        [_IOC_NR(VIDIOC_CROPCAP)] = {
 
997
                .name = "VIDIOC_CROPCAP",
 
998
                .desc = desc_v4l2_cropcap,
 
999
        },
 
1000
        [_IOC_NR(VIDIOC_G_CROP)] = {
 
1001
                .name = "VIDIOC_G_CROP",
 
1002
                .desc = desc_v4l2_crop,
 
1003
        },
 
1004
        [_IOC_NR(VIDIOC_S_CROP)] = {
 
1005
                .name = "VIDIOC_S_CROP",
 
1006
                .desc = desc_v4l2_crop,
 
1007
        },
 
1008
        [_IOC_NR(VIDIOC_G_JPEGCOMP)] = {
 
1009
                .name = "VIDIOC_G_JPEGCOMP",
 
1010
                .desc = desc_v4l2_jpegcompression,
 
1011
        },
 
1012
        [_IOC_NR(VIDIOC_S_JPEGCOMP)] = {
 
1013
                .name = "VIDIOC_S_JPEGCOMP",
 
1014
                .desc = desc_v4l2_jpegcompression,
 
1015
        },
 
1016
        [_IOC_NR(VIDIOC_QUERYSTD)] = {
 
1017
                .name = "VIDIOC_QUERYSTD",
 
1018
                .desc = desc_v4l2_std_id,
 
1019
        },
 
1020
        [_IOC_NR(VIDIOC_TRY_FMT)] = {
 
1021
                .name = "VIDIOC_TRY_FMT",
 
1022
                .desc = desc_v4l2_format,
 
1023
        },
 
1024
};
 
1025
 
 
1026
/* ---------------------------------------------------------------------- */
 
1027
/*
 
1028
 * Local variables:
 
1029
 * c-basic-offset: 8
 
1030
 * End:
 
1031
 */