From patchwork Mon Sep 13 22:52:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30220 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4445689iov; Mon, 13 Sep 2021 15:53:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd6HNtkDK5k3d+ujdgX3k23pSMfXcJZqdMyOAv73HmiL62QGjHOahLwg4UMB4Ye+by8jgY X-Received: by 2002:a05:6402:386:: with SMTP id o6mr10252874edv.110.1631573605405; Mon, 13 Sep 2021 15:53:25 -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 hd10si8732112ejc.687.2021.09.13.15.53.24; Mon, 13 Sep 2021 15:53:25 -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=Z92XaZPJ; 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 0AB7168AE7C; Tue, 14 Sep 2021 01:53:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2033.outbound.protection.outlook.com [40.92.89.33]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2348368A903 for ; Tue, 14 Sep 2021 01:53:13 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SN4UMtMMbRWmspuFFNoWt5jnyTgPb3G4xOM6A17CKsUeDFS2FVC8RJiwSRRjBD86nYXwVV2Wt4FEyGcQwV5M0bQR6TArgdkiAih7WkaG0oGTGNGslAN5OaXhVxbM2bAyFoqgAOLyZLuBT/CRUkTiyfCBS9peXxQHL0VRk2Z7ci2HMmIfXghPqN25k9U5UEqy8B5gojfTW2u+nRczLWa+A4BWCydzkvAtrhPPE8pAU4A3sTlBEzeJLToKEtC/4K+2FGmPc8HGio4j7BpZuhVxe0/XY7PKjuaYTq7J88Ms/MTWu4B5f7QMfXeu8diojhfRUnB0ZRXzsNt1DQsAmTINWg== 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=Y0EJqKh3GKMQ5JG9hDkyZWR7mcd3Z6Ul1lE1hy4kQhc=; b=FgUtrO9jyZUFPDLPUcTtwvxkS4z2tmigbIqM4bjEeBpONtDtc6O4HlJt4BCEVpHYx0Am48/dbsCXZ8xXy8aWM/s8GIIiNd9H8k+UP2syKQSs5n1ASvtNo/a2W55yfBDylkTYh1EfPRy7wKtVw5+QUu4RBYUcnUcC/VVKDES3nktVFsgQ7vAwQDuLJjLodHltDtDS7tcaIIDiH+xoYfBaN8yZmFdWdJ6q0fPtmCOpma/08e4HL5Pd8uerV8IKLBmmOz0g9uX+hZXrAhG4E3NUNvvLOsdUnAai4e76IRQaQyf9KFFlim0LUUiKgD4oMttN1uRcw2h9yAfsCmzeDjjxDg== 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=Y0EJqKh3GKMQ5JG9hDkyZWR7mcd3Z6Ul1lE1hy4kQhc=; b=Z92XaZPJ7m7fh//DZZefPqmC5GGREQ/ESJBoCfcSoI79frbgcj5lg2OrIzLs/azMAb/7r6sgjWjY5OIQi7f1F3QHm4RugOKRmwcBIy3/UMCsYJ5dg3yBh7QSFKbb+vl8o/npiELOTM+0VPu3t0pniQtcFyZL6UVAUEyd4r32Sg0oqoM+AmuAR5IYLHGUlEgDrwzwdZFwVNTWIotHeIrZZSJtFUPZlS98MOkqEzhyOIVJbsUuQuO+wns0/KYzZanNvoJYjJSXGbgtJ0dAzJJeDi1aWA9HRzLz8UdL4DU1wlj+Uae9Fb/0me0O0DgjXtyP4rMp20Bt1bEzv17NQ2bBZA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB6984.eurprd03.prod.outlook.com (2603:10a6:20b:29e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Mon, 13 Sep 2021 22:53:12 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::787b:2156:ca99:fe00]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::787b:2156:ca99:fe00%4]) with mapi id 15.20.4500.019; Mon, 13 Sep 2021 22:53:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Sep 2021 00:52:38 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 X-TMN: [y85NcRFWHd/QLH+eS8yffHbqyLJDSQ+k] X-ClientProxiedBy: PR3P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:50::14) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210913225251.3115448-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by PR3P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:50::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 22:53:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39ebb8ba-ec2a-4a5f-37bb-08d9770941e6 X-MS-Exchange-SLBlob-MailProps: f36zkjAOy3V/TtV3mrfogUCq4JsxaBxF0bAmHOlmyRPtix0nybQdKYM2WrNdZMr5P0Zbbp8v6UGLxUPb0Div7FWm0s4tolfVVZaRxATVhAq1qrr8+POwhCahKsGhw1IIsZtzeGoCJM1l/xpQ1yQIujZfwcxRHtr4i1L/GEgN8tPVXulIA05wawsDXHR/Zbr1YaOJqcK3v4qK5oDe2DpXPp72hvLIRGlQc6HCOmPDJ7bPYXH3xe0Bi8AMnB3DKi6bBTecgTO2wGF34nYMqKthdx8QI9QTXDwRfTBge/8Dnzxl1LLtz5SZqGaEHoqwx918/ouJyF+XwiQ/ebeBrlviEd0R3DfSq7Q+K3WiWNIYWWQCNxXCUMsFEa5gOMM5SvoiDVKMAeGsVbdErz+AM56RcNo6vh7oRnegO29kGM1y+ffTR1C5z2IwrdlXZgPg3zpVeUDJvwbNHJEU0p0aT/hqC01b0d2CoTxXgNhoYsLqtMF9sNtz+U5/6HSjjqd5INMYpF+Aag5N+PR26UCw7ug+OJFyJt4tdTZIKtXGaWEZKBSlv4mqiddpq0k7r5vftXoX7iVZcKx/tpkuN4GX2+3xLjANutcDvgZaxmg+0b1FlhSz7TrwbTRDish/ojsAdKZhUlK62hCh2iv9qlreFY9hi9f+J6obbE8P299ToqCNRD4Dl19S1V4F25xW1SvuKW8UyN21GnvRyE36v2UWxblR8OQZflWYbhWKNei6FZnbffM= X-MS-TrafficTypeDiagnostic: AS8PR03MB6984: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VFNElXlybtaFS/M5hBRxkfuuEe78aDv7bNDonpQAbMXD4PZY1P2LH+JC5KA4CMYI45ycaToBDKhBiVKKNewLBxcOLkqrFI90xgI/d+L9hnDN3VfbeuAExt/iYg3d9azcJc/wXuoE+E2atSkVzR2I28TYHmDwSjfxqdrlZ11TF+cwhEngWcPbI0fuFC5VyDLoEuuMuRROcWBqVCxi2NUv1DmWJSu3DBOaad9YVDDhTQZGwd1TWzj/ThfM3NVv2I5LmSUTnW5OAPABmIA5tn0GldjDEzTWlMZ00zk1KzrFMLz8oA8J7BpRWSXIJJyzMPQ2ScODO/A17vmlUFkTN9sqOmShDX3Qfi3byrjvdGj6i38db+vSq3JkbN7natN+aCv6+u2XWySf1YXhlWe259TMtXKQjnopZw3ceybb1ePNe47Uikpd2HUG8iuvUIzwGs+xKDNlscj2NVQ0hY94B7qA6WJ9UiBJD4Dr8DFTyjR/1oo= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6VOUD/qswHf7zNc6dv8M8+bwi7yA6uAw6eZorOKr0omDsiSd3LWc2pvBitVc7XBydBFOJGsqfyi0cUKsXp9N5wI54z/yC3gDUzbKYhcLKMjq3lR9D12/a6r3yoVZgYbt3jKNDWWo8oVTJEZHi4B/ng== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39ebb8ba-ec2a-4a5f-37bb-08d9770941e6 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 22:53:12.1511 (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: AS8PR03MB6984 Subject: [FFmpeg-devel] [PATCH v2 01/14] avfilter/vsrc_testsrc: Deduplicate AVClasses 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: 68tLmGsfyEe6 Signed-off-by: Andreas Rheinhardt --- I am not resending all the deduplication patches; they can be e.g. found here: https://github.com/mkver/FFmpeg/commits/avfilter_deduplication libavfilter/vsrc_testsrc.c | 47 +++++++++++++------------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 646e8257aa..414950c442 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -409,10 +409,9 @@ const AVFilter ff_vsrc_haldclutsrc = { }; #endif /* CONFIG_HALDCLUTSRC_FILTER */ -#if CONFIG_NULLSRC_FILTER +AVFILTER_DEFINE_CLASS_EXT(nullsrc_yuvtestsrc, "nullsrc/yuvtestsrc", options); -#define nullsrc_options options -AVFILTER_DEFINE_CLASS(nullsrc); +#if CONFIG_NULLSRC_FILTER static void nullsrc_fill_picture(AVFilterContext *ctx, AVFrame *picref) { } @@ -435,11 +434,11 @@ static const AVFilterPad nullsrc_outputs[] = { const AVFilter ff_vsrc_nullsrc = { .name = "nullsrc", .description = NULL_IF_CONFIG_SMALL("Null video source, return unprocessed video frames."), + .priv_class = &nullsrc_yuvtestsrc_class, .init = nullsrc_init, .uninit = uninit, .activate = activate, .priv_size = sizeof(TestSourceContext), - .priv_class = &nullsrc_class, .inputs = NULL, FILTER_OUTPUTS(nullsrc_outputs), }; @@ -1124,9 +1123,6 @@ const AVFilter ff_vsrc_rgbtestsrc = { #if CONFIG_YUVTESTSRC_FILTER -#define yuvtestsrc_options options -AVFILTER_DEFINE_CLASS(yuvtestsrc); - static void yuvtest_fill_picture8(AVFilterContext *ctx, AVFrame *frame) { int x, y, w = frame->width, h = frame->height / 3; @@ -1283,7 +1279,7 @@ const AVFilter ff_vsrc_yuvtestsrc = { .name = "yuvtestsrc", .description = NULL_IF_CONFIG_SMALL("Generate YUV test pattern."), .priv_size = sizeof(TestSourceContext), - .priv_class = &yuvtestsrc_class, + .priv_class = &nullsrc_yuvtestsrc_class, .init = yuvtest_init, .uninit = uninit, .query_formats = yuvtest_query_formats, @@ -1418,10 +1414,9 @@ static const AVFilterPad smptebars_outputs[] = { }, }; -#if CONFIG_PAL75BARS_FILTER +AVFILTER_DEFINE_CLASS_EXT(palbars, "pal(75|100)bars", options); -#define pal75bars_options options -AVFILTER_DEFINE_CLASS(pal75bars); +#if CONFIG_PAL75BARS_FILTER static void pal75bars_fill_picture(AVFilterContext *ctx, AVFrame *picref) { @@ -1455,8 +1450,8 @@ static av_cold int pal75bars_init(AVFilterContext *ctx) const AVFilter ff_vsrc_pal75bars = { .name = "pal75bars", .description = NULL_IF_CONFIG_SMALL("Generate PAL 75% color bars."), + .priv_class = &palbars_class, .priv_size = sizeof(TestSourceContext), - .priv_class = &pal75bars_class, .init = pal75bars_init, .uninit = uninit, .query_formats = smptebars_query_formats, @@ -1469,9 +1464,6 @@ const AVFilter ff_vsrc_pal75bars = { #if CONFIG_PAL100BARS_FILTER -#define pal100bars_options options -AVFILTER_DEFINE_CLASS(pal100bars); - static void pal100bars_fill_picture(AVFilterContext *ctx, AVFrame *picref) { TestSourceContext *test = ctx->priv; @@ -1502,8 +1494,8 @@ static av_cold int pal100bars_init(AVFilterContext *ctx) const AVFilter ff_vsrc_pal100bars = { .name = "pal100bars", .description = NULL_IF_CONFIG_SMALL("Generate PAL 100% color bars."), + .priv_class = &palbars_class, .priv_size = sizeof(TestSourceContext), - .priv_class = &pal100bars_class, .init = pal100bars_init, .uninit = uninit, .query_formats = smptebars_query_formats, @@ -1514,10 +1506,9 @@ const AVFilter ff_vsrc_pal100bars = { #endif /* CONFIG_PAL100BARS_FILTER */ -#if CONFIG_SMPTEBARS_FILTER +AVFILTER_DEFINE_CLASS_EXT(smptebars, "smpte(hd)bars", options); -#define smptebars_options options -AVFILTER_DEFINE_CLASS(smptebars); +#if CONFIG_SMPTEBARS_FILTER static void smptebars_fill_picture(AVFilterContext *ctx, AVFrame *picref) { @@ -1584,9 +1575,6 @@ const AVFilter ff_vsrc_smptebars = { #if CONFIG_SMPTEHDBARS_FILTER -#define smptehdbars_options options -AVFILTER_DEFINE_CLASS(smptehdbars); - static void smptehdbars_fill_picture(AVFilterContext *ctx, AVFrame *picref) { TestSourceContext *test = ctx->priv; @@ -1676,8 +1664,8 @@ static av_cold int smptehdbars_init(AVFilterContext *ctx) const AVFilter ff_vsrc_smptehdbars = { .name = "smptehdbars", .description = NULL_IF_CONFIG_SMALL("Generate SMPTE HD color bars."), + .priv_class = &smptebars_class, .priv_size = sizeof(TestSourceContext), - .priv_class = &smptehdbars_class, .init = smptehdbars_init, .uninit = uninit, .query_formats = smptebars_query_formats, @@ -1689,10 +1677,10 @@ const AVFilter ff_vsrc_smptehdbars = { #endif /* CONFIG_SMPTEHDBARS_FILTER */ #endif /* CONFIG_SMPTEBARS_FILTER || CONFIG_SMPTEHDBARS_FILTER */ -#if CONFIG_ALLYUV_FILTER +AVFILTER_DEFINE_CLASS_EXT(allyuv_allrgb, "allyuv/allrgb", + &options[NOSIZE_OPTIONS_OFFSET]); -#define allyuv_options &options[NOSIZE_OPTIONS_OFFSET] -AVFILTER_DEFINE_CLASS(allyuv); +#if CONFIG_ALLYUV_FILTER static void allyuv_fill_picture(AVFilterContext *ctx, AVFrame *frame) { @@ -1751,7 +1739,7 @@ const AVFilter ff_vsrc_allyuv = { .name = "allyuv", .description = NULL_IF_CONFIG_SMALL("Generate all yuv colors."), .priv_size = sizeof(TestSourceContext), - .priv_class = &allyuv_class, + .priv_class = &allyuv_allrgb_class, .init = allyuv_init, .uninit = uninit, .query_formats = allyuv_query_formats, @@ -1764,9 +1752,6 @@ const AVFilter ff_vsrc_allyuv = { #if CONFIG_ALLRGB_FILTER -#define allrgb_options &options[NOSIZE_OPTIONS_OFFSET] -AVFILTER_DEFINE_CLASS(allrgb); - static void allrgb_fill_picture(AVFilterContext *ctx, AVFrame *frame) { unsigned x, y; @@ -1824,7 +1809,7 @@ const AVFilter ff_vsrc_allrgb = { .name = "allrgb", .description = NULL_IF_CONFIG_SMALL("Generate all RGB colors."), .priv_size = sizeof(TestSourceContext), - .priv_class = &allrgb_class, + .priv_class = &allyuv_allrgb_class, .init = allrgb_init, .uninit = uninit, .query_formats = allrgb_query_formats,