From afd7ad5f9dbef7f31162b9a49b9f85c0a309a3a0 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 13 Jan 2023 16:27:10 +0000 Subject: lib/video-source: Add video_source_import_buffers We need to be able to place encoded data into the sink device's bufs. To facilitate that add a video_source operation that allows the source to import buffers from the sink. Add a .import_buffers() callback so that the libcamera-source can access a sink's buffers. Reviewed-by: Kieran Bingham Signed-off-by: Daniel Scally --- include/uvcgadget/video-source.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/uvcgadget/video-source.h') diff --git a/include/uvcgadget/video-source.h b/include/uvcgadget/video-source.h index f888ce4..61aeaf7 100644 --- a/include/uvcgadget/video-source.h +++ b/include/uvcgadget/video-source.h @@ -22,6 +22,8 @@ struct video_source_ops { int(*alloc_buffers)(struct video_source *src, unsigned int nbufs); int(*export_buffers)(struct video_source *src, struct video_buffer_set **buffers); + int(*import_buffers)(struct video_source *src, + struct video_buffer_set *buffers); int(*free_buffers)(struct video_source *src); int(*stream_on)(struct video_source *src); int(*stream_off)(struct video_source *src); @@ -62,6 +64,8 @@ int video_source_set_frame_rate(struct video_source *src, unsigned int fps); int video_source_alloc_buffers(struct video_source *src, unsigned int nbufs); int video_source_export_buffers(struct video_source *src, struct video_buffer_set **buffers); +int video_source_import_buffers(struct video_source *src, + struct video_buffer_set *buffers); int video_source_free_buffers(struct video_source *src); int video_source_stream_on(struct video_source *src); int video_source_stream_off(struct video_source *src); -- cgit v1.2.3