media: mtk-vcodec: venc: support START and STOP commands
authorAlexandre Courbot <acourbot@chromium.org>
Fri, 6 Aug 2021 04:15:21 +0000 (06:15 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:41 +0000 (10:07 +0200)
commitb375e01b796a3bdb2de93ebb15b645edb7972abd
tree46b9aa8c9af3ca3ed9c886643e7bce6f629f8283
parent69466c22f51bb0085ed886f5a5b3db7368245872
media: mtk-vcodec: venc: support START and STOP commands

The V4L2 encoder specification requires encoders to support the
V4L2_ENC_CMD_START and V4L2_ENC_CMD_STOP commands. Add support for these
to the mtk-vcodec encoder by reusing the same flush buffer as used by
the decoder driver.

[hsinyi: fix double-free issue if flush buffer was not dequeued by the
time streamoff is called]

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c