[PATCH v8 04/15] media:Add v4l2 event codec_error and skip
From: Ming Qian <ming.qian@nxp.com>
Date: 2021-09-07 09:50:19
Also in:
linux-devicetree, linux-media, lkml
Subsystem:
media input infrastructure (v4l/dvb), the rest · Maintainers:
Mauro Carvalho Chehab, Linus Torvalds
The codec_error event can tell client that there are some error occurs in the decoder engine. The skip event can tell the client that there are a frame has been decoded, but it won't be outputed. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <redacted> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> --- .../userspace-api/media/v4l/vidioc-dqevent.rst | 12 ++++++++++++ include/uapi/linux/videodev2.h | 2 ++ 2 files changed, 14 insertions(+)
diff --git a/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst b/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst
index 6eb40073c906..87d40ad25604 100644
--- a/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst
+++ b/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst@@ -182,6 +182,18 @@ call. the regions changes. This event has a struct :c:type:`v4l2_event_motion_det` associated with it. + * - ``V4L2_EVENT_CODEC_ERROR`` + - 7 + - This event is triggered when some error occurs inside the codec engine, + usually it can be replaced by a POLLERR event, but in some cases, the POLLERR + may cause the application to exit, but this event can allow the application to + handle the codec error without exiting. + * - ``V4L2_EVENT_SKIP`` + - 8 + - This event is triggered when one frame is decoded, but it won't be outputed + to the display. So the application can't get this frame, and the input frame count + is dismatch with the output frame count. And this evevt is telling the client to + handle this case. * - ``V4L2_EVENT_PRIVATE_START`` - 0x08000000 - Base event number for driver-private events.
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 5bb0682b4a23..c56640d42dc5 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h@@ -2369,6 +2369,8 @@ struct v4l2_streamparm { #define V4L2_EVENT_FRAME_SYNC 4 #define V4L2_EVENT_SOURCE_CHANGE 5 #define V4L2_EVENT_MOTION_DET 6 +#define V4L2_EVENT_CODEC_ERROR 7 +#define V4L2_EVENT_SKIP 8 #define V4L2_EVENT_PRIVATE_START 0x08000000 /* Payload for V4L2_EVENT_VSYNC */
--
2.32.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel