From patchwork Thu Sep 30 13:39:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30742 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp691672iob; Thu, 30 Sep 2021 06:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyqcH4keC2PBUe7MhvDgk8BD90Ll0SxE1MpCxNWvtWmmtBtoNFbCqWJFe3yWUyUKxvle/R X-Received: by 2002:a17:906:469a:: with SMTP id a26mr7053208ejr.38.1633009929822; Thu, 30 Sep 2021 06:52:09 -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 s12si3369265ejc.488.2021.09.30.06.52.09; Thu, 30 Sep 2021 06:52:09 -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=TAT8auG6; 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 ED7FF68AD12; Thu, 30 Sep 2021 16:45:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074095.outbound.protection.outlook.com [40.92.74.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 64F8568ACFD for ; Thu, 30 Sep 2021 16:45:49 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMUtz0hTDCvYCGRezhd0ZVlU6I2bdQh7Y/SwmEeVCABtL+4UJomHgh7qIwBx+HlMqqt2rNcAqHEMYNt93t4BfPpJL9OdXtG3Qo17LNnhaWRtqkxpCi7iso0hi/NqeSr0BrDnvxmB3+639oAG3jxzx6e+O5xfBpON+qhedbrnfUa/ep/L+Fwg5IZwwC7zL9R/yJVNFW7m0BmHjcSJ2xlfGBERsVRYbgxSLfaMtoJjftY5+W3dFXzQ/rTklSzQp3IwZES7pqrsJe6mpXBXDIj7RgujOFx6lOLL10Nr77IQt/RgRKVL8ZSEWN/yWsuBz/i/R9iVJv1E2O2EZR00Ik446w== 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; bh=PV/tqLXjHBx68u9m5XrRMUVdmrRgyY0VEzlMz3l3jmI=; b=UGSFh3rZCxURG5o4XJUO/McxhQwrJkSSf+pcLB0KXmTVPXNvx/gVO+9pVvsFIgtYV9JwoNLiBe+BT+lolBCzvGpxz+IeDCzk7fe/n4p1NxXyhYF2sqKKg8Tl2cj2RONcR3NosazuoSHho4sYGIeh6vIMvSicRDB68+rZi9Dp80lrjBGxzGBUAmkp+bVG4ie5Xs18ltufPU9rLI7Ndi5vRwOPTrqInpBVFmxPqaZbe491HvxcsJSDhTuvQCes8Vf9OAjG+yBNHlPD/aZ3g8DDHuPCq4Gru99uDd7y2vb6BNPrTxnK3Te6SHDOf4Tkfhcw6t6K9aJ8nb+fN2exqZaQ8Q== 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=PV/tqLXjHBx68u9m5XrRMUVdmrRgyY0VEzlMz3l3jmI=; b=TAT8auG6kV0sKGHrXUYDJcFAwhvJqDdcwlk5QBZ7jzDAN0ooWzzUNegm9UpEb10Y1sQ5jKMlpC1XbKOTGjJfXCmJdbHswIX7oVBhVJO8B97EiR6sTh70LWB5SIvErCIoYZqVhF75+AEjBAUV0HKSXRlF1nnjrX3sD1MoDQeWIWxfoEiyhtCn381DUk/vm8kh//wDShGi6yZmW+ztzqcxmEJ5AENCSq9JMoeybO4O6k1zQW4lvVi5B8PKTIwzxrLEd4k2Dno8G8jqhALph4fxc5hdjifqhPg5Z0dszCDsdnj9sparK0NdU6eRsEziR4WoMOAZ0Pu8x4y1zwOk+wqpWg== Received: from PR3PR03MB6665.eurprd03.prod.outlook.com (2603:10a6:102:7d::6) by PR2PR03MB5163.eurprd03.prod.outlook.com (2603:10a6:101:21::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Thu, 30 Sep 2021 13:45:48 +0000 Received: from PR3PR03MB6665.eurprd03.prod.outlook.com ([fe80::15d4:ff2d:e607:cf68]) by PR3PR03MB6665.eurprd03.prod.outlook.com ([fe80::15d4:ff2d:e607:cf68%3]) with mapi id 15.20.4566.015; Thu, 30 Sep 2021 13:45:48 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Sep 2021 15:39:47 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [ppzTX58uLRgtiBYh/6FIeDRpWTdJsEM9] X-ClientProxiedBy: AS9PR06CA0306.eurprd06.prod.outlook.com (2603:10a6:20b:45b::15) To PR3PR03MB6665.eurprd03.prod.outlook.com (2603:10a6:102:7d::6) X-Microsoft-Original-Message-ID: <20210930134239.2672698-45-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AS9PR06CA0306.eurprd06.prod.outlook.com (2603:10a6:20b:45b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Thu, 30 Sep 2021 13:45:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdc3d3c6-5987-4b6c-7253-08d984189bd8 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVNZLmtPNeeDNv1jHth/FTeRC8IpstjpwUsIckYo5RPS9u2V/e1jLGirAX579WYhvkQYBziIlolqlkC/94R2jJw/u022QI/PkYCMSWLZmTzh+BjOz887dQ+Pkeq3Lt/2aG7bmJbIuaat3RR5womZQ9wgov9PmmS8bfbj0dpFRP4H4yt9CJI/4dr3Oc1QsUAh7zRWHkuj0Y0me7IAWyLzjOvtizC8qBeHia4I+Ha9pIbpfb5qlbU3iDYfEFAF3V/bwGth55F8+fbuIDXlE9DSxtTdjeaF2+ucEsy2Js+yN6HGoP0uIeaDNcS4kTyEspWvCbjG8bcikNZPCymUCoZM2OnMOKPkylZjILkZNJsUDnaKiHeP8F8Mhr0OgEuKiHAvznuwHfY6tx1AtBCNodAzuQxNz13OyC70faTRr2ekdK1mOwIkIoObd5jSCMrsfYdbmgh0UGH6G4vbAb9ZT3lRKPTXBh1NhXxHxYO26U6y1NrldsFxYUE+dT1IFjiARAW2/9gsBRxxDPt8F8XNvkY0MpBgjtpZMUWMH6BrvrQ0O/KH5h1WYBu6WPnmtp1xihw4anf76kGWFYjbNFWA2lf0YHWawZcoA/+rSHsLZNYo/49QiTWx3aIy8oK/0UVCLT7C2gnuLed1wPUSNIgULnarXDT5Q37bPBQAOMKn/Lm6fqhDgzssoyI5A8WYY90zQyGmOEFIKq6yfORa1TAcxtPTGS5fkcIDVWhj/U= X-MS-TrafficTypeDiagnostic: PR2PR03MB5163: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hn925lNqeK9LiAmK6qRUyg0P5RBlyINz0mwcug70342j0YxqRPg57eilifmUYOFAMwDXE5f0yMHUCTVmWGage0sVUWRJhLf4/fgNH8+Qb+VWSZDSqPJR5o5nHhR2oeLGQxGBfSXkx3KlaCKsLp6B4QgO9zYVu8zs0plURf1BcA63BCoiy5I3WM7nfxKLdbl6dTrFmr+AVv99wPPpszJoiFyaDj7oTnKGf5JFw5t9TDt5IAuuBAlizgcGmtypkSUP+Mb7tE8v1g5vZ0rgSC4KHUoV7jTbb4AnFe2K3EyMteCWoNEy39ar5GIlxElnzl1fpFRy3A9oNsqO9ORc9a9qO2/R+x2cZ7gEDSEnrBt7UsSuQWkjo/C8Gr5WgASFo6YUswb04mRnnTI2t9zxpVVBv/ErTkhiU0vDsgWwVe7YbbuHm8PlGgLNgTP9HZSrS3Z0 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wMaDzM5rEd4Tt4Ksjh/Uf3P9jv10kHkaWm1CKQwSt3hdYFppDlkOqWCbpHajXh0D2pUOaEN6w4BLFM4HXXdAK4E8mFxQ+u09DgE+EWDT1VCPVmEtJ+rJLitaIdmBEzL2PIf2uFuyfr1+lkXTyICMuQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdc3d3c6-5987-4b6c-7253-08d984189bd8 X-MS-Exchange-CrossTenant-AuthSource: PR3PR03MB6665.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 13:45:48.0899 (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: PR2PR03MB5163 Subject: [FFmpeg-devel] [PATCH 046/218] avfilter/af_silencedetect: Use formats list instead of query function 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: eEdrTCM5oz5n Signed-off-by: Andreas Rheinhardt --- libavfilter/af_silencedetect.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c index 482270d3f7..fa0884bee8 100644 --- a/libavfilter/af_silencedetect.c +++ b/libavfilter/af_silencedetect.c @@ -232,26 +232,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) return ff_filter_frame(inlink->dst->outputs[0], insamples); } -static int query_formats(AVFilterContext *ctx) -{ - static const enum AVSampleFormat sample_fmts[] = { - AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP, - AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, - AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P, - AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, - AV_SAMPLE_FMT_NONE - }; - int ret = ff_set_common_all_channel_counts(ctx); - if (ret < 0) - return ret; - - ret = ff_set_common_formats_from_list(ctx, sample_fmts); - if (ret < 0) - return ret; - - return ff_set_common_all_samplerates(ctx); -} - static av_cold void uninit(AVFilterContext *ctx) { SilenceDetectContext *s = ctx->priv; @@ -287,6 +267,9 @@ const AVFilter ff_af_silencedetect = { .uninit = uninit, FILTER_INPUTS(silencedetect_inputs), FILTER_OUTPUTS(silencedetect_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP, + AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, + AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P, + AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P), .priv_class = &silencedetect_class, };