From patchwork Wed Jul 24 11:27:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85D6C1398 for ; Wed, 24 Jul 2019 11:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7676428628 for ; Wed, 24 Jul 2019 11:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ACF72868C; Wed, 24 Jul 2019 11:29:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11EED28628 for ; Wed, 24 Jul 2019 11:29:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbfGXL3a (ORCPT ); Wed, 24 Jul 2019 07:29:30 -0400 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:59633 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727322AbfGXL3a (ORCPT ); Wed, 24 Jul 2019 07:29:30 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qFSXh3tC8LqASqFSahNLXI; Wed, 24 Jul 2019 13:29:28 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [PATCH 10/14] videodev2.h: add V4L2_DEC_CMD_FLUSH Date: Wed, 24 Jul 2019 13:27:12 +0200 Message-Id: <20190724112716.30288-11-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724112716.30288-1-hverkuil-cisco@xs4all.nl> References: <20190724112716.30288-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfAP1HlK0A1b5RCo1gGYyKoiWm3cDg6plRBlwv5Vzwov9fmtqInZ1GJhvKU4dvkGQ28orlhMYB5pa77KAE7o6EzJR1sb4ZAVOGMJRvcWThqSFo1V7WQLa WpxL9lY7LgwJ/s45eN1sjfzUKUlYoQHRnJm1Tqqoup+3/MQPLoussgRqPz3m592sLTxcWdLDQFfxZc2jGJ47GU5tKTuyLrVqw0eSRKiQUfxpoxPeKCZMA6Nu Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add this new V4L2_DEC_CMD_FLUSH decoder command and document it. Signed-off-by: Hans Verkuil --- Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 11 ++++++++++- Documentation/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst index ccf83b05afa7..1577850ce407 100644 --- a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst +++ b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst @@ -200,7 +200,16 @@ introduced in Linux 3.3. 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, + and only if ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` was set. + 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 last capture buffer containing the last decoded frame. + So this command can be used to explicitly flush that last decoded + frame. Return Value ============ diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions index b6cb9fa6c8a8..a2cd94430638 100644 --- a/Documentation/media/videodev2.h.rst.exceptions +++ b/Documentation/media/videodev2.h.rst.exceptions @@ -434,6 +434,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 diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 0682fbc9980d..e22511cfc24a 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1978,6 +1978,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)