aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--contrib/test/Makefile.am11
-rwxr-xr-xcontrib/test/gen_ioctl_list.pl101
-rw-r--r--contrib/test/ioctl-test.c156
-rw-r--r--contrib/test/ioctl-test.h153
-rw-r--r--contrib/test/ioctl_32.h86
-rw-r--r--contrib/test/ioctl_64.h86
7 files changed, 440 insertions, 155 deletions
diff --git a/Makefile.am b/Makefile.am
index 491c83d3..74b00951 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,4 +31,4 @@ sync-with-kernel:
$(MAKE) -C utils/xc3028-firmware $@
$(MAKE) -C lib/libdvbv5 $@
$(MAKE) -C contrib/freebsd $@
-
+ $(MAKE) -C contrib/test $@
diff --git a/contrib/test/Makefile.am b/contrib/test/Makefile.am
index ba95cfe2..4484d98b 100644
--- a/contrib/test/Makefile.am
+++ b/contrib/test/Makefile.am
@@ -44,3 +44,14 @@ v4lgrab_SOURCES = v4lgrab.c
stress_buffer_SOURCES = stress-buffer.c
capture_example_SOURCES = capture-example.c
+
+ioctl-test.c: ioctl-test.h
+
+sync-with-kernel:
+ ./gen_ioctl_list.pl --gen_ioctl_numbers >.tmp_ioctl.c
+ gcc -I ../../include/ .tmp_ioctl.c -o tmp_ioctl32 -m32
+ gcc -I ../../include/ .tmp_ioctl.c -o tmp_ioctl64 -m64
+ ./tmp_ioctl32 32 >ioctl_32.h
+ ./tmp_ioctl64 64 >ioctl_64.h
+ rm .tmp_ioctl.c tmp_ioctl32 tmp_ioctl64
+ ./gen_ioctl_list.pl >ioctl-test.h
diff --git a/contrib/test/gen_ioctl_list.pl b/contrib/test/gen_ioctl_list.pl
new file mode 100755
index 00000000..f390f744
--- /dev/null
+++ b/contrib/test/gen_ioctl_list.pl
@@ -0,0 +1,101 @@
+#!/usr/bin/perl
+use strict;
+
+my %headers = (
+ "video" => "videodev2.h",
+);
+
+my %structs;
+my %ioc;
+my $maxsize = 0;
+
+sub print_union()
+{
+ printf "union v4l_parms {\n";
+ printf "\tint i;\n";
+ printf "\tunsigned long ulong;\n";
+ printf "\tu_int32_t u32;\n";
+ printf "\tv4l2_std_id id;\n";
+ printf "\tenum v4l2_priority prio;\n";
+ printf "\n\t/* V4L2 structs */\n";
+ foreach my $s (keys %structs) {
+ next if (!($s =~ m/struct/));
+ $s =~ s/struct\s*//;
+
+ my $ntabs = ($maxsize - length($s) - 7) / 8;
+ my $tab = "";
+ for (my $i = 0; $i < $ntabs; $i++) {
+ $tab .= "\t";
+ }
+
+
+ printf "\tstruct %s%sp_%s;\n", $s, $tab, $s;
+ }
+ printf "};\n";
+}
+
+sub print_ioc()
+{
+ printf "#define ioc(cmd) { CMD32_##cmd, CMD64_##cmd, cmd, #cmd }\n";
+ printf "\n/* All defined ioctls */\n";
+ printf "static const struct {\n";
+ printf "\tu_int32_t cmd32;\t/* The 32-bit ioctl value, should never change */\n";
+ printf "\tu_int32_t cmd64;\t/* The 64-bit ioctl value, should never change */\n";
+ printf "\tu_int32_t cmd;\n";
+ printf "\tconst char *name;\n";
+ printf "} ioctls[] = {\n";
+ printf "\t/* V4L2 ioctls */\n";
+ foreach my $ioctl (keys %ioc) {
+ my $ntabs = ($maxsize - length($ioctl) - 6) / 8;
+ my $tab = "";
+ for (my $i = 0; $i < $ntabs; $i++) {
+ $tab .= "\t";
+ }
+
+ printf "\tioc(%s),%s/* %s */\n", $ioctl, $tab, $ioc{$ioctl};
+ }
+ printf "};\n";
+ printf "#define S_IOCTLS sizeof(ioctls)/sizeof(ioctls[0])\n";
+}
+
+printf "/* This file is auto-generated by make sync-with-kernel */\n";
+
+foreach my $h (keys %headers) {
+ printf "#include \"linux/%s\"\n\n", $headers{$h};
+
+ open IN, "../../include/linux/" . $headers{$h};
+ while (<IN>) {
+ if (m/\#define\s+([A-Z][A-Z0-9_]+)\s+\_IO.+\(.*\,\s*([^\)]+)\)/) {
+ $structs{$2} = 1;
+ $ioc{$1} = $2;
+ if ($maxsize < length($1)) {
+ $maxsize = length($1);
+ }
+ }
+ if (m/\#define\s+([A-Z][A-Z0-9_]+)\s+\_IO\(.*\)/) {
+ $ioc{$1} = "void";
+ if ($maxsize < length($1)) {
+ $maxsize = length($1);
+ }
+ }
+ }
+ $maxsize = int(($maxsize + 7) / 8) * 8;
+}
+
+my $arg = shift;
+if ($arg eq "--gen_ioctl_numbers") {
+ printf "#include <stdio.h>\n";
+ printf "int main(int argc, char *argv[]) {\n";
+ printf "\tprintf(\"/* This file is auto-generated by make sync-with-kernel */\\n\\n\");\n";
+ foreach my $ioctl (sort keys %ioc) {
+ printf "\tprintf(\"#define CMD%%s_%s 0x%%x\\n\", argv[1], %s);\n", $ioctl, $ioctl;
+ }
+ printf "return 0;\n";
+ printf "}\n";
+} else {
+ printf "#include \"ioctl_32.h\"\n";
+ printf "#include \"ioctl_64.h\"\n\n";
+
+ print_union();
+ print_ioc();
+}
diff --git a/contrib/test/ioctl-test.c b/contrib/test/ioctl-test.c
index bceb8fdd..6f3e51c3 100644
--- a/contrib/test/ioctl-test.c
+++ b/contrib/test/ioctl-test.c
@@ -14,7 +14,7 @@
gcc -o ioctl-test32 ioctl-test.c -I../../include -m32
- Copyright (C) 2005 Mauro Carvalho Chehab <mchehab@infradead.org>
+ Copyright (C) 2005-2013 Mauro Carvalho Chehab <mchehab@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,159 +40,7 @@
#include <sys/ioctl.h>
#include <fcntl.h>
-#include "linux/videodev2.h"
-
-/* All possible parameters used on v4l ioctls */
-union v4l_parms {
- int i;
- unsigned long ulong;
- u_int32_t u32;
- v4l2_std_id id;
- enum v4l2_priority prio;
-
- /* V4L2 structs */
- struct v4l2_capability p_v4l2_capability;
- struct v4l2_fmtdesc p_v4l2_fmtdesc;
- struct v4l2_format p_v4l2_format;
- struct v4l2_requestbuffers p_v4l2_requestbuffers;
- struct v4l2_buffer p_v4l2_buffer;
- struct v4l2_framebuffer p_v4l2_framebuffer;
- struct v4l2_streamparm p_v4l2_streamparm;
- struct v4l2_standard p_v4l2_standard;
- struct v4l2_input p_v4l2_input;
- struct v4l2_control p_v4l2_control;
- struct v4l2_tuner p_v4l2_tuner;
- struct v4l2_audio p_v4l2_audio;
- struct v4l2_queryctrl p_v4l2_queryctrl;
- struct v4l2_querymenu p_v4l2_querymenu;
- struct v4l2_output p_v4l2_output;
- struct v4l2_audioout p_v4l2_audioout;
- struct v4l2_modulator p_v4l2_modulator;
- struct v4l2_frequency p_v4l2_frequency;
- struct v4l2_cropcap p_v4l2_cropcap;
- struct v4l2_crop p_v4l2_crop;
- struct v4l2_jpegcompression p_v4l2_jpegcompression;
- struct v4l2_sliced_vbi_cap p_v4l2_sliced_vbi_cap;
- struct v4l2_ext_controls p_v4l2_ext_controls;
- struct v4l2_frmsizeenum p_v4l2_frmsizeenum;
- struct v4l2_frmivalenum p_v4l2_frmivalenum;
- struct v4l2_enc_idx p_v4l2_enc_idx;
- struct v4l2_encoder_cmd p_v4l2_encoder_cmd;
- struct v4l2_dbg_register p_v4l2_dbg_register;
- struct v4l2_dbg_chip_ident p_v4l2_dbg_chip_ident;
- struct v4l2_hw_freq_seek p_v4l2_hw_freq_seek;
- struct v4l2_dv_enum_preset p_v4l2_dv_enum_preset;
- struct v4l2_dv_preset p_v4l2_dv_preset;
- struct v4l2_dv_timings p_v4l2_dv_timings;
- struct v4l2_event p_v4l2_event;
- struct v4l2_event_subscription p_v4l2_event_subscription;
- struct v4l2_create_buffers p_v4l2_create_buffers;
- struct v4l2_selection p_v4l2_selection;
- struct v4l2_decoder_cmd p_v4l2_decoder_cmd;
- struct v4l2_enum_dv_timings p_v4l2_enum_dv_timings;
- struct v4l2_dv_timings_cap p_v4l2_dv_timings_cap;
- struct v4l2_frequency_band p_v4l2_frequency_band;
- struct v4l2_exportbuffer p_v4l2_exportbuffer;
-};
-
-#define ioc(cmd32, cmd64, cmd) { cmd32, cmd64, cmd, #cmd }
-
-/* All defined ioctls */
-static const struct {
- u_int32_t cmd32; /* The 32-bit ioctl value, should never change */
- u_int32_t cmd64; /* The 64-bit ioctl value, should never change */
- u_int32_t cmd;
- const char *name;
-} ioctls[] = {
- /* V4L2 ioctls */
- ioc(0x80685600, 0x80685600, VIDIOC_QUERYCAP), /* struct v4l2_capability */
- ioc(0x00005601, 0x00005601, VIDIOC_RESERVED),
- ioc(0xc0405602, 0xc0405602, VIDIOC_ENUM_FMT), /* struct v4l2_fmtdesc */
- ioc(0xc0cc5604, 0xc0d05604, VIDIOC_G_FMT), /* struct v4l2_format */
- ioc(0xc0cc5605, 0xc0d05605, VIDIOC_S_FMT), /* struct v4l2_format */
- ioc(0xc0145608, 0xc0145608, VIDIOC_REQBUFS), /* struct v4l2_requestbuffers */
- ioc(0xc0445609, 0xc0585609, VIDIOC_QUERYBUF), /* struct v4l2_buffer */
- ioc(0x802c560a, 0x8030560a, VIDIOC_G_FBUF), /* struct v4l2_framebuffer */
- ioc(0x402c560b, 0x4030560b, VIDIOC_S_FBUF), /* struct v4l2_framebuffer */
- ioc(0x4004560e, 0x4004560e, VIDIOC_OVERLAY), /* int */
- ioc(0xc044560f, 0xc058560f, VIDIOC_QBUF), /* struct v4l2_buffer */
- ioc(0xc0405610, 0xc0405610, VIDIOC_EXPBUF), /* struct v4l2_exportbuffer */
- ioc(0xc0445611, 0xc0585611, VIDIOC_DQBUF), /* struct v4l2_buffer */
- ioc(0x40045612, 0x40045612, VIDIOC_STREAMON), /* int */
- ioc(0x40045613, 0x40045613, VIDIOC_STREAMOFF), /* int */
- ioc(0xc0cc5615, 0xc0cc5615, VIDIOC_G_PARM), /* struct v4l2_streamparm */
- ioc(0xc0cc5616, 0xc0cc5616, VIDIOC_S_PARM), /* struct v4l2_streamparm */
- ioc(0x80085617, 0x80085617, VIDIOC_G_STD), /* v4l2_std_id */
- ioc(0x40085618, 0x40085618, VIDIOC_S_STD), /* v4l2_std_id */
- ioc(0xc0405619, 0xc0485619, VIDIOC_ENUMSTD), /* struct v4l2_standard */
- ioc(0xc04c561a, 0xc050561a, VIDIOC_ENUMINPUT), /* struct v4l2_input */
- ioc(0xc008561b, 0xc008561b, VIDIOC_G_CTRL), /* struct v4l2_control */
- ioc(0xc008561c, 0xc008561c, VIDIOC_S_CTRL), /* struct v4l2_control */
- ioc(0xc054561d, 0xc054561d, VIDIOC_G_TUNER), /* struct v4l2_tuner */
- ioc(0x4054561e, 0x4054561e, VIDIOC_S_TUNER), /* struct v4l2_tuner */
- ioc(0x80345621, 0x80345621, VIDIOC_G_AUDIO), /* struct v4l2_audio */
- ioc(0x40345622, 0x40345622, VIDIOC_S_AUDIO), /* struct v4l2_audio */
- ioc(0xc0445624, 0xc0445624, VIDIOC_QUERYCTRL), /* struct v4l2_queryctrl */
- ioc(0xc02c5625, 0xc02c5625, VIDIOC_QUERYMENU), /* struct v4l2_querymenu */
- ioc(0x80045626, 0x80045626, VIDIOC_G_INPUT), /* int */
- ioc(0xc0045627, 0xc0045627, VIDIOC_S_INPUT), /* int */
- ioc(0x8004562e, 0x8004562e, VIDIOC_G_OUTPUT), /* int */
- ioc(0xc004562f, 0xc004562f, VIDIOC_S_OUTPUT), /* int */
- ioc(0xc0485630, 0xc0485630, VIDIOC_ENUMOUTPUT), /* struct v4l2_output */
- ioc(0x80345631, 0x80345631, VIDIOC_G_AUDOUT), /* struct v4l2_audioout */
- ioc(0x40345632, 0x40345632, VIDIOC_S_AUDOUT), /* struct v4l2_audioout */
- ioc(0xc0445636, 0xc0445636, VIDIOC_G_MODULATOR), /* struct v4l2_modulator */
- ioc(0x40445637, 0x40445637, VIDIOC_S_MODULATOR), /* struct v4l2_modulator */
- ioc(0xc02c5638, 0xc02c5638, VIDIOC_G_FREQUENCY), /* struct v4l2_frequency */
- ioc(0x402c5639, 0x402c5639, VIDIOC_S_FREQUENCY), /* struct v4l2_frequency */
- ioc(0xc02c563a, 0xc02c563a, VIDIOC_CROPCAP), /* struct v4l2_cropcap */
- ioc(0xc014563b, 0xc014563b, VIDIOC_G_CROP), /* struct v4l2_crop */
- ioc(0x4014563c, 0x4014563c, VIDIOC_S_CROP), /* struct v4l2_crop */
- ioc(0x808c563d, 0x808c563d, VIDIOC_G_JPEGCOMP), /* struct v4l2_jpegcompression */
- ioc(0x408c563e, 0x408c563e, VIDIOC_S_JPEGCOMP), /* struct v4l2_jpegcompression */
- ioc(0x8008563f, 0x8008563f, VIDIOC_QUERYSTD), /* v4l2_std_id */
- ioc(0xc0cc5640, 0xc0d05640, VIDIOC_TRY_FMT), /* struct v4l2_format */
- ioc(0xc0345641, 0xc0345641, VIDIOC_ENUMAUDIO), /* struct v4l2_audio */
- ioc(0xc0345642, 0xc0345642, VIDIOC_ENUMAUDOUT), /* struct v4l2_audioout */
- ioc(0x80045643, 0x80045643, VIDIOC_G_PRIORITY), /* enum v4l2_priority */
- ioc(0x40045644, 0x40045644, VIDIOC_S_PRIORITY), /* enum v4l2_priority */
- ioc(0xc0745645, 0xc0745645, VIDIOC_G_SLICED_VBI_CAP), /* struct v4l2_sliced_vbi_cap */
- ioc(0x00005646, 0x00005646, VIDIOC_LOG_STATUS),
- ioc(0xc0185647, 0xc0205647, VIDIOC_G_EXT_CTRLS), /* struct v4l2_ext_controls */
- ioc(0xc0185648, 0xc0205648, VIDIOC_S_EXT_CTRLS), /* struct v4l2_ext_controls */
- ioc(0xc0185649, 0xc0205649, VIDIOC_TRY_EXT_CTRLS), /* struct v4l2_ext_controls */
- ioc(0xc02c564a, 0xc02c564a, VIDIOC_ENUM_FRAMESIZES), /* struct v4l2_frmsizeenum */
- ioc(0xc034564b, 0xc034564b, VIDIOC_ENUM_FRAMEINTERVALS),/* struct v4l2_frmivalenum */
- ioc(0x8818564c, 0x8818564c, VIDIOC_G_ENC_INDEX), /* struct v4l2_enc_idx */
- ioc(0xc028564d, 0xc028564d, VIDIOC_ENCODER_CMD), /* struct v4l2_encoder_cmd */
- ioc(0xc028564e, 0xc028564e, VIDIOC_TRY_ENCODER_CMD), /* struct v4l2_encoder_cmd */
- ioc(0x4038564f, 0x4038564f, VIDIOC_DBG_S_REGISTER), /* struct v4l2_register */
- ioc(0xc0385650, 0xc0385650, VIDIOC_DBG_G_REGISTER), /* struct v4l2_register */
- ioc(0xc02c5651, 0xc02c5651, VIDIOC_DBG_G_CHIP_IDENT), /* struct v4l2_dbg_chip_ident */
- ioc(0x40305652, 0x40305652, VIDIOC_S_HW_FREQ_SEEK), /* struct v4l2_hw_freq_seek */
- ioc(0xc0405653, 0xc0405653, VIDIOC_ENUM_DV_PRESETS), /* struct v4l2_dv_enum_preset */
- ioc(0xc0145654, 0xc0145654, VIDIOC_S_DV_PRESET), /* struct v4l2_dv_preset */
- ioc(0xc0145655, 0xc0145655, VIDIOC_G_DV_PRESET), /* struct v4l2_dv_preset */
- ioc(0x80145656, 0x80145656, VIDIOC_QUERY_DV_PRESET), /* struct v4l2_dv_preset */
- ioc(0xc0845657, 0xc0845657, VIDIOC_S_DV_TIMINGS), /* struct v4l2_dv_timings */
- ioc(0xc0845658, 0xc0845658, VIDIOC_G_DV_TIMINGS), /* struct v4l2_dv_timings */
- ioc(0x80785659, 0x80885659, VIDIOC_DQEVENT), /* struct v4l2_event */
- ioc(0x4020565a, 0x4020565a, VIDIOC_SUBSCRIBE_EVENT), /* struct v4l2_event_subscription */
- ioc(0x4020565b, 0x4020565b, VIDIOC_UNSUBSCRIBE_EVENT), /* struct v4l2_event_subscription */
- ioc(0xc0f8565c, 0xc100565c, VIDIOC_CREATE_BUFS), /* struct v4l2_create_buffers */
- ioc(0xc044565d, 0xc058565d, VIDIOC_PREPARE_BUF), /* struct v4l2_buffer */
- ioc(0xc040565e, 0xc040565e, VIDIOC_G_SELECTION), /* struct v4l2_selection */
- ioc(0xc040565f, 0xc040565f, VIDIOC_S_SELECTION), /* struct v4l2_selection */
- ioc(0xc0485660, 0xc0485660, VIDIOC_DECODER_CMD), /* struct v4l2_decoder_cmd */
- ioc(0xc0485661, 0xc0485661, VIDIOC_TRY_DECODER_CMD), /* struct v4l2_decoder_cmd */
- ioc(0xc0945662, 0xc0945662, VIDIOC_ENUM_DV_TIMINGS), /* struct v4l2_enum_dv_timings */
- ioc(0x80845663, 0x80845663, VIDIOC_QUERY_DV_TIMINGS), /* struct v4l2_dv_timings */
- ioc(0xc0905664, 0xc0905664, VIDIOC_DV_TIMINGS_CAP), /* struct v4l2_dv_timings_cap */
- ioc(0xc0405665, 0xc0405665, VIDIOC_ENUM_FREQ_BANDS), /* struct v4l2_frequency_band */
-};
-#define S_IOCTLS sizeof(ioctls)/sizeof(ioctls[0])
-
-/********************************************************************/
+#include "ioctl-test.h"
int main(int argc, char **argv)
{
diff --git a/contrib/test/ioctl-test.h b/contrib/test/ioctl-test.h
new file mode 100644
index 00000000..d2a498ca
--- /dev/null
+++ b/contrib/test/ioctl-test.h
@@ -0,0 +1,153 @@
+/* This file is auto-generated by make sync-with-kernel */
+#include "linux/videodev2.h"
+
+#include "ioctl_32.h"
+#include "ioctl_64.h"
+
+union v4l_parms {
+ int i;
+ unsigned long ulong;
+ u_int32_t u32;
+ v4l2_std_id id;
+ enum v4l2_priority prio;
+
+ /* V4L2 structs */
+ struct v4l2_decoder_cmd p_v4l2_decoder_cmd;
+ struct v4l2_event_subscription p_v4l2_event_subscription;
+ struct v4l2_dbg_chip_ident p_v4l2_dbg_chip_ident;
+ struct v4l2_tuner p_v4l2_tuner;
+ struct v4l2_capability p_v4l2_capability;
+ struct v4l2_input p_v4l2_input;
+ struct v4l2_exportbuffer p_v4l2_exportbuffer;
+ struct v4l2_sliced_vbi_cap p_v4l2_sliced_vbi_cap;
+ struct v4l2_control p_v4l2_control;
+ struct v4l2_frmsizeenum p_v4l2_frmsizeenum;
+ struct v4l2_streamparm p_v4l2_streamparm;
+ struct v4l2_jpegcompression p_v4l2_jpegcompression;
+ struct v4l2_audioout p_v4l2_audioout;
+ struct v4l2_requestbuffers p_v4l2_requestbuffers;
+ struct v4l2_dv_preset p_v4l2_dv_preset;
+ struct v4l2_audio p_v4l2_audio;
+ struct v4l2_output p_v4l2_output;
+ struct v4l2_fmtdesc p_v4l2_fmtdesc;
+ struct v4l2_crop p_v4l2_crop;
+ struct v4l2_dv_enum_preset p_v4l2_dv_enum_preset;
+ struct v4l2_dv_timings_cap p_v4l2_dv_timings_cap;
+ struct v4l2_dbg_register p_v4l2_dbg_register;
+ struct v4l2_event p_v4l2_event;
+ struct v4l2_queryctrl p_v4l2_queryctrl;
+ struct v4l2_create_buffers p_v4l2_create_buffers;
+ struct v4l2_modulator p_v4l2_modulator;
+ struct v4l2_frmivalenum p_v4l2_frmivalenum;
+ struct v4l2_ext_controls p_v4l2_ext_controls;
+ struct v4l2_buffer p_v4l2_buffer;
+ struct v4l2_format p_v4l2_format;
+ struct v4l2_enum_dv_timings p_v4l2_enum_dv_timings;
+ struct v4l2_dv_timings p_v4l2_dv_timings;
+ struct v4l2_frequency p_v4l2_frequency;
+ struct v4l2_querymenu p_v4l2_querymenu;
+ struct v4l2_enc_idx p_v4l2_enc_idx;
+ struct v4l2_cropcap p_v4l2_cropcap;
+ struct v4l2_encoder_cmd p_v4l2_encoder_cmd;
+ struct v4l2_selection p_v4l2_selection;
+ struct v4l2_hw_freq_seek p_v4l2_hw_freq_seek;
+ struct v4l2_frequency_band p_v4l2_frequency_band;
+ struct v4l2_standard p_v4l2_standard;
+ struct v4l2_framebuffer p_v4l2_framebuffer;
+};
+#define ioc(cmd) { CMD32_##cmd, CMD64_##cmd, cmd, #cmd }
+
+/* All defined ioctls */
+static const struct {
+ u_int32_t cmd32; /* The 32-bit ioctl value, should never change */
+ u_int32_t cmd64; /* The 64-bit ioctl value, should never change */
+ u_int32_t cmd;
+ const char *name;
+} ioctls[] = {
+ /* V4L2 ioctls */
+ ioc(VIDIOC_G_OUTPUT), /* int */
+ ioc(VIDIOC_STREAMON), /* int */
+ ioc(VIDIOC_RESERVED), /* void */
+ ioc(VIDIOC_QUERYCAP), /* struct v4l2_capability */
+ ioc(VIDIOC_S_TUNER), /* struct v4l2_tuner */
+ ioc(VIDIOC_G_FREQUENCY), /* struct v4l2_frequency */
+ ioc(VIDIOC_S_DV_TIMINGS), /* struct v4l2_dv_timings */
+ ioc(VIDIOC_ENUM_DV_PRESETS), /* struct v4l2_dv_enum_preset */
+ ioc(VIDIOC_S_PRIORITY), /* __u32 */
+ ioc(VIDIOC_G_PRIORITY), /* __u32 */
+ ioc(VIDIOC_S_AUDIO), /* struct v4l2_audio */
+ ioc(VIDIOC_S_INPUT), /* int */
+ ioc(VIDIOC_QUERYCTRL), /* struct v4l2_queryctrl */
+ ioc(VIDIOC_QUERYMENU), /* struct v4l2_querymenu */
+ ioc(VIDIOC_DV_TIMINGS_CAP), /* struct v4l2_dv_timings_cap */
+ ioc(VIDIOC_S_JPEGCOMP), /* struct v4l2_jpegcompression */
+ ioc(VIDIOC_S_OUTPUT), /* int */
+ ioc(VIDIOC_ENUMAUDOUT), /* struct v4l2_audioout */
+ ioc(VIDIOC_S_FREQUENCY), /* struct v4l2_frequency */
+ ioc(VIDIOC_ENUM_FREQ_BANDS), /* struct v4l2_frequency_band */
+ ioc(VIDIOC_ENCODER_CMD), /* struct v4l2_encoder_cmd */
+ ioc(VIDIOC_QBUF), /* struct v4l2_buffer */
+ ioc(VIDIOC_S_MODULATOR), /* struct v4l2_modulator */
+ ioc(VIDIOC_G_FBUF), /* struct v4l2_framebuffer */
+ ioc(VIDIOC_G_AUDIO), /* struct v4l2_audio */
+ ioc(VIDIOC_S_CROP), /* struct v4l2_crop */
+ ioc(VIDIOC_CROPCAP), /* struct v4l2_cropcap */
+ ioc(VIDIOC_REQBUFS), /* struct v4l2_requestbuffers */
+ ioc(VIDIOC_G_CROP), /* struct v4l2_crop */
+ ioc(VIDIOC_S_DV_PRESET), /* struct v4l2_dv_preset */
+ ioc(VIDIOC_G_SLICED_VBI_CAP), /* struct v4l2_sliced_vbi_cap */
+ ioc(VIDIOC_G_ENC_INDEX), /* struct v4l2_enc_idx */
+ ioc(VIDIOC_STREAMOFF), /* int */
+ ioc(VIDIOC_DQEVENT), /* struct v4l2_event */
+ ioc(VIDIOC_SUBSCRIBE_EVENT), /* struct v4l2_event_subscription */
+ ioc(VIDIOC_S_HW_FREQ_SEEK), /* struct v4l2_hw_freq_seek */
+ ioc(VIDIOC_S_AUDOUT), /* struct v4l2_audioout */
+ ioc(VIDIOC_G_DV_PRESET), /* struct v4l2_dv_preset */
+ ioc(VIDIOC_QUERY_DV_TIMINGS), /* struct v4l2_dv_timings */
+ ioc(VIDIOC_QUERY_DV_PRESET), /* struct v4l2_dv_preset */
+ ioc(VIDIOC_G_TUNER), /* struct v4l2_tuner */
+ ioc(VIDIOC_DBG_S_REGISTER), /* struct v4l2_dbg_register */
+ ioc(VIDIOC_G_SELECTION), /* struct v4l2_selection */
+ ioc(VIDIOC_G_STD), /* v4l2_std_id */
+ ioc(VIDIOC_S_CTRL), /* struct v4l2_control */
+ ioc(VIDIOC_DBG_G_CHIP_IDENT), /* struct v4l2_dbg_chip_ident */
+ ioc(VIDIOC_TRY_FMT), /* struct v4l2_format */
+ ioc(VIDIOC_DBG_G_REGISTER), /* struct v4l2_dbg_register */
+ ioc(VIDIOC_G_DV_TIMINGS), /* struct v4l2_dv_timings */
+ ioc(VIDIOC_G_PARM), /* struct v4l2_streamparm */
+ ioc(VIDIOC_S_FBUF), /* struct v4l2_framebuffer */
+ ioc(VIDIOC_TRY_ENCODER_CMD), /* struct v4l2_encoder_cmd */
+ ioc(VIDIOC_CREATE_BUFS), /* struct v4l2_create_buffers */
+ ioc(VIDIOC_ENUM_FRAMEINTERVALS),/* struct v4l2_frmivalenum */
+ ioc(VIDIOC_G_CTRL), /* struct v4l2_control */
+ ioc(VIDIOC_S_EXT_CTRLS), /* struct v4l2_ext_controls */
+ ioc(VIDIOC_DQBUF), /* struct v4l2_buffer */
+ ioc(VIDIOC_DECODER_CMD), /* struct v4l2_decoder_cmd */
+ ioc(VIDIOC_S_SELECTION), /* struct v4l2_selection */
+ ioc(VIDIOC_QUERYBUF), /* struct v4l2_buffer */
+ ioc(VIDIOC_G_EXT_CTRLS), /* struct v4l2_ext_controls */
+ ioc(VIDIOC_G_AUDOUT), /* struct v4l2_audioout */
+ ioc(VIDIOC_ENUMINPUT), /* struct v4l2_input */
+ ioc(VIDIOC_EXPBUF), /* struct v4l2_exportbuffer */
+ ioc(VIDIOC_S_PARM), /* struct v4l2_streamparm */
+ ioc(VIDIOC_ENUMOUTPUT), /* struct v4l2_output */
+ ioc(VIDIOC_PREPARE_BUF), /* struct v4l2_buffer */
+ ioc(VIDIOC_UNSUBSCRIBE_EVENT), /* struct v4l2_event_subscription */
+ ioc(VIDIOC_ENUMSTD), /* struct v4l2_standard */
+ ioc(VIDIOC_G_FMT), /* struct v4l2_format */
+ ioc(VIDIOC_LOG_STATUS), /* void */
+ ioc(VIDIOC_S_STD), /* v4l2_std_id */
+ ioc(VIDIOC_ENUM_FMT), /* struct v4l2_fmtdesc */
+ ioc(VIDIOC_ENUM_DV_TIMINGS), /* struct v4l2_enum_dv_timings */
+ ioc(VIDIOC_ENUMAUDIO), /* struct v4l2_audio */
+ ioc(VIDIOC_TRY_EXT_CTRLS), /* struct v4l2_ext_controls */
+ ioc(VIDIOC_G_JPEGCOMP), /* struct v4l2_jpegcompression */
+ ioc(VIDIOC_OVERLAY), /* int */
+ ioc(VIDIOC_S_FMT), /* struct v4l2_format */
+ ioc(VIDIOC_ENUM_FRAMESIZES), /* struct v4l2_frmsizeenum */
+ ioc(VIDIOC_G_MODULATOR), /* struct v4l2_modulator */
+ ioc(VIDIOC_TRY_DECODER_CMD), /* struct v4l2_decoder_cmd */
+ ioc(VIDIOC_G_INPUT), /* int */
+ ioc(VIDIOC_QUERYSTD), /* v4l2_std_id */
+};
+#define S_IOCTLS sizeof(ioctls)/sizeof(ioctls[0])
diff --git a/contrib/test/ioctl_32.h b/contrib/test/ioctl_32.h
new file mode 100644
index 00000000..3db21bb3
--- /dev/null
+++ b/contrib/test/ioctl_32.h
@@ -0,0 +1,86 @@
+/* This file is auto-generated by make sync-with-kernel */
+
+#define CMD32_VIDIOC_CREATE_BUFS 0xc0f8565c
+#define CMD32_VIDIOC_CROPCAP 0xc02c563a
+#define CMD32_VIDIOC_DBG_G_CHIP_IDENT 0xc02c5651
+#define CMD32_VIDIOC_DBG_G_REGISTER 0xc0385650
+#define CMD32_VIDIOC_DBG_S_REGISTER 0x4038564f
+#define CMD32_VIDIOC_DECODER_CMD 0xc0485660
+#define CMD32_VIDIOC_DQBUF 0xc0445611
+#define CMD32_VIDIOC_DQEVENT 0x80785659
+#define CMD32_VIDIOC_DV_TIMINGS_CAP 0xc0905664
+#define CMD32_VIDIOC_ENCODER_CMD 0xc028564d
+#define CMD32_VIDIOC_ENUMAUDIO 0xc0345641
+#define CMD32_VIDIOC_ENUMAUDOUT 0xc0345642
+#define CMD32_VIDIOC_ENUMINPUT 0xc04c561a
+#define CMD32_VIDIOC_ENUMOUTPUT 0xc0485630
+#define CMD32_VIDIOC_ENUMSTD 0xc0405619
+#define CMD32_VIDIOC_ENUM_DV_PRESETS 0xc0405653
+#define CMD32_VIDIOC_ENUM_DV_TIMINGS 0xc0945662
+#define CMD32_VIDIOC_ENUM_FMT 0xc0405602
+#define CMD32_VIDIOC_ENUM_FRAMEINTERVALS 0xc034564b
+#define CMD32_VIDIOC_ENUM_FRAMESIZES 0xc02c564a
+#define CMD32_VIDIOC_ENUM_FREQ_BANDS 0xc0405665
+#define CMD32_VIDIOC_EXPBUF 0xc0405610
+#define CMD32_VIDIOC_G_AUDIO 0x80345621
+#define CMD32_VIDIOC_G_AUDOUT 0x80345631
+#define CMD32_VIDIOC_G_CROP 0xc014563b
+#define CMD32_VIDIOC_G_CTRL 0xc008561b
+#define CMD32_VIDIOC_G_DV_PRESET 0xc0145655
+#define CMD32_VIDIOC_G_DV_TIMINGS 0xc0845658
+#define CMD32_VIDIOC_G_ENC_INDEX 0x8818564c
+#define CMD32_VIDIOC_G_EXT_CTRLS 0xc0185647
+#define CMD32_VIDIOC_G_FBUF 0x802c560a
+#define CMD32_VIDIOC_G_FMT 0xc0cc5604
+#define CMD32_VIDIOC_G_FREQUENCY 0xc02c5638
+#define CMD32_VIDIOC_G_INPUT 0x80045626
+#define CMD32_VIDIOC_G_JPEGCOMP 0x808c563d
+#define CMD32_VIDIOC_G_MODULATOR 0xc0445636
+#define CMD32_VIDIOC_G_OUTPUT 0x8004562e
+#define CMD32_VIDIOC_G_PARM 0xc0cc5615
+#define CMD32_VIDIOC_G_PRIORITY 0x80045643
+#define CMD32_VIDIOC_G_SELECTION 0xc040565e
+#define CMD32_VIDIOC_G_SLICED_VBI_CAP 0xc0745645
+#define CMD32_VIDIOC_G_STD 0x80085617
+#define CMD32_VIDIOC_G_TUNER 0xc054561d
+#define CMD32_VIDIOC_LOG_STATUS 0x5646
+#define CMD32_VIDIOC_OVERLAY 0x4004560e
+#define CMD32_VIDIOC_PREPARE_BUF 0xc044565d
+#define CMD32_VIDIOC_QBUF 0xc044560f
+#define CMD32_VIDIOC_QUERYBUF 0xc0445609
+#define CMD32_VIDIOC_QUERYCAP 0x80685600
+#define CMD32_VIDIOC_QUERYCTRL 0xc0445624
+#define CMD32_VIDIOC_QUERYMENU 0xc02c5625
+#define CMD32_VIDIOC_QUERYSTD 0x8008563f
+#define CMD32_VIDIOC_QUERY_DV_PRESET 0x80145656
+#define CMD32_VIDIOC_QUERY_DV_TIMINGS 0x80845663
+#define CMD32_VIDIOC_REQBUFS 0xc0145608
+#define CMD32_VIDIOC_RESERVED 0x5601
+#define CMD32_VIDIOC_STREAMOFF 0x40045613
+#define CMD32_VIDIOC_STREAMON 0x40045612
+#define CMD32_VIDIOC_SUBSCRIBE_EVENT 0x4020565a
+#define CMD32_VIDIOC_S_AUDIO 0x40345622
+#define CMD32_VIDIOC_S_AUDOUT 0x40345632
+#define CMD32_VIDIOC_S_CROP 0x4014563c
+#define CMD32_VIDIOC_S_CTRL 0xc008561c
+#define CMD32_VIDIOC_S_DV_PRESET 0xc0145654
+#define CMD32_VIDIOC_S_DV_TIMINGS 0xc0845657
+#define CMD32_VIDIOC_S_EXT_CTRLS 0xc0185648
+#define CMD32_VIDIOC_S_FBUF 0x402c560b
+#define CMD32_VIDIOC_S_FMT 0xc0cc5605
+#define CMD32_VIDIOC_S_FREQUENCY 0x402c5639
+#define CMD32_VIDIOC_S_HW_FREQ_SEEK 0x40305652
+#define CMD32_VIDIOC_S_INPUT 0xc0045627
+#define CMD32_VIDIOC_S_JPEGCOMP 0x408c563e
+#define CMD32_VIDIOC_S_MODULATOR 0x40445637
+#define CMD32_VIDIOC_S_OUTPUT 0xc004562f
+#define CMD32_VIDIOC_S_PARM 0xc0cc5616
+#define CMD32_VIDIOC_S_PRIORITY 0x40045644
+#define CMD32_VIDIOC_S_SELECTION 0xc040565f
+#define CMD32_VIDIOC_S_STD 0x40085618
+#define CMD32_VIDIOC_S_TUNER 0x4054561e
+#define CMD32_VIDIOC_TRY_DECODER_CMD 0xc0485661
+#define CMD32_VIDIOC_TRY_ENCODER_CMD 0xc028564e
+#define CMD32_VIDIOC_TRY_EXT_CTRLS 0xc0185649
+#define CMD32_VIDIOC_TRY_FMT 0xc0cc5640
+#define CMD32_VIDIOC_UNSUBSCRIBE_EVENT 0x4020565b
diff --git a/contrib/test/ioctl_64.h b/contrib/test/ioctl_64.h
new file mode 100644
index 00000000..25a42209
--- /dev/null
+++ b/contrib/test/ioctl_64.h
@@ -0,0 +1,86 @@
+/* This file is auto-generated by make sync-with-kernel */
+
+#define CMD64_VIDIOC_CREATE_BUFS 0xc100565c
+#define CMD64_VIDIOC_CROPCAP 0xc02c563a
+#define CMD64_VIDIOC_DBG_G_CHIP_IDENT 0xc02c5651
+#define CMD64_VIDIOC_DBG_G_REGISTER 0xc0385650
+#define CMD64_VIDIOC_DBG_S_REGISTER 0x4038564f
+#define CMD64_VIDIOC_DECODER_CMD 0xc0485660
+#define CMD64_VIDIOC_DQBUF 0xc0585611
+#define CMD64_VIDIOC_DQEVENT 0x80885659
+#define CMD64_VIDIOC_DV_TIMINGS_CAP 0xc0905664
+#define CMD64_VIDIOC_ENCODER_CMD 0xc028564d
+#define CMD64_VIDIOC_ENUMAUDIO 0xc0345641
+#define CMD64_VIDIOC_ENUMAUDOUT 0xc0345642
+#define CMD64_VIDIOC_ENUMINPUT 0xc050561a
+#define CMD64_VIDIOC_ENUMOUTPUT 0xc0485630
+#define CMD64_VIDIOC_ENUMSTD 0xc0485619
+#define CMD64_VIDIOC_ENUM_DV_PRESETS 0xc0405653
+#define CMD64_VIDIOC_ENUM_DV_TIMINGS 0xc0945662
+#define CMD64_VIDIOC_ENUM_FMT 0xc0405602
+#define CMD64_VIDIOC_ENUM_FRAMEINTERVALS 0xc034564b
+#define CMD64_VIDIOC_ENUM_FRAMESIZES 0xc02c564a
+#define CMD64_VIDIOC_ENUM_FREQ_BANDS 0xc0405665
+#define CMD64_VIDIOC_EXPBUF 0xc0405610
+#define CMD64_VIDIOC_G_AUDIO 0x80345621
+#define CMD64_VIDIOC_G_AUDOUT 0x80345631
+#define CMD64_VIDIOC_G_CROP 0xc014563b
+#define CMD64_VIDIOC_G_CTRL 0xc008561b
+#define CMD64_VIDIOC_G_DV_PRESET 0xc0145655
+#define CMD64_VIDIOC_G_DV_TIMINGS 0xc0845658
+#define CMD64_VIDIOC_G_ENC_INDEX 0x8818564c
+#define CMD64_VIDIOC_G_EXT_CTRLS 0xc0205647
+#define CMD64_VIDIOC_G_FBUF 0x8030560a
+#define CMD64_VIDIOC_G_FMT 0xc0d05604
+#define CMD64_VIDIOC_G_FREQUENCY 0xc02c5638
+#define CMD64_VIDIOC_G_INPUT 0x80045626
+#define CMD64_VIDIOC_G_JPEGCOMP 0x808c563d
+#define CMD64_VIDIOC_G_MODULATOR 0xc0445636
+#define CMD64_VIDIOC_G_OUTPUT 0x8004562e
+#define CMD64_VIDIOC_G_PARM 0xc0cc5615
+#define CMD64_VIDIOC_G_PRIORITY 0x80045643
+#define CMD64_VIDIOC_G_SELECTION 0xc040565e
+#define CMD64_VIDIOC_G_SLICED_VBI_CAP 0xc0745645
+#define CMD64_VIDIOC_G_STD 0x80085617
+#define CMD64_VIDIOC_G_TUNER 0xc054561d
+#define CMD64_VIDIOC_LOG_STATUS 0x5646
+#define CMD64_VIDIOC_OVERLAY 0x4004560e
+#define CMD64_VIDIOC_PREPARE_BUF 0xc058565d
+#define CMD64_VIDIOC_QBUF 0xc058560f
+#define CMD64_VIDIOC_QUERYBUF 0xc0585609
+#define CMD64_VIDIOC_QUERYCAP 0x80685600
+#define CMD64_VIDIOC_QUERYCTRL 0xc0445624
+#define CMD64_VIDIOC_QUERYMENU 0xc02c5625
+#define CMD64_VIDIOC_QUERYSTD 0x8008563f
+#define CMD64_VIDIOC_QUERY_DV_PRESET 0x80145656
+#define CMD64_VIDIOC_QUERY_DV_TIMINGS 0x80845663
+#define CMD64_VIDIOC_REQBUFS 0xc0145608
+#define CMD64_VIDIOC_RESERVED 0x5601
+#define CMD64_VIDIOC_STREAMOFF 0x40045613
+#define CMD64_VIDIOC_STREAMON 0x40045612
+#define CMD64_VIDIOC_SUBSCRIBE_EVENT 0x4020565a
+#define CMD64_VIDIOC_S_AUDIO 0x40345622
+#define CMD64_VIDIOC_S_AUDOUT 0x40345632
+#define CMD64_VIDIOC_S_CROP 0x4014563c
+#define CMD64_VIDIOC_S_CTRL 0xc008561c
+#define CMD64_VIDIOC_S_DV_PRESET 0xc0145654
+#define CMD64_VIDIOC_S_DV_TIMINGS 0xc0845657
+#define CMD64_VIDIOC_S_EXT_CTRLS 0xc0205648
+#define CMD64_VIDIOC_S_FBUF 0x4030560b
+#define CMD64_VIDIOC_S_FMT 0xc0d05605
+#define CMD64_VIDIOC_S_FREQUENCY 0x402c5639
+#define CMD64_VIDIOC_S_HW_FREQ_SEEK 0x40305652
+#define CMD64_VIDIOC_S_INPUT 0xc0045627
+#define CMD64_VIDIOC_S_JPEGCOMP 0x408c563e
+#define CMD64_VIDIOC_S_MODULATOR 0x40445637
+#define CMD64_VIDIOC_S_OUTPUT 0xc004562f
+#define CMD64_VIDIOC_S_PARM 0xc0cc5616
+#define CMD64_VIDIOC_S_PRIORITY 0x40045644
+#define CMD64_VIDIOC_S_SELECTION 0xc040565f
+#define CMD64_VIDIOC_S_STD 0x40085618
+#define CMD64_VIDIOC_S_TUNER 0x4054561e
+#define CMD64_VIDIOC_TRY_DECODER_CMD 0xc0485661
+#define CMD64_VIDIOC_TRY_ENCODER_CMD 0xc028564e
+#define CMD64_VIDIOC_TRY_EXT_CTRLS 0xc0205649
+#define CMD64_VIDIOC_TRY_FMT 0xc0d05640
+#define CMD64_VIDIOC_UNSUBSCRIBE_EVENT 0x4020565b

Privacy Policy