diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-03-30 17:11:38 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-11 18:31:09 +0300 |
commit | fbbbb2cd0b39acba0720354d4beb98f39b69a29f (patch) | |
tree | 082ffd3f2578296be4d9c634381dad7347eced87 /drivers/media/platform/vicodec | |
parent | 358387d34bea5965f8330ebb71df649af587bf5f (diff) | |
download | linux-fbbbb2cd0b39acba0720354d4beb98f39b69a29f.tar.xz |
media: vicodec: set KEY/PFRAME flag when decoding
Set V4L2_BUF_FLAG_P/KEYFRAME after decoding a frame.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vicodec')
-rw-r--r-- | drivers/media/platform/vicodec/vicodec-core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index 4bea4a57386d..4b0062ac880c 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -329,6 +329,10 @@ static int device_process(struct vicodec_ctx *ctx, copy_cap_to_ref(p_dst, ctx->state.info, &ctx->state); vb2_set_plane_payload(&dst_vb->vb2_buf, 0, q_dst->sizeimage); + if (ntohl(ctx->state.header.flags) & FWHT_FL_I_FRAME) + dst_vb->flags |= V4L2_BUF_FLAG_KEYFRAME; + else + dst_vb->flags |= V4L2_BUF_FLAG_PFRAME; } return ret; } @@ -407,7 +411,6 @@ static void device_run(void *priv) u32 state; struct media_request *src_req; - src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); src_req = src_buf->vb2_buf.req_obj.req; @@ -421,7 +424,7 @@ static void device_run(void *priv) else dst_buf->sequence = q_dst->sequence++; dst_buf->flags &= ~V4L2_BUF_FLAG_LAST; - v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, !ctx->is_enc); + v4l2_m2m_buf_copy_metadata(src_buf, dst_buf, false); ctx->last_dst_buf = dst_buf; |