diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2025-10-15 13:01:16 +0300 |
|---|---|---|
| committer | Hans Verkuil <hverkuil+cisco@kernel.org> | 2025-10-17 11:31:16 +0200 |
| commit | 1fdb55ed40fa5ebe6934bd6b93036c714ebb5ef8 (patch) | |
| tree | 6bb2f2ce0925497488189466937cefbeae053390 /drivers/media/platform/allegro-dvt/allegro-core.c | |
| parent | d5ddab0cf001fb2ac56fb03d1393077287b9cc03 (diff) | |
media: v4l2-mem2mem: Don't copy frame flags in v4l2_m2m_buf_copy_metadata()
The v4l2_m2m_buf_copy_metadata() function takes a boolean
copy_frame_flags argument. When true, it causes the function to copy the
V4L2_BUF_FLAG_KEYFRAME, V4L2_BUF_FLAG_BFRAME and V4L2_BUF_FLAG_PFRAME
flags from the output buffer to the capture buffer.
There is no use cases in any upstream driver for copying the flags.
KEY/P/B frames are properties of the bitstream buffer in some formats.
Once decoded, this is no longer a property of the video frame and should
be discarded.
It was considered useful to know if an uncompressed frame was decoded
from a KEY/P/B compressed frame, and to preserve that information if
that same uncompressed frame was passed through another M2M device (e.g.
a scaler). However, the V4L2 documentation makes it clear that the flags
are meant for compressed frames only.
Drop the copy_frame_flags argument from v4l2_m2m_buf_copy_metadata().
The change to drivers was performed with the following Coccinelle
semantic patch:
@@
expression src;
expression dst;
expression flag;
@@
- v4l2_m2m_buf_copy_metadata(src, dst, flag);
+ v4l2_m2m_buf_copy_metadata(src, dst);
include/media/v4l2-mem2mem.h and drivers/media/v4l2-core/v4l2-mem2mem.c
have been updated manually.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'drivers/media/platform/allegro-dvt/allegro-core.c')
| -rw-r--r-- | drivers/media/platform/allegro-dvt/allegro-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index 875e5cbbeb07..f347d56ac108 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -2124,7 +2124,7 @@ static void allegro_channel_finish_frame(struct allegro_channel *channel, state = VB2_BUF_STATE_DONE; - v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false); + v4l2_m2m_buf_copy_metadata(src_buf, dst_buf); if (msg->is_idr) dst_buf->flags |= V4L2_BUF_FLAG_KEYFRAME; else |