From patchwork Tue Jan 19 07:07:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu-Cheng Li X-Patchwork-Id: 8058481 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D497BEEE5 for ; Tue, 19 Jan 2016 07:08:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94D5F20414 for ; Tue, 19 Jan 2016 07:08:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2304320411 for ; Tue, 19 Jan 2016 07:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757289AbcASHHh (ORCPT ); Tue, 19 Jan 2016 02:07:37 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35287 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757284AbcASHHc (ORCPT ); Tue, 19 Jan 2016 02:07:32 -0500 Received: by mail-pf0-f181.google.com with SMTP id 65so170489029pff.2 for ; Mon, 18 Jan 2016 23:07:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fT9irxXelj4UktaXDfKh16DXDAtgVxjI4IA3MouF5zQ=; b=XNn4j62ao9svrMsiP5Of2BRS4owK/m3Hf+WDbt0yVFEwB3OQN37GnXeOrMx2MA3M21 qZSHj2ONsp3cxLqCMIk2oy924tPORvd3GKpdxYBAUU8dt1/egxNdMMSvN/0oYaQWy4qE VBguh4/r0KksN5kQUrSzncqZEGmDLLxOpRvx8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fT9irxXelj4UktaXDfKh16DXDAtgVxjI4IA3MouF5zQ=; b=AhjUXxM2R5PJK6UZo8+dtweZPo4omCimdP9KnEjxQbeSeXTqsGJER2TOayWQLCsWmU Itg7v0PgL6voEOZ8tALdfitZrt+oq9BOgu/YoQBWNOfuMl7/EsYeaF9gGx2XzIltGILW gX9vLLmyYXj2B1rEgyeyCvl4Jf491DxI8H1tN9ZhcmGpRCGpq/3YHZ2nxp8N+xcvrsrg hsdk8Z6Ok3p38MqzLnGLqrlcEKoy5a1d5J5ILYeo0P6GnMh94YQse0iMBy/WN1lhnqVC 0GjKtv+1Ihi+yUN2aQpMMr8GPcF6WeIjyVkUSzQhC18cq0rvXt9dRcEtPGuy379ehlif pgsg== X-Gm-Message-State: ALoCoQmYMi+8RtbOCmmlImEuvOWr7vVjAXjcbJXeRpL3pwh3JLCxctcVqYtXZ553rESANnvoztoljetjlkcalIxi7RlQcybvwg== X-Received: by 10.98.72.72 with SMTP id v69mr42131664pfa.100.1453187251811; Mon, 18 Jan 2016 23:07:31 -0800 (PST) Received: from wuchengli-z840.tpe.corp.google.com ([172.30.210.26]) by smtp.gmail.com with ESMTPSA id e17sm38715807pfd.4.2016.01.18.23.07.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jan 2016 23:07:31 -0800 (PST) From: Wu-Cheng Li To: pawel@osciak.com, mchehab@osg.samsung.com, hverkuil@xs4all.nl, k.debski@samsung.com, crope@iki.fi, standby24x7@gmail.com, wuchengli@chromium.org, nicolas.dufresne@collabora.com, ricardo.ribalda@gmail.com, ao2@ao2.it, bparrot@ti.com, kyungmin.park@samsung.com, jtp.park@samsung.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tiffany.lin@mediatek.com, djkurtz@chromium.org Subject: [PATCH v4 1/2] v4l: add V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME. Date: Tue, 19 Jan 2016 15:07:09 +0800 Message-Id: <1453187230-97231-2-git-send-email-wuchengli@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1453187230-97231-1-git-send-email-wuchengli@chromium.org> References: <1453187230-97231-1-git-send-email-wuchengli@chromium.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some drivers also need a control like V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE to force an encoder key frame. Add a general V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME so the new drivers and applications can use it. Signed-off-by: Wu-Cheng Li --- Documentation/DocBook/media/v4l/controls.xml | 8 ++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 2 ++ include/uapi/linux/v4l2-controls.h | 1 + 3 files changed, 11 insertions(+) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index f13a429..a62ea7b 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -2330,6 +2330,14 @@ vertical search range for motion estimation module in video encoder. + + V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME  + button + Force a key frame for the next queued buffer. Applicable to encoders. +This is a general, codec-agnostic keyframe control. + + + V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE  integer diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index c9d5537..bd1b7ad 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -747,6 +747,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: return "Horizontal MV Search Range"; case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: return "Vertical MV Search Range"; case V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER: return "Repeat Sequence Header"; + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: return "Force Key Frame"; /* VPX controls */ case V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS: return "VPX Number of Partitions"; @@ -985,6 +986,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: *type = V4L2_CTRL_TYPE_INTEGER; break; + case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: case V4L2_CID_PAN_RESET: case V4L2_CID_TILT_RESET: case V4L2_CID_FLASH_STROBE: diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 2d225bc..5b49df6 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -390,6 +390,7 @@ enum v4l2_mpeg_video_multi_slice_mode { #define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226) #define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_MPEG_BASE+227) #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_MPEG_BASE+228) +#define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_MPEG_BASE+229) #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)