From patchwork Thu Jan 14 14:50:06 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: 8032481 Return-Path: X-Original-To: patchwork-linux-arm@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 93EE6BEEE5 for ; Thu, 14 Jan 2016 14:52:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B49620411 for ; Thu, 14 Jan 2016 14:52:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C945A20295 for ; Thu, 14 Jan 2016 14:52:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJjEv-0006aa-3w; Thu, 14 Jan 2016 14:51:05 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJjEV-0006M6-SA for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2016 14:50:41 +0000 Received: by mail-pf0-x234.google.com with SMTP id 65so100855370pff.2 for ; Thu, 14 Jan 2016 06:50:19 -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=zVULK0QjSZIVpnZx5MFvCAE8mPFpDwunYmZ57bnEZzI=; b=LyOjEG02y0L+tqitx8nOeZQYiEt5DJ6DQguLs/q2E+aTa4BJh7xVwVUvfocXzson+d I2lMjQX59olgg2fdEgPsDpn+KrmbNAHofv5z4Juu/893WwPGrRhTBsTIMczmVMnCGpHK lzzuAZK01aIf2UsscpJ2DiWMa+Xd8eFrHMySU= 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=zVULK0QjSZIVpnZx5MFvCAE8mPFpDwunYmZ57bnEZzI=; b=Sc7R5xypLGk12wax+7YsWiPcMj6swBnjdhaqr3z2148PNqawtQ9LhcXjtwx4xn1LpK RhCpfT9srC1Bs+wD4SVhsuKB31ckRXWHTrK5+83kNho+Nk/uy8pzxchazDkJ6At+6qMb rVOHG7UiD9rsMjDgn1TGuipZYU+X2VV89kkFDxJa9/q2yx/PhXvbIsMcwSQjbtkJ0qT4 5aE6VU9KBf/EQi8c+k76bpSUx25Kz+jsSoVR0fd4BUweUkf6rBY6iUdgeL1krtG13hsg z1ztoKe3Uoevg7i+RroE+jPgmp8Dle1faMF4l85TtSdvSRuxbK/5pN9haTxFDJQwElef 3w3g== X-Gm-Message-State: ALoCoQmFnzLdjxdy77UBo5wbr01nhkjdA9I3GiDNpaqdE3L8OtMJeF7n3xu/xF7y/clES/9y8WGzueFH4B5WZKDFuDHREEy5RQ== X-Received: by 10.98.31.8 with SMTP id f8mr6385504pff.71.1452783018976; Thu, 14 Jan 2016 06:50:18 -0800 (PST) Received: from wuchengli-z840.tpe.corp.google.com ([172.30.210.26]) by smtp.gmail.com with ESMTPSA id n84sm9915567pfa.45.2016.01.14.06.50.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 06:50:18 -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 Subject: [PATCH v3 1/2] v4l: add V4L2_CID_MPEG_VIDEO_FORCE_I_FRAME. Date: Thu, 14 Jan 2016 22:50:06 +0800 Message-Id: <1452783007-80883-2-git-send-email-wuchengli@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1452783007-80883-1-git-send-email-wuchengli@chromium.org> References: <1452783007-80883-1-git-send-email-wuchengli@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160114_065040_018321_9E1144FC X-CRM114-Status: GOOD ( 10.67 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, djkurtz@chromium.org, tiffany.lin@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 I frame. Add a general V4L2_CID_MPEG_VIDEO_FORCE_I_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..6760cf5 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_I_FRAME  + button + Force an I 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..33ecb7b 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_I_FRAME: return "Force an I 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_I_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..1c911b8 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_I_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)