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/nvidia | |
| 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/nvidia')
| -rw-r--r-- | drivers/media/platform/nvidia/tegra-vde/h264.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/nvidia/tegra-vde/h264.c b/drivers/media/platform/nvidia/tegra-vde/h264.c index 45f8f6904867..2a2211671fd9 100644 --- a/drivers/media/platform/nvidia/tegra-vde/h264.c +++ b/drivers/media/platform/nvidia/tegra-vde/h264.c @@ -776,7 +776,7 @@ static int tegra_vde_h264_setup_frames(struct tegra_ctx *ctx, * If userspace doesn't tell us frame's type, then we will try decode * as-is. */ - v4l2_m2m_buf_copy_metadata(src, dst, true); + v4l2_m2m_buf_copy_metadata(src, dst); if (h->decode_params->flags & V4L2_H264_DECODE_PARAM_FLAG_BFRAME) tb->b_frame = true; |
