summaryrefslogtreecommitdiff
path: root/uvc.c
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.c
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.c')
-rw-r--r--uvc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/uvc.c b/uvc.c
index 9d425fd..81d1760 100644
--- a/uvc.c
+++ b/uvc.c
@@ -33,6 +33,24 @@
#include "uvc.h"
#include "v4l2.h"
+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)
{
struct uvc_device *dev;
@@ -366,3 +384,12 @@ int uvc_set_format(struct uvc_device *dev, struct v4l2_pix_format *format)
{
return v4l2_set_format(dev->vdev, format);
}
+
+struct v4l2_device *uvc_v4l2_device(struct uvc_device *dev)
+{
+ /*
+ * TODO: The V4L2 device shouldn't be exposed. We should replace this
+ * with an abstract video sink class when one will be avaiilable.
+ */
+ return dev->vdev;
+}