OSDN Git Service

media: vicodec: stateless codecs do not have EOS and SOURCE_CHANGE events
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 6 Jun 2019 10:00:30 +0000 (06:00 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Jun 2019 15:32:09 +0000 (11:32 -0400)
Return an error when attempting to subscribe to those events
for a stateless codec.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vicodec/vicodec-core.c

index ce7f7bf..91cd0c1 100644 (file)
@@ -1293,6 +1293,8 @@ static int vicodec_subscribe_event(struct v4l2_fh *fh,
                        return -EINVAL;
                /* fall through */
        case V4L2_EVENT_EOS:
+               if (ctx->is_stateless)
+                       return -EINVAL;
                return v4l2_event_subscribe(fh, sub, 0, NULL);
        default:
                return v4l2_ctrl_subscribe_event(fh, sub);