Commit cf895efc authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: coda: flag the last encoded buffer

Use the flagged last output buffer to also flag the corresponding
capture buffer after encoding. This causes the end of stream event
to be issued and the buffer to be dequeued with the last flag set.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 0f8f6338
...@@ -1565,13 +1565,14 @@ static void coda_finish_encode(struct coda_ctx *ctx) ...@@ -1565,13 +1565,14 @@ static void coda_finish_encode(struct coda_ctx *ctx)
coda_read(dev, CODA_RET_ENC_PIC_SLICE_NUM); coda_read(dev, CODA_RET_ENC_PIC_SLICE_NUM);
coda_read(dev, CODA_RET_ENC_PIC_FLAG); coda_read(dev, CODA_RET_ENC_PIC_FLAG);
if (coda_read(dev, CODA_RET_ENC_PIC_TYPE) == 0) { dst_buf->flags &= ~(V4L2_BUF_FLAG_KEYFRAME |
V4L2_BUF_FLAG_PFRAME |
V4L2_BUF_FLAG_LAST);
if (coda_read(dev, CODA_RET_ENC_PIC_TYPE) == 0)
dst_buf->flags |= V4L2_BUF_FLAG_KEYFRAME; dst_buf->flags |= V4L2_BUF_FLAG_KEYFRAME;
dst_buf->flags &= ~V4L2_BUF_FLAG_PFRAME; else
} else {
dst_buf->flags |= V4L2_BUF_FLAG_PFRAME; dst_buf->flags |= V4L2_BUF_FLAG_PFRAME;
dst_buf->flags &= ~V4L2_BUF_FLAG_KEYFRAME; dst_buf->flags |= src_buf->flags & V4L2_BUF_FLAG_LAST;
}
v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false); v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false);
...@@ -1584,8 +1585,9 @@ static void coda_finish_encode(struct coda_ctx *ctx) ...@@ -1584,8 +1585,9 @@ static void coda_finish_encode(struct coda_ctx *ctx)
if (ctx->gopcounter < 0) if (ctx->gopcounter < 0)
ctx->gopcounter = ctx->params.gop_size - 1; ctx->gopcounter = ctx->params.gop_size - 1;
coda_dbg(1, ctx, "job finished: encoded %c frame (%d)\n", coda_dbg(1, ctx, "job finished: encoded %c frame (%d)%s\n",
coda_frame_type_char(dst_buf->flags), dst_buf->sequence); coda_frame_type_char(dst_buf->flags), dst_buf->sequence,
(dst_buf->flags & V4L2_BUF_FLAG_LAST) ? " (last)" : "");
} }
static void coda_seq_end_work(struct work_struct *work) static void coda_seq_end_work(struct work_struct *work)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment