summaryrefslogtreecommitdiff
path: root/uvc.h
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2018-06-07 20:01:23 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 00:22:29 +0300
commitbabe9a5aa7f6eb109e47bd8ded680d7087dd0ab2 (patch)
treeef3516f19480fdf44fa387e783e60ba6d9f91ff8 /uvc.h
parentf6760f161dc5f03d5b751798e4aff44e571ff703 (diff)
uvc-gadget: factor out uvc protocol and stream handling code
uvc-gadget.c has been getting cluttered with functions related to UVC protocol handling and stream handling. Additionally, it is forseen that we might want stream handling to be modular for different system models. Factor out code related to UVC protocol handling to uvc.c (and uvc.h) and code related to stream handling to stream.c (and stream.h), and update the Makefile accordingly. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'uvc.h')
-rw-r--r--uvc.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/uvc.h b/uvc.h
new file mode 100644
index 0000000..bfbf2fe
--- /dev/null
+++ b/uvc.h
@@ -0,0 +1,50 @@
+/*
+ * UVC protocol handling
+ *
+ * Copyright (C) 2010 Ideas on board SPRL <laurent.pinchart@ideasonboard.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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ */
+
+#ifndef __UVC_H__
+#define __UVC_H__
+
+#include <linux/usb/video.h>
+
+struct v4l2_device;
+struct uvc_function_config;
+
+struct uvc_device
+{
+ struct v4l2_device *vdev;
+
+ struct uvc_function_config *fc;
+
+ struct uvc_streaming_control probe;
+ struct uvc_streaming_control commit;
+
+ int control;
+
+ unsigned int fcc;
+ unsigned int width;
+ unsigned int height;
+ unsigned int maxsize;
+};
+
+void uvc_events_process(void *d);
+struct uvc_device *uvc_open(const char *devname);
+void uvc_close(struct uvc_device *dev);
+void uvc_events_init(struct uvc_device *dev);
+
+#endif /* __UVC_H__ */