summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2022-07-11 23:11:34 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-17 12:10:11 +0200
commit9d042e457ef8e3f883f0cba8a1eed633906deb78 (patch)
tree5b124d9aeb9de3c9cf02dde82b6c244cf19300cf /include/media
parentmedia: cedrus: h265: Implement support for tiles (diff)
downloadlinux-9d042e457ef8e3f883f0cba8a1eed633906deb78.tar.xz
linux-9d042e457ef8e3f883f0cba8a1eed633906deb78.zip
media: videobuf2: Introduce vb2_find_buffer()
All users of vb2_find_timestamp() combine it with vb2_get_buffer() to retrieve a videobuf2 buffer, given a u64 timestamp. Introduce an API for this use-case. Users will be converted to the new API as follow-up commits. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Acked-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/videobuf2-v4l2.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index d818d9707695..76e405c0b003 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -78,6 +78,16 @@ struct vb2_v4l2_buffer {
int vb2_find_timestamp(const struct vb2_queue *q, u64 timestamp,
unsigned int start_idx);
+/**
+ * vb2_find_buffer() - Find a buffer with given timestamp
+ *
+ * @q: pointer to &struct vb2_queue with videobuf2 queue.
+ * @timestamp: the timestamp to find.
+ *
+ * Returns the buffer with the given @timestamp, or NULL if not found.
+ */
+struct vb2_buffer *vb2_find_buffer(struct vb2_queue *q, u64 timestamp);
+
int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);
/**