提交 69a90057 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

media: vicodec: support SOURCE_CHANGE event for decoders only

The SOURCE_CHANGE event is decoder specific, so don't allow it for
encoders.
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 281ae39b
......@@ -1118,9 +1118,14 @@ static int vicodec_enum_framesizes(struct file *file, void *fh,
static int vicodec_subscribe_event(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub)
{
struct vicodec_ctx *ctx = container_of(fh, struct vicodec_ctx, fh);
switch (sub->type) {
case V4L2_EVENT_EOS:
case V4L2_EVENT_SOURCE_CHANGE:
if (ctx->is_enc)
return -EINVAL;
/* fall through */
case V4L2_EVENT_EOS:
return v4l2_event_subscribe(fh, sub, 0, NULL);
default:
return v4l2_ctrl_subscribe_event(fh, sub);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册