[3/3] media: mediatek: vcodec: adapt headers only flag for V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE

Message ID 20230103071551.17775-3-ming.qian@nxp.com
State New
Headers
Series [1/3] media: venus: adapt headers only flag for V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE |

Commit Message

Ming Qian Jan. 3, 2023, 7:15 a.m. UTC
  when V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE is chosen,
the first buffer only contains stream header,
so apply the flag V4L2_BUF_FLAG_HEADERS_ONLY

Signed-off-by: Ming Qian <ming.qian@nxp.com>
---
 drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
index d65800a3b89d..0563abceb858 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
@@ -1090,6 +1090,7 @@  static int mtk_venc_encode_header(void *priv)
 
 	ctx->state = MTK_STATE_HEADER;
 	vb2_set_plane_payload(&dst_buf->vb2_buf, 0, enc_result.bs_size);
+	dst_buf->flags |= V4L2_BUF_FLAG_HEADERS_ONLY;
 	v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_DONE);
 
 	return 0;