From patchwork Mon Mar 16 02:02:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 18214 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a0c:ab15:0:0:0:0:0 with SMTP id h21csp680965qvb; Sun, 15 Mar 2020 19:02:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtGgYTpsXMoM8lR4XvksABta1OWXKdyXqRytopadNK4UCT49Iyec5d49wi6vpP+oD8FqbJC X-Received: by 2002:a17:906:1308:: with SMTP id w8mr130086ejb.189.1584324157827; Sun, 15 Mar 2020 19:02:37 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b14si11641810edf.277.2020.03.15.19.02.37; Sun, 15 Mar 2020 19:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nxp.com header.s=selector2 header.b=nj1kVBRi; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BAE3B68B3F8; Mon, 16 Mar 2020 04:02:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2052.outbound.protection.outlook.com [40.107.21.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A4AC68AE2D for ; Mon, 16 Mar 2020 04:02:30 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HWaCtKlheDCoRPYPgzMzxy7u/u9OTFJVL9lXrZ13LOr8gol9FwqpTLmjkoXiOnsLaOo9jxmgK6AMNAnVwMqcJklPVj3lp28vwmTylox4FM2HQGtUCjtCLsxSoOsiZ45IIvEFDj1j8dbC9wpQiOutQ+sFZi9mJR5qqCW6g0lXxlG2cDj751rxDr1gy0USjnUWE+Im7VCCgkdJsENpXQreF20gUwWNdBgu7L3UeQ9eUDXjxwwfeFhFmbrP4U8LbeLHrnJQHJpXfcmnBgS+004RncJzBcyH5VBuxNcVOi650dKJOru+GmkkteZDWgsOy0JkTZlUhyIWMiu3eksgNjhu7A== 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=w6W6AUNpfBfxyQ8OcQkxJSwmtvsSjkHJw3E0rjUPweg=; b=K2RfuIfZzC3kQ6VChMLNkTAgUPGhtXTwj7A2mpnQ2yz0RRXDbYaRr+hUxRtbKsARUmzkMMDA2kw956yk/U3S7LrVFgtyRkXzuV8+Y2sJN4QGThOCA0/hxHMc7DjRRvuQJ3gEVskc8UxmyR2ptHQBl1Ys/v1CNdChh92ndGS85nDtY0g/zyT7YxYqpdN2YPiKVAToKKkv0ylZZUdBTmJufCzfss7FYtBRjGtmFYPaPwm0bJay4E53uObAmDxVwsylvP+n8+7BEcLg7IaoEBfTSXj1Wlxf6NCeg0ds4Begewf881uxWbGjlghAk4NcsfPgIg6utCFhxEF9L9aQ3HsZXg== 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=w6W6AUNpfBfxyQ8OcQkxJSwmtvsSjkHJw3E0rjUPweg=; b=nj1kVBRi69EYWq1Loj0JK0c7koonnVTkymwWfJovvjtZgGF+nB5JkH1gO/4Vef7bPkmv5sRa5tXIPrV654jskvilyKuTBHytyJJClDiMBp56t7Nf2CN9W69ZWeTAEd0gUwLs7kJxRktp3QD94E77564Q8XxWozCzZ29XQsSfekM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ming.qian@nxp.com; Received: from VE1PR04MB6368.eurprd04.prod.outlook.com (20.179.232.146) by VE1PR04MB6606.eurprd04.prod.outlook.com (20.179.235.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Mon, 16 Mar 2020 02:02:29 +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.2814.021; Mon, 16 Mar 2020 02:02:29 +0000 From: Ming Qian To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 Mar 2020 10:02:08 +0800 Message-Id: <20200316020208.27547-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: SG2P153CA0001.APCP153.PROD.OUTLOOK.COM (2603:1096::11) To VE1PR04MB6368.eurprd04.prod.outlook.com (2603:10a6:803:11b::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from NXL53318.am.freescale.net (119.31.174.68) by SG2P153CA0001.APCP153.PROD.OUTLOOK.COM (2603:1096::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.2 via Frontend Transport; Mon, 16 Mar 2020 02:02:27 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.68] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1dab7409-47bf-442a-ca24-08d7c94e14b6 X-MS-TrafficTypeDiagnostic: VE1PR04MB6606: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(199004)(6486002)(86362001)(498600001)(186003)(2906002)(6666004)(26005)(5660300002)(6512007)(956004)(66476007)(2616005)(8676002)(6506007)(52116002)(4744005)(1076003)(66946007)(66556008)(8936002)(44832011)(16526019)(81156014)(36756003)(6916009)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6606; H:VE1PR04MB6368.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V+xj9L5nnIw8rEtHSHJKCEqveZgRCtZybXzu+qu4+opuHqcXIx846HZr262aMq2IOx467ufCO0YIAZnmbkcZLw5Y/VGQYSZTMsTfRFKU7wGrCfZl076PkaI8b39mCswK/uEf/hpXir+htb4HWty6cChghn9gOkpP8r6oJ/ZHvbi/S2AxuJC0sWLrB6SJa4Tnu3Xp6pCp1Qa4oakRlrhxwknnFndKJVm5b94K6QS5kJsptV5sF/YsDVmOoXoebuizEqittfYHiRth/6OC81zAbQ/I76IdPS+CwGbderObbpiS0WJMaYjMU9wx9WHDiorw1LC/meoBgkrqozYsR4LXuoEQfRIxZ22ok/zRdT9BRJuul6/gokCDSHQG/eurijxfvrNdIup00uv7Lo2hNG3kSbfgY+C79zwAsmfwWAkwSiwCEMqVpttfBvkTsnzNrh3K X-MS-Exchange-AntiSpam-MessageData: h1+GSXOArFDnRO3CtqxoM/8r3GmK2nDlXJJN4OMW41vFwhP+9EXoDT1YX7+3A64t61SdUWhfHviCQUTZJdvE7qfpDQrPLK1E4rn8h0KOSUhNDeiKziXQuHwHiGGbYAam2bDBADMJeMjxt2Qw6E2Xdw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1dab7409-47bf-442a-ca24-08d7c94e14b6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2020 02:02:29.1138 (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: tHqVg+yAHyNAiC1F4T751drYqtz+m+BRUd4/7uja8WvRdEdYv2FFI0vhkx01AwZa1GvE+hX2Zvw+olsFXdIoig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6606 Subject: [FFmpeg-devel] [PATCH] avcodec/v4l2_buffers: don't prevent enqueue capture buffer to driver 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" X-TUID: x65uu837ip/q Content-Length: 1674 the draining is set when the output port is finished, but it doesn't mean the capture port is finished. especially for decoder, there may be a stream buffer to store several frames. so the decoder still need capture buffer even if the draining is set. Signed-off-by: Ming Qian --- libavcodec/v4l2_buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c index dc1b9eaf24..02f23d954b 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -222,7 +222,7 @@ static void v4l2_free_buffer(void *opaque, uint8_t *unused) if (!atomic_load(&s->refcount)) sem_post(&s->refsync); } else { - if (s->draining) { + if (s->draining && V4L2_TYPE_IS_OUTPUT(avbuf->context->type)) { /* no need to queue more buffers to the driver */ avbuf->status = V4L2BUF_AVAILABLE; }