summaryrefslogtreecommitdiff
path: root/v4l2-apps/lib/v4l2_driver.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-11-15 15:42:04 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-11-15 15:42:04 -0200
commit06700d6b31366059ca963dd4aba34ea2e57aaa05 (patch)
treec7119f367f12df373a282ce01305b02feff23e4f /v4l2-apps/lib/v4l2_driver.h
parente73ea31dcd5884251424ccbf13a0d515f8914c27 (diff)
downloadmediapointer-dvb-s2-06700d6b31366059ca963dd4aba34ea2e57aaa05.tar.gz
mediapointer-dvb-s2-06700d6b31366059ca963dd4aba34ea2e57aaa05.tar.bz2
Initiated v4l-apps/lib V4L2 functions
From: Mauro Carvalho Chehab <mchehab@infradead.org> - Created v4l2_driver.c with some basic functions to: . Enum STD, INPUT and FORMAT . GET/SET STD and INPUT . GET PARAM - ioctl-test reverted back to a simple "brute-force" all ioctl call; - driver-test created to: . test V4L2 kernel drivers; . implement all functions provided by v4l2 library - driver-test should grow following the changes at v4l2-apps/lib Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/lib/v4l2_driver.h')
-rw-r--r--v4l2-apps/lib/v4l2_driver.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/v4l2-apps/lib/v4l2_driver.h b/v4l2-apps/lib/v4l2_driver.h
new file mode 100644
index 000000000..a6f46dea3
--- /dev/null
+++ b/v4l2-apps/lib/v4l2_driver.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2006 Mauro Carvalho Chehab <mchehab@infradead.org>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ */
+
+#include <sys/time.h>
+#include <linux/videodev2.h>
+
+struct drv_list {
+ void *curr;
+ struct drv_list *next;
+};
+
+struct v4l2_driver {
+ int fd; /* Driver descriptor */
+
+ int debug;
+
+ struct v4l2_capability cap;
+
+ struct v4l2_streamparm parm;
+
+ struct drv_list *stds,*inputs,*fmt_caps;
+};
+
+enum v4l2_direction {
+ V4L2_GET = 1, // Bit 1
+ V4L2_SET = 2, // Bit 2
+ V4L2_SET_GET = 3, // Bits 1 and 2 - sets then gets and compare
+};
+
+int v4l2_open (char *device, int debug, struct v4l2_driver *drv);
+int v4l2_close (struct v4l2_driver *drv);
+int v4l2_enum_stds (struct v4l2_driver *drv);
+int v4l2_enum_input (struct v4l2_driver *drv);
+int v4l2_enum_fmt_cap (struct v4l2_driver *drv);
+int v4l2_get_parm (struct v4l2_driver *drv);
+int v4l2_setget_std (struct v4l2_driver *drv, enum v4l2_direction dir, v4l2_std_id *id);
+int v4l2_setget_input (struct v4l2_driver *drv, enum v4l2_direction dir, struct v4l2_input *input);