diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-06-26 09:26:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-07-25 08:10:31 -0400 |
commit | ee1228cca15ce097b7badebfdd0fef23a2cca9e1 (patch) | |
tree | 21a2a345180ad0a86e4faa9f2cca1d514909c7fe /include/media/v4l2-mem2mem.h | |
parent | 62c3fce04154777e6a3ce3a27f123b645d36dcff (diff) |
media: v4l2-mem2mem: add v4l2_m2m_last_buf()
This can be used to mark the last queued source buffer as the last
buffer.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media/v4l2-mem2mem.h')
-rw-r--r-- | include/media/v4l2-mem2mem.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index d60d3060f762..d655720e16a1 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h @@ -450,6 +450,35 @@ static inline void *v4l2_m2m_next_dst_buf(struct v4l2_m2m_ctx *m2m_ctx) } /** + * v4l2_m2m_last_buf() - return last buffer from the list of ready buffers + * + * @q_ctx: pointer to struct @v4l2_m2m_queue_ctx + */ +void *v4l2_m2m_last_buf(struct v4l2_m2m_queue_ctx *q_ctx); + +/** + * v4l2_m2m_last_src_buf() - return last destination buffer from the list of + * ready buffers + * + * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx + */ +static inline void *v4l2_m2m_last_src_buf(struct v4l2_m2m_ctx *m2m_ctx) +{ + return v4l2_m2m_last_buf(&m2m_ctx->out_q_ctx); +} + +/** + * v4l2_m2m_last_dst_buf() - return last destination buffer from the list of + * ready buffers + * + * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx + */ +static inline void *v4l2_m2m_last_dst_buf(struct v4l2_m2m_ctx *m2m_ctx) +{ + return v4l2_m2m_last_buf(&m2m_ctx->cap_q_ctx); +} + +/** * v4l2_m2m_for_each_dst_buf() - iterate over a list of destination ready * buffers * |