summaryrefslogtreecommitdiff
path: root/uvc.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 12:52:45 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 19:44:22 +0300
commite28d36cc0ea66ede6859aa495aa114c8db002b53 (patch)
tree379e68cbcc4206a716a21cec2108e19c6727bd3d /uvc.h
parent1b8f9204db684eff0d52b03c47fa666bf4e495f5 (diff)
uvc: Make uvc_device structure opaque
The internals of the uvc_device structure should not be accessed outside of uvc.c. The only existing need to access the structure internals is in stream.c, where access to the UVC V4L2 device is needed. To avoid that, create an accessor function uvc_v4l2_device(), and make the structure private. Ideally the UVC V4L2 device should not be exposed. This can be achieved by creating an abstract video sink class to handle the UVC video sink. This is however out of scope for now. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'uvc.h')
-rw-r--r--uvc.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/uvc.h b/uvc.h
index f73ff70..f73dbff 100644
--- a/uvc.h
+++ b/uvc.h
@@ -20,35 +20,17 @@
#ifndef __UVC_H__
#define __UVC_H__
-#include <linux/usb/video.h>
-
struct events;
struct v4l2_device;
+struct uvc_device;
struct uvc_function_config;
struct uvc_stream;
-struct uvc_device
-{
- struct v4l2_device *vdev;
-
- struct uvc_stream *stream;
- 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;
-};
-
struct uvc_device *uvc_open(const char *devname, struct uvc_stream *stream);
void uvc_close(struct uvc_device *dev);
void uvc_events_init(struct uvc_device *dev, struct events *events);
void uvc_set_config(struct uvc_device *dev, struct uvc_function_config *fc);
int uvc_set_format(struct uvc_device *dev, struct v4l2_pix_format *format);
+struct v4l2_device *uvc_v4l2_device(struct uvc_device *dev);
#endif /* __UVC_H__ */