summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2022-11-22 10:54:51 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-11-22 16:02:25 +0000
commit6fe259939e375ed8e8bd604e93cabbf664a20de5 (patch)
tree6115eaa59b6db3673f3b9b0e2e1ab3c70ad38e32
parent110e59049e73686a145921450c738733c9e79317 (diff)
video-source: add fill_buffer
We are preparing to allow video sources whose data is generated in userspace. To this end, add a fill_buffer function to video_source. Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--include/uvcgadget/video-source.h3
-rw-r--r--lib/video-source.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/include/uvcgadget/video-source.h b/include/uvcgadget/video-source.h
index 60f7ddd..b1a3cf4 100644
--- a/include/uvcgadget/video-source.h
+++ b/include/uvcgadget/video-source.h
@@ -26,6 +26,7 @@ struct video_source_ops {
int(*stream_on)(struct video_source *src);
int(*stream_off)(struct video_source *src);
int(*queue_buffer)(struct video_source *src, struct video_buffer *buf);
+ void(*fill_buffer)(struct video_source *src, struct video_buffer *buf);
};
typedef void(*video_source_buffer_handler_t)(void *, struct video_source *,
@@ -53,5 +54,7 @@ int video_source_stream_on(struct video_source *src);
int video_source_stream_off(struct video_source *src);
int video_source_queue_buffer(struct video_source *src,
struct video_buffer *buf);
+void video_source_fill_buffer(struct video_source *src,
+ struct video_buffer *buf);
#endif /* __VIDEO_SOURCE_H__ */
diff --git a/lib/video-source.c b/lib/video-source.c
index 5520b95..17f008a 100644
--- a/lib/video-source.c
+++ b/lib/video-source.c
@@ -65,3 +65,9 @@ int video_source_queue_buffer(struct video_source *src,
{
return src->ops->queue_buffer(src, buf);
}
+
+void video_source_fill_buffer(struct video_source *src,
+ struct video_buffer *buf)
+{
+ src->ops->fill_buffer(src, buf);
+}