提交 0520e4cc 编写于 作者: P Pawel Osciak 提交者: Mauro Carvalho Chehab

[media] s5p-mfc: Add support for resolution change event

When a resolution change point is reached, queue an event to signal the
userspace that a new set of buffers is required before decoding can
continue.
Signed-off-by: NPawel Osciak <posciak@chromium.org>
Signed-off-by: NArun Kumar K <arun.kk@samsung.com>
Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: NKamil Debski <k.debski@samsung.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 3cbe6e5b
...@@ -342,8 +342,16 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, ...@@ -342,8 +342,16 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx,
/* All frames remaining in the buffer have been extracted */ /* All frames remaining in the buffer have been extracted */
if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) { if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) {
if (ctx->state == MFCINST_RES_CHANGE_FLUSH) { if (ctx->state == MFCINST_RES_CHANGE_FLUSH) {
static const struct v4l2_event ev_src_ch = {
.type = V4L2_EVENT_SOURCE_CHANGE,
.u.src_change.changes =
V4L2_EVENT_SRC_CH_RESOLUTION,
};
s5p_mfc_handle_frame_all_extracted(ctx); s5p_mfc_handle_frame_all_extracted(ctx);
ctx->state = MFCINST_RES_CHANGE_END; ctx->state = MFCINST_RES_CHANGE_END;
v4l2_event_queue_fh(&ctx->fh, &ev_src_ch);
goto leave_handle_frame; goto leave_handle_frame;
} else { } else {
s5p_mfc_handle_frame_all_extracted(ctx); s5p_mfc_handle_frame_all_extracted(ctx);
......
...@@ -867,6 +867,8 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh, ...@@ -867,6 +867,8 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
switch (sub->type) { switch (sub->type) {
case V4L2_EVENT_EOS: case V4L2_EVENT_EOS:
return v4l2_event_subscribe(fh, sub, 2, NULL); return v4l2_event_subscribe(fh, sub, 2, NULL);
case V4L2_EVENT_SOURCE_CHANGE:
return v4l2_src_change_event_subscribe(fh, sub);
default: default:
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册