From patchwork Sun Aug 15 09:55:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29526 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1104124iov; Sun, 15 Aug 2021 02:56:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaS5HW5ckP2dHhHCpaZOdoPIA49nqq1ToEUpFNzFVDTRGEztC0w2tTic/QanBVlDyx77Zb X-Received: by 2002:a17:906:3157:: with SMTP id e23mr11090320eje.29.1629021396597; Sun, 15 Aug 2021 02:56:36 -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 l20si7064665edw.100.2021.08.15.02.56.36; Sun, 15 Aug 2021 02:56:36 -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=@outlook.com header.s=selector1 header.b=jSKTC8Oz; 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=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63304689B43; Sun, 15 Aug 2021 12:56:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067105.outbound.protection.outlook.com [40.92.67.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC61C689963 for ; Sun, 15 Aug 2021 12:56:15 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d55TgIITOv7sXWahgPdWBp3efK6f9vfg7ykODMCgOuJREO3vbMLJ8dgEMQa0hD8M2BiGwrmR0ogjUGJbD9NZ8B9SV4IfjUmfuuW6Y79s/lxQT92/stwIWCt36SR6tZiK9gLExnHrdhVod+cTj7Oue4a4utiXhNEioxWxEK3RTXDUy14Y0auaBDYffTx2rCCVS4S1s6D2yG+BPg9PCXNjwd1O7V0yfSt1gLnh/cQ7m336uSAKqYZQS3uSq3QmWy1NdCD4Sp1HlhS+pycpHrv4iz4LIrFwIO0b0pmq9uB+7d+g1J6rq2zk3XLxu1Z7yFRFVPZBSEzkNGjx9eujVBzppA== 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=KN8IY+hv6os/t6OoL7kKI74JEHidhC7GAh/fF1L80Lo=; b=d/0Zh8db8B+P0FjPgokei1B2mTT3gRyc6osWFHdSK63zoaY9QbaBgOZMD05zZMM6ajPs6fpZ4eat3DKXxA4RRtwtd9wumTJrFxbSx+mxqlGI9H962QNCOQVCjdKteZw5JOKdvFjYdpRaqbKHbUuvJHC5z6h+bKIbTxZjXO+S9bGXObvHUwe1uRlLu5zS1Qnv6DoCe6fT4Dj+VUbpomJUmujWj9ZswYfMc3YkM8+CNqWuuF389xUDKIURuGsNr4bGldjIvU0Pu0V46wavfmWA4C6OZb2fNsKkb4A/S2y3Xe2SaTu1N0+sb/O3OaawoHaMVxi28q/G8BuF7Bdd7sTtSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KN8IY+hv6os/t6OoL7kKI74JEHidhC7GAh/fF1L80Lo=; b=jSKTC8OzctFYrnzIPtEWHyf7UJ7x3IadwWKC+F25zJXrlpdxTM0blm6HFB7WvAa9yg/NyCEFbocfXWdWSA/k0h7EJw0xRQnfLIkutlF4FMTMet2LGIOPblKxaYmwEyGeBNghlaWcpS/+3dYAtIBXNikaZN5/XNuIlQwGIR6BUpBce3AViV/DAkQvpsM72EPpXMCCKjnBmOYEN6Ftm69aFpFOoyGr6jRtxbvo9mlByUlo1n5ly3vymuBgPwDJEUzCd0QzTDiq48Y1lGJwKOxNloYUS64H5NYkZnlnBloQk93UzZAIQNLxChhGH+ly4UqhgFWuxS3ccOa6tpC+hl2mdw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5542.eurprd03.prod.outlook.com (2603:10a6:20b:f8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Sun, 15 Aug 2021 09:56:07 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ded:bace:bc7:e91d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ded:bace:bc7:e91d%3]) with mapi id 15.20.4415.022; Sun, 15 Aug 2021 09:56:07 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 15 Aug 2021 11:55:34 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [aRJZNLbHfHCqROOmHe3yUHO4hAu7GrXi] X-ClientProxiedBy: AM4PR0202CA0005.eurprd02.prod.outlook.com (2603:10a6:200:89::15) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210815095538.2116202-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM4PR0202CA0005.eurprd02.prod.outlook.com (2603:10a6:200:89::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Sun, 15 Aug 2021 09:56:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 678972b0-ba19-49e4-807e-08d95fd2e71c X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UIMhWUD35g0FxUDNN6JTWbE4v7CYgaqzJvKhnHNdncXypiKoYaQrh1lnVR2CTF8BO2y/bnkMvY0ffefEt9PmHF9DPJNiKfVNknvYhY0OoYzjb0H2lgJ3PgCyRYnuJVa7JGrpNsHvttIaWh+HCjoDpc8JJGf/iZKKGr6LNQLNokyyihLY9fNWXHm1w4NvyvCfsnhP428SPGW4ZJDAnMmYQ6GgXCY1kHxcxXYnuSsjRoLtiCFmWSoA0B3QCT2RBDytroSeCkL5l7U3k9jevfnaq19DfznDZT8JMPWLM6w/jxm/dDTaLwkh9DdJXXnZIMvMsMGdP3KpZ43b4LVESEGEzKeAQ+HBeihgQ3Ik9QKg+EriYyHegQUMS2KiWK5b7MzK+mVeNn3MiW4H+2KCAjRXEz+WF8AkOzjUs3kE0EH+XEwv/XSB3eYJiGF0k3nK2FFf+84lmzMCiYWdP/nKHERgz9N6hdsBhS1Xbx8bMftC7yIVf8wTrkV+ZA70w6KcCVeeTxE/nAP1NGraVS+n2rzaZ04+FExnBZ5QR+WPnxgRUuaAMdFCb4akJx4QYwgY3/G4LU3uTKuzXzU+wftpRP9/7/wq7FmPe7rtdtNX56JVs39i910WpYthXvFUneaRUQDEmDOrBjnuiVGrXg8haJi/vNKBolII+NFqnKbICt0TGWKj5cyPbNdD+RArwSshsfgwYoA1NjQmlOH3A== X-MS-TrafficTypeDiagnostic: AM6PR03MB5542: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SacQKcp7/oA+nPmOcSZGtZ+mIs/p6NcVFe0NVDW0GLRKEptYjnzWNX2E0DVnSPKsD1Ing0Z3dN4NJeggpAam1DCczt420EqMSuX1GCLCwRVZ/72GMx8354CGbQ0vWPNT6xGGFH+xhzcHDK2y00j4Gy1pRmIAojYTX3Cd3OoRm41giVbtI2IG6++IrzeTyct1xw40dUlopjVz9TAuEuuPoba1Y+MZXMsYse30r++vANrbvT+RJZGUI6JyJDesN6M3n+Uv0kJrIXDB8PCQCbP6hfqdXcddxhD6FCxRxXH0igol5K1zXn2SlCmvpfzRG3+vm4qu3ZjGT3Uuhzlq8w/OAFD7DpDhwN3fmnRdDG233nogj8JlO7UDROQIn3p+f9ZV7OHPhj/u/Mz9WslLVQ2rTr1ElINbcJ8qLs97KOX1wkFT+Vx5grHL5hTRPsJN5RIB X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cyHjshCI8SfWhdfgy3zC0Y2ttuh+MQA1LCm4yo7Sq0MpId0P13nPOJS22EvU+eMCMlVllEEhZ51qpzh4Vk/lyAfM0CIk+FlEQJplCplJ/R4Mz+L1t4xePH+PHS5qZHPV4TFgV6L8j2fG5BaSCuapzg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 678972b0-ba19-49e4-807e-08d95fd2e71c X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2021 09:56:07.6713 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5542 Subject: [FFmpeg-devel] [PATCH 06/10] avfilter/vf_coreimage: Simplify query_formats X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UmLw0guTGO0a Using ff_set_common_formats_from_list() avoids using different functions depending upon how many inputs the filter has. Signed-off-by: Andreas Rheinhardt --- Untested as I don't have a mac. libavfilter/vf_coreimage.m | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/libavfilter/vf_coreimage.m b/libavfilter/vf_coreimage.m index 2d74c0f5ce..80a7e33847 100644 --- a/libavfilter/vf_coreimage.m +++ b/libavfilter/vf_coreimage.m @@ -142,40 +142,7 @@ static int query_formats(AVFilterContext *fctx) AV_PIX_FMT_NONE }; - AVFilterFormats *inout_formats; - int ret; - - if (!(inout_formats = ff_make_format_list(inout_fmts_rgb))) { - return AVERROR(ENOMEM); - } - - if ((ret = ff_formats_ref(inout_formats, &fctx->inputs[0]->outcfg.formats)) < 0 || - (ret = ff_formats_ref(inout_formats, &fctx->outputs[0]->incfg.formats)) < 0) { - return ret; - } - - return 0; -} - -static int query_formats_src(AVFilterContext *fctx) -{ - static const enum AVPixelFormat inout_fmts_rgb[] = { - AV_PIX_FMT_ARGB, - AV_PIX_FMT_NONE - }; - - AVFilterFormats *inout_formats; - int ret; - - if (!(inout_formats = ff_make_format_list(inout_fmts_rgb))) { - return AVERROR(ENOMEM); - } - - if ((ret = ff_formats_ref(inout_formats, &fctx->outputs[0]->incfg.formats)) < 0) { - return ret; - } - - return 0; + return ff_set_common_formats_from_list(fctx, inout_fmts_rgb); } static int apply_filter(CoreImageContext *ctx, AVFilterLink *link, AVFrame *frame) @@ -683,5 +650,5 @@ const AVFilter ff_vsrc_coreimagesrc = { .priv_class = &coreimagesrc_class, .inputs = NULL, FF_FILTER_OUTPUTS(vsrc_coreimagesrc_outputs), - .query_formats = query_formats_src, + .query_formats = query_formats, };