From 1b8f9204db684eff0d52b03c47fa666bf4e495f5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 9 Jun 2018 12:13:38 +0300 Subject: stream: Use abstract video sources Replace the manual V4L2 capture implementation by an abstract video_source, provided by the user of the UVC stream. Removes any knowledge of the video source internals from the uvc_stream class, allowing usage of different source types. Signed-off-by: Laurent Pinchart --- stream.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'stream.h') diff --git a/stream.h b/stream.h index 6eb6731..38729f8 100644 --- a/stream.h +++ b/stream.h @@ -24,22 +24,21 @@ struct events; struct uvc_function_config; struct uvc_stream; struct v4l2_pix_format; +struct video_source; /* * uvc_stream_new - Create a new UVC stream * @uvc_device: Filename of UVC device node - * @cap_device: Filename of V4L2 capture device node * - * Create a new UVC stream with V4L2 @uvc_device as the output and @cap_device - * as input. + * Create a new UVC stream to handle the UVC function corresponding to the video + * device node @uvc_device. * * Streams allocated with this function can be deleted with uvc_stream_delete(). * * On success, returns a pointer to newly allocated and populated struct uvc_stream. * On failure, returns NULL. */ -struct uvc_stream *uvc_stream_new(const char *uvc_device, - const char *cap_device); +struct uvc_stream *uvc_stream_new(const char *uvc_device); /* * uvc_stream_init_uvc - Initialize a UVC stream @@ -72,6 +71,9 @@ void uvc_stream_init_uvc(struct uvc_stream *stream, void uvc_stream_set_event_handler(struct uvc_stream *stream, struct events *events); +void uvc_stream_set_video_source(struct uvc_stream *stream, + struct video_source *src); + /* * uvc_stream_delete - Delete a UVC stream * @stream: the UVC stream -- cgit v1.2.3