From eed880da1cf4af845700e1caf68d4d689391d4d3 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 9 Jun 2018 02:22:54 +0300 Subject: uvc: Handle UVC events internally in uvc.c The event notifier for the UVC device is registered in uvc_stream_set_event_handler(), which requires exposing the uvc_events_process() event handler to the uvc_stream class. Make the event handler internal by registering it in uvc_events_init(). This requires passing the uvc_stream pointer to the uvc_open() function and storing it internally in the uvc_device object. Signed-off-by: Laurent Pinchart --- uvc.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'uvc.h') diff --git a/uvc.h b/uvc.h index bfbf2fe..febc662 100644 --- a/uvc.h +++ b/uvc.h @@ -22,13 +22,16 @@ #include +struct events; struct v4l2_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; @@ -42,9 +45,8 @@ struct uvc_device unsigned int maxsize; }; -void uvc_events_process(void *d); -struct uvc_device *uvc_open(const char *devname); +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); +void uvc_events_init(struct uvc_device *dev, struct events *events); #endif /* __UVC_H__ */ -- cgit v1.2.3