From patchwork Wed Apr 29 08:14:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 19363 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 18CF5448A73 for ; Wed, 29 Apr 2020 11:14:58 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EACF468BEA7; Wed, 29 Apr 2020 11:14:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2056.outbound.protection.outlook.com [40.107.22.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 977AF68BC07 for ; Wed, 29 Apr 2020 11:14:50 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gpgJyVTJOtOE5GLIcgzSgLB24G2xuWGFo6/BEUunQTMSvzkOGniRn3wzPdTL7/z3WqHxSGb6YDDmTXPk+ahEW9Nn8wklMtS+CcANjrNstWGnba6hFFK6xbTJ4vMCyOqNzObBrvNNck64VcElt2C4tuE4UyBJELWNYZpZBHoJh/W72GjB5VXDX8+1zsbfllFVFGG6IjsAUvpSRr7xJmJXOFErV0em2NlLrHe8IfxmCw1BOuPEvsglGbQTRiLvRihhaMPVSl3hxJOTn8zf2mpf3IVYIvyHjuVWOA3RpyG9aTUbWaCbQhHoGU+sWj511I9sncWOq57nNQ18/1SSJDz5Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xqTpUYcNbQT579k55bNE/+XnW0aLZwNW5Ou2mChkIcw=; b=cHereNyCn4k1FIqxpwNMMW6GULP4BwnF/sKq0El2+ke4ofYvNluKe6//mpBNyLB5sdHbA2jGvoJbycSxprLAg62yYm4heuWioKDvV01ChjJ9hqQMhI5JKhacWccB+8sadn9uEHb34SZP3F2VcbkNpABk+QTmiO9RCKLTo8NkSRltWJZQ9a2cgIwaATbN0aVEJi5Orx4m2qZvugHVeYywqEfUQoJX0tb1j0Zsr705moTtVONx2k43veo6MwQ1y2Bb6at+k8ZfKKPgOWFIZ3sd8sbhZAO6F2aCSvf879N+LYut5oWhGVengJudYaltoqOUxyRDKMj37y5O/LH0d7Cwmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xqTpUYcNbQT579k55bNE/+XnW0aLZwNW5Ou2mChkIcw=; b=EqlnMxZFhdOlY4JXy5WOm426WS4pnV5S8ZllCjbi6m6Fb+wwxDEGZ+eUcyUfv1IF2DcfJ8SZx3NjjHZ3Zr8Q/8q4+TLMGGcrhDsUmuyfP0sFvqNn7E+Bgv6Ru+YLPoOBZdaHYDPv/j+NTyTv8Q1SpAqS2U/D2vxMDkqyi+ZHo0w= Authentication-Results: ffmpeg.org; dkim=none (message not signed) header.d=none;ffmpeg.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6368.eurprd04.prod.outlook.com (2603:10a6:803:11b::18) by VE1SPR01MB0002.eurprd04.prod.outlook.com (2603:10a6:802:8e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Wed, 29 Apr 2020 08:14:49 +0000 Received: from VE1PR04MB6368.eurprd04.prod.outlook.com ([fe80::c962:b871:9b:853]) by VE1PR04MB6368.eurprd04.prod.outlook.com ([fe80::c962:b871:9b:853%7]) with mapi id 15.20.2958.020; Wed, 29 Apr 2020 08:14:49 +0000 From: Ming Qian To: ffmpeg-devel@ffmpeg.org Date: Wed, 29 Apr 2020 16:14:26 +0800 Message-Id: <20200429081426.19637-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.26.0 X-ClientProxiedBy: SG2PR0302CA0009.apcprd03.prod.outlook.com (2603:1096:3:2::19) To VE1PR04MB6368.eurprd04.prod.outlook.com (2603:10a6:803:11b::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv11149.swis.cn-sha01.nxp.com (119.31.174.70) by SG2PR0302CA0009.apcprd03.prod.outlook.com (2603:1096:3:2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.9 via Frontend Transport; Wed, 29 Apr 2020 08:14:48 +0000 X-Mailer: git-send-email 2.26.0 X-Originating-IP: [119.31.174.70] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4e48add3-4259-4f5e-9f31-08d7ec1562ac X-MS-TrafficTypeDiagnostic: VE1SPR01MB0002: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:159; X-Forefront-PRVS: 03883BD916 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1LVq9OzgjXGJvOy42tMzLdqakWftHJa1Ap+x2Lgzd8ClWN9lMRajttbNYgETJXvY5tW4Sqts+/TxxKjQ9ARTVKjwuRmszIXRDXmY9ruV5uM/6mhenXh4IfTvMVYGpPC/ALLpKICRWTgH+y/Bd8aIOZuOcM9ayeKLnOfTa74hxVFubmYwDDbIAttTUcjmN2+shGGMTDrpTWZldCIPnc9WCG5FlFEyXv/NfQX4paD46Q8r8Ac1oRO3DX90058hX/gAG0mNWFhXAz1b4Jgw8nnr3ZmB627QrXN+pmhLuRJiMyiy9yZFNkJIFpzoOO8cxlVU+p8ZgSBY0OG26P6Tr0hrW5Sz4CPUnLEn/iuOYsOw8EBxZvQ9c6mjTVxTo62OaCXEXL94vEp1mUtkFvh0jM3XOdPzIbmfaWqMU9krNaUNT1HUtHHPX5UqhM6/nO+X83KgMbcjWmrDylikSdeH7415IC8LEAuzM3Nepy6P1TEejGixaIPfl7oyAIGaHimlBI5Y X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6368.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(366004)(396003)(39860400002)(376002)(36756003)(6916009)(2616005)(2906002)(956004)(6486002)(478600001)(6666004)(8936002)(316002)(4744005)(1076003)(66476007)(16526019)(186003)(5660300002)(52116002)(8676002)(44832011)(26005)(66946007)(66556008)(7696005)(86362001)(70780200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qVDRwZQnfSavMA9XLXg0U+u44ClxJoqnPGueXBZ9i7TYCqy0VHp4/VCiC1Aruet2lmV2frUr5yoLs3zBHfCmGTA9fL9kmt9MV0GP4TKjwlYiai8M9IjlzavFzLAQ7GYNpf+0//y3Z1KmPx8SgNqK+9OPAitt2NJOdEmmgeBuf/vf4tW+PgE4snWd9Z4JNABX36BLVNVgDktczKM8tjRDvQJS3yI5940B8EAce/fNFo0HcDk6PsKBSKP4Exj93oc2Rr/8mM84L/l2GDfwH+hk0Ckrp/CoxV+Fa/NcYW6wAUm9bwX+e1wvAGNlfQALQnETRy9FQvquJ/0JfHEZs/3Vylqpc4DiDz50p8aOXJwgiB0A5UEKCbrEqVqe889Q9evaYiDBhtdGK4XNcfoCE+azlkAdSrs2qhEcdrT7jiWMYWXmWCeYs/2U/BmEFgOtn/NCoLnYsFJsk0eXKIUu2a4gJWO/QUhbEoQq4SftPaL38w4d1zs3KoWQN0omxlQq2yI3w7jgAqta387mL24dcue84Wr0Y5REXM14aZdnx0cVblrGz5+kBVnII1te8C59Nb7hlVqpPJ689mBCp8i46K7ZC1EeyOVfiV8sKPclie1jJlUIP4J841YqlHtZlYO/1OT6jFvmvgF8io+jUNAFBG4ONB5exfXDo6i6udPo+R1TLCzi+H6u5NsoL8L9cVYDl/Iyh42yn42o3V/+YdwLPCszDIEvaU4nyJG5QK36zmH4DDDjysBIaYIEfSReTx7hEjQQj9gTSEjuouNwvm1U6pGsl8iHt84M4fkM9fI7ANd5+Zw= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e48add3-4259-4f5e-9f31-08d7ec1562ac X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2020 08:14:49.3391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: czdZlhywtjBFglmudmV1559lwoYHIcImXJn9CxW1+zaKm77Nfd8lZFFqjCqm7N8bjMKBju92yqjzDXBGQXaYyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1SPR01MB0002 Subject: [FFmpeg-devel] [PATCH v1] avcodec/v4l2_m2m_enc: Set bitrate mode to cbr by default X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Without this setting, bitrate may have no effect if the default value of bitrate mode is VBR. Signed-off-by: Ming Qian --- libavcodec/v4l2_m2m_enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c index 8454e2326c..6296ad88c6 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -191,6 +191,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) /* set ext ctrls */ v4l2_set_ext_ctrl(s, MPEG_CID(HEADER_MODE), MPEG_VIDEO(HEADER_MODE_SEPARATE), "header mode", 0); + v4l2_set_ext_ctrl(s, MPEG_CID(BITRATE_MODE), MPEG_VIDEO(BITRATE_MODE_CBR), "bit rate mode", 1); v4l2_set_ext_ctrl(s, MPEG_CID(BITRATE) , avctx->bit_rate, "bit rate", 1); v4l2_set_ext_ctrl(s, MPEG_CID(FRAME_RC_ENABLE), 1, "frame level rate control", 0); v4l2_set_ext_ctrl(s, MPEG_CID(GOP_SIZE), avctx->gop_size,"gop size", 1);