summaryrefslogtreecommitdiff
path: root/stream.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 02:22:54 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-09 02:30:26 +0300
commiteed880da1cf4af845700e1caf68d4d689391d4d3 (patch)
treeaa53329c95672aec72cb08f919b081b658173f67 /stream.h
parentadc1190eb4ff4b263b185c732b3a8bcedfc44f19 (diff)
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 <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/stream.h b/stream.h
index ba3d8af..4dbe344 100644
--- a/stream.h
+++ b/stream.h
@@ -65,6 +65,12 @@ struct uvc_stream *uvc_stream_new(const char *uvc_device,
* contains all the parameters of the UVC function that will be handled by the
* UVC stream. It can be parsed from the UVC function ConfigFS directory using
* configfs_parse_uvc_function().
+ *
+ * uvc_stream_init_uvc() also registers UVC event notifiers for the stream. The
+ * caller must have called the uvc_stream_set_event_handler() function first,
+ * and ensure that the event handler is immediately usable. If the event loop is
+ * already running, all initialization steps required to handle events must be
+ * fully performed before calling this function.
*/
void uvc_stream_init_uvc(struct uvc_stream *stream,
struct uvc_function_config *fc);
@@ -75,11 +81,7 @@ void uvc_stream_init_uvc(struct uvc_stream *stream,
* @events: the event handler
*
* This function sets the event handler that the stream can use to be notified
- * of file descriptor events. Event notifiers can be registered by this
- * function, the caller must ensure that the event handler is immediately
- * usable. If the event loop is already running, all initialization steps
- * required to handle events must be fully performed before calling this
- * function.
+ * of file descriptor events.
*/
void uvc_stream_set_event_handler(struct uvc_stream *stream,
struct events *events);