Skip to content

Commit

Permalink
media: videodev2.h: add V4L2_DEC_CMD_FLUSH
Browse files Browse the repository at this point in the history
Add this new V4L2_DEC_CMD_FLUSH decoder command and document it.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 21, 2019
1 parent f8cca8c commit bac06ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decod
been started yet, the driver will return an ``EPERM`` error code. When
the decoder is already running, this command does nothing. No
flags are defined for this command.

* - ``V4L2_DEC_CMD_FLUSH``
- 4
- Flush any held capture buffers. Only valid for stateless decoders.
This command is typically used when the application reached the
end of the stream and the last output buffer had the
``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent
dequeueing the capture buffer containing the last decoded frame.
So this command can be used to explicitly flush that final decoded
frame. This command does nothing if there are no held capture buffers.

Return Value
============
Expand Down
1 change: 1 addition & 0 deletions Documentation/media/videodev2.h.rst.exceptions
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ replace define V4L2_DEC_CMD_START decoder-cmds
replace define V4L2_DEC_CMD_STOP decoder-cmds
replace define V4L2_DEC_CMD_PAUSE decoder-cmds
replace define V4L2_DEC_CMD_RESUME decoder-cmds
replace define V4L2_DEC_CMD_FLUSH decoder-cmds

replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/videodev2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,7 @@ struct v4l2_encoder_cmd {
#define V4L2_DEC_CMD_STOP (1)
#define V4L2_DEC_CMD_PAUSE (2)
#define V4L2_DEC_CMD_RESUME (3)
#define V4L2_DEC_CMD_FLUSH (4)

/* Flags for V4L2_DEC_CMD_START */
#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
Expand Down

0 comments on commit bac06ec

Please sign in to comment.