From patchwork Thu Sep 30 13:39:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30694 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp686869iob; Thu, 30 Sep 2021 06:46:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD+heWK+QyV6WabEVjBaPHKrhHof57rBoK+E3F4ParV4N7nI/CyFYV1RYKIaMShqcVIn4s X-Received: by 2002:a17:906:3fc8:: with SMTP id k8mr6830916ejj.217.1633009590172; Thu, 30 Sep 2021 06:46:30 -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 ds3si4652904ejc.302.2021.09.30.06.46.29; Thu, 30 Sep 2021 06:46:30 -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=podKRouP; 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 22DA568A9CA; Thu, 30 Sep 2021 16:44:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-oln040092070063.outbound.protection.outlook.com [40.92.70.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D3F3068A9A8 for ; Thu, 30 Sep 2021 16:43:59 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVs+w64DrHL8YkL3rvtiVAzopj817KiIGKbMyZal8A67HtVpiSKiXDeYDwMzN4TJ29gXNevGU6eDXXgSNAlfxtzZ6whZWwZImhRtLv5q27bgS2EAAaTtTfyw63EnFdM5SxjSFgab5IzyN6EIbzd32LRoouk1oFk1jefrCCmrVaou9w9kz5EsM3IBXjrfXEklk+l+IPzH8FaQbL6XNi1TZ76qD+4wf8s/92+5huagUAo9rRtlo4cjI0rqDmSYf7RQgXjsmM1YAfT3Q7IhxnkfkN9ZSsIKekLK9n3bI+ESPfSbteZBtUVCxvKjYgunyRerSNNTqtY1Sl0wwXE+MMCBQQ== 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=2d49Wel5UqJOZwqGPYNRr2wpWDOuQNbfGvR5AvUzVYQ=; b=PG4TE+xHPmkb6/iDbhhlWLDEhUeUzFrZrrSwNxwp7mmnF+FM5Y4XvDtSozGelX2UXP/9DsTonxkCgfNxxpqZ398BqtRyUzBFYJvkpFF+wJ+bEOn//jDXIdYGtx3+xcPOPOpUBbidVOiyENPgDKblGKIGGqtn2yEDE8DaE3xTabWauOoYE7RA0RKB4SwfP91UNwCJt+DIICCUFQZraVvBFKTDbqrX5Jhc4fWZ3mZSXFLUDpBad+hLwLqSXM6JSXTpNloy0mRCLah0BwRdLJbltbcJg615kZAghCniWqaKXfusrjMObt305hNp6CCfUCZvggYgLT67toehDlWbanVVeA== 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=2d49Wel5UqJOZwqGPYNRr2wpWDOuQNbfGvR5AvUzVYQ=; b=podKRouPakg5omk9K8Mo1S76PToxvMHc09zFqNiyDInSb3UmjmUke3oNa79Knd8eZER+eiTRs01T95pqobnloJ0+yWMelAq3hOAXoUjKUqZvc3a8ImHzyR2rQZG1mivwre/9dLE+pwyRgFe/gXbws7UQcGnzvNOjBNcZl770f54nMoU5Om1Zhmzrf0PHtxk/uUJiThj3ay3ibp4d774dAcHyg9ecMoskLy9fnCS4xrljlhe5do000NxuOYa7cx3jBWUSMeHLwc/M/Ik3voLz27ZD4o93eD+hQYmIdR8P1rTk8biiyoD+a603AXC5I1jSphbRwlFbC5AWDa/Hq+T0hA== Received: from PR3PR03MB6665.eurprd03.prod.outlook.com (2603:10a6:102:7d::6) by PA4PR03MB7246.eurprd03.prod.outlook.com (2603:10a6:102:bc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Thu, 30 Sep 2021 13:43:58 +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:43:58 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Sep 2021 15:39:19 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [h2RAJ+6QI08nTabH3EMVWmnTGcc2AFdc] 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-17-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:43:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4dc47ee0-fae7-4d4a-acd9-08d984185a8c X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQEFGYb/YN4yvKEtCzw5Q2lK7Q8FL92qbNM4ubwW/IaMm+/51d+iCb3FwwXjUM+NpQFMmbBOg/8D+MDj/rM+2ZQnvGtKrFMibEJF/f9a8Voxyf6CcUVzHu/Z95vepOpX6tjoi3VNu4N+j0mauwECbHZ1QYqEkMmxkjibDp1vVY3JF9oI5FyrS+aJN0nwTKj0MAFh0SdtGwhiMknK66bmf7Gr45ZwznSpJhNii7KhtEW+0qhCmL+KmPYLbTQx2FoDBz+dyWfGEFB5+uPSZj7ssRHXZZviDxrLi+mVZkaKqom2Jcj8530blkgvRmxQevu4oHBhCwTWqdGGUCToj4li57ZjsCIhHw3ARzzBwTORHDVi+GXvJEuT6oUWZFPPsgIlZtMgbyns3qI5Z66xURvHpNPoBjSh5Rw5olOwL4pTekazf0+gZ7uJEzOT4odBraYw6N2PcYRyUPKQgW6WwYLUZcHp2rvYQsbaRhVstdEq8MJ0kX6mB/Ke0ywEaA2laEbsMMTySzsvPisxVls/SyrYy4AU1kDK8Oc08H4ZuM9JXPCyLcGkIqJnPzuO3vzyNHqwgQmqT2yrDM//hvDp0KjpUBpepEV9otcVIXkVhNmQo/cJkWIRJVM06LFPEghGlcMRNIM78Fa5qPL4z97wXC4bznQ0d7x/JXPCZ+H4DU2NTdcmZcazO00tqafR5YIq+sGlvPGwSsVMnSrhDl3DicBAwmpb2nRklBRiTPa+5mqRHcUIrLT/fRr93h8n6tM1ZRyRbk= X-MS-TrafficTypeDiagnostic: PA4PR03MB7246: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kAFcpRuAwMKn09KCqD/8q9lEtUvPqFZWHaxk9LsDtkhQsoNhCfEY/wze7bZXOI3NYImpgD+rlDjQ9LYkmuKuWtXHNtDJTqphcQDCXUNDPGzGHYxgzptT9quyD2nX4LgCDkCDMEbirpZKOvDRhMmZX7zTlOX/B+JnVy8LDCYDeT0LyiOTgDxUqDHi9ojlSD9CdxxKcZ9mWpqalcwgOxKTSNqVbA+JzPbQW7+l0AOPyEXnospuOplMvoTCKnu0QDMoXLRIs3ZKsgiozkvlOQx9dh0Ql0C/3EQf3lrFiPXgQzOu8UbhRXmOJadz3pc4C1+qSpZoiPISbQ5FPdI7QHZKBVv5mnB4oqQs0uI3XYZvYdCp8k3tNgZGuMm0bEPz53Gm0bsWEXBKNwkXfa56kyuxyyndfifYrEjtCwuzKos97tNGA3pJxyuRD9agDDi/69ET X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3VN8s7hOcKEM2PtRf35tP+CHIxb/ttExoEcmH6tDOBquuwZHspRgaJiGpac8uPoiwujROlF9Ts4cqdDYWOQnnla7zgXyObjnhYkn+WDH/YXKGLM+PdrPR0YD69Si98P+sj9PjGLFz05i3LGg7F5gFA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4dc47ee0-fae7-4d4a-acd9-08d984185a8c 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:43:58.5146 (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: PA4PR03MB7246 Subject: [FFmpeg-devel] [PATCH 018/218] avfilter/af_afreqshift: 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: 3Xkuw9XPFn3d Signed-off-by: Andreas Rheinhardt --- libavfilter/af_afreqshift.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/libavfilter/af_afreqshift.c b/libavfilter/af_afreqshift.c index 95fd4e31fc..731e97afef 100644 --- a/libavfilter/af_afreqshift.c +++ b/libavfilter/af_afreqshift.c @@ -49,23 +49,9 @@ typedef struct AFreqShift { AVFrame *in, AVFrame *out); } AFreqShift; -static int query_formats(AVFilterContext *ctx) -{ - static const enum AVSampleFormat sample_fmts[] = { - AV_SAMPLE_FMT_FLTP, - AV_SAMPLE_FMT_DBLP, - AV_SAMPLE_FMT_NONE - }; - int ret = ff_set_common_formats_from_list(ctx, sample_fmts); - if (ret < 0) - return ret; - - ret = ff_set_common_all_channel_counts(ctx); - if (ret < 0) - return ret; - - return ff_set_common_all_samplerates(ctx); -} +static const enum AVSampleFormat sample_fmts[] = { + AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE +}; #define PFILTER(name, type, sin, cos, cc) \ static void pfilter_channel_## name(AVFilterContext *ctx, \ @@ -393,7 +379,7 @@ const AVFilter ff_af_afreqshift = { .uninit = uninit, FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_SAMPLEFMTS_ARRAY(sample_fmts), .process_command = ff_filter_process_command, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, @@ -416,7 +402,7 @@ const AVFilter ff_af_aphaseshift = { .uninit = uninit, FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_SAMPLEFMTS_ARRAY(sample_fmts), .process_command = ff_filter_process_command, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,