History

media: videodev2.h: add V4L2_DEC_CMD_FLUSH

Add this new V4L2_DEC_CMD_FLUSH decoder command and document it.

Hans Verkuil committed 7 years ago

Commit bac06ec1 parent f8cca8c3 files · +11 −1Browse files

Unified · Split

3 files
  1. Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst +9 −1
  2. Documentation/media/videodev2.h.rst.exceptions +1 −0
  3. include/uapi/linux/videodev2.h +1 −0
Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst+9−1
@@ -208,7 +208,15 @@ introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decod · 207 unmodified lines
208208 been started yet, the driver will return an ``EPERM`` error code. When
209209 the decoder is already running, this command does nothing. No
210210 flags are defined for this command.
211−
211+ * - ``V4L2_DEC_CMD_FLUSH``
212+ - 4
213+ - Flush any held capture buffers. Only valid for stateless decoders.
214+ This command is typically used when the application reached the
215+ end of the stream and the last output buffer had the
216+ ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent
217+ dequeueing the capture buffer containing the last decoded frame.
218+ So this command can be used to explicitly flush that final decoded
219+ frame. This command does nothing if there are no held capture buffers.
212220
213221 Return Value
214222 ============
Documentation/media/videodev2.h.rst.exceptions+1−0
@@ -435,6 +435,7 @@ replace define V4L2_DEC_CMD_START decoder-cmds · 434 unmodified lines
435435 replace define V4L2_DEC_CMD_STOP decoder-cmds
436436 replace define V4L2_DEC_CMD_PAUSE decoder-cmds
437437 replace define V4L2_DEC_CMD_RESUME decoder-cmds
438+replace define V4L2_DEC_CMD_FLUSH decoder-cmds
438439
439440 replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
440441 replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
include/uapi/linux/videodev2.h+1−0
@@ -1984,6 +1984,7 @@ struct v4l2_encoder_cmd { · 1983 unmodified lines
19841984 #define V4L2_DEC_CMD_STOP (1)
19851985 #define V4L2_DEC_CMD_PAUSE (2)
19861986 #define V4L2_DEC_CMD_RESUME (3)
1987+#define V4L2_DEC_CMD_FLUSH (4)
19871988
19881989 /* Flags for V4L2_DEC_CMD_START */
19891990 #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)