From patchwork Thu Sep 30 13:39:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30715 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp684014iob; Thu, 30 Sep 2021 06:43:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSO2XIUvnFqZB2QjBBzTzYQeiUxUH1gVPMrOTII3uIQBrgwzkuu4L1wpJhPXJ1sXb3kbLx X-Received: by 2002:a17:906:3a58:: with SMTP id a24mr7072366ejf.67.1633009383827; Thu, 30 Sep 2021 06:43:03 -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 6si3308190ejk.125.2021.09.30.06.43.03; Thu, 30 Sep 2021 06:43:03 -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=rug1FiPe; 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 A946368A825; Thu, 30 Sep 2021 16:43:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069093.outbound.protection.outlook.com [40.92.69.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 12E0E6808CD for ; Thu, 30 Sep 2021 16:42:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CW0UyBiVoD0YgUJx1e9fiBhF6OTB5cTBjBza0dKBDVmWKLguulcRqkqpYWIOOcjCprZePYW/J40Z0ZA+f4ymHvxMusv/EbWYSrI0hWj68hp/CSzgnh8ybNpgKXrH9OAGPtt0VUCIGqD0yXipf3ksVREoVxhgWzMQf3Lxf4dYtfQyp9dtjsY3/1c2ZMLy+HSk6JlgJG2JQRmIFJnxFkFu2JikB/QLrGYLatcxypFR/5sz1OZH00SlrnZjh2UBFiTOrhuoFfmJNzALmmtZCqYwXd5IfRICrBhRX6kgHd0FhHWb6XWLJA40m5FjTPCMRSyEBH/8VZgW91wVQqB6kszyLA== 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=iwHWG0hKhKAB50/JnsW6MPtTSyQYMLXIIfH8vd0pqhk=; b=DEJZzzDdFokbkJ6if67bRBmPLfqgMHYl2R5mRbxpfpJYmRNIc9SVCYz2hFWJDBUhrZWlsCcsegU3VRYy5kHRprk0mWkhlkxZEBcxoxdN9gkS9tDMinj0tDgS/8OdUXDxM156ct1C0XihYupwovWqTKcDXcj/W0azt5f7RgDTeXeS7I9zXNwe9CJEPZQCBAeL4unRieX32Ky6fBwpV7d/BEa7e+TDPFT9SVUqts6ABRciHgS/6XjlmvRpJbpp5oVmP3Tk22+ewYO5HYPGPOPi2o/wH6pETrv6ouj6BpIyimxiDfSA/dfDQebi++9GuGft9z27jAjpitfYwc6xFLvd6A== 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=iwHWG0hKhKAB50/JnsW6MPtTSyQYMLXIIfH8vd0pqhk=; b=rug1FiPe4Mkbsz1Y5HuvBt73LYQVKjxBh55AzyxaKDmI/XvYahJjz67vQoucA9aqOXfqGdSnr4AtO8h9Mi6+ssWvpC0nrZc1jR/4Ek4XGidkz0qZSAFugjphp9HZXZMFJ0bTxQy+Sl50GOKei1BlbpZxpNtCQ1jpThmu0d+8Lrwl4aPE8RoCYRF5ZD69rvlPz1Puo9fOmdAZhdXeUMPCIldjjt2T+XC0cJ6jm6+9L5e9mTNIhgNyvBpzRJDDq95xWR6oZEsBZo+M828GmjJb/+0sIbUmPBGscXzRjCjH6Ysxtawt2v7eiQuTXz/C9NZWT3khWCagR8bXyBZY4v8Mdw== Received: from PR3PR03MB6665.eurprd03.prod.outlook.com (2603:10a6:102:7d::6) by PA4PR03MB6847.eurprd03.prod.outlook.com (2603:10a6:102:eb::5) 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:42:53 +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:42:53 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Sep 2021 15:39:04 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [BrTCDeA3H7fQmDyTu7TtvenmgjQO1tgK] 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-2-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:42:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7cfc826b-c45c-4501-6b9f-08d984183371 X-MS-Exchange-SLBlob-MailProps: +LiGfBxqLEuxeWGdH5xYgV96647felgByBpVHT46CClhiU9i62ZS6PtUBKQ961VOAeWdKEGsJE/dP/uEyE5QdpwHV3T3T6karHFnFEvkp4kVlyyEotPSzeUeN+Bz4ucDNCL6CIi2mz5DIUuKf7LO0ToapWXXPeuW4jYsmYlZWEuStTVzP+DuqlzUh+Myh5NG3QXrDVP/UrloUWXZgYFCnvZ5RzxlBSjQAfs+bNj3/y2crbAs9DW+CgEzpNeVyNOAjAzcoDcml9ZmZPwmugv5LJAFnG+W++YRmOT1RlB49+K5Xdg8vPGjsXRorX1fs0ahd47eInxD5xOR6P/28aKKYTnmBG/hgKicvlbmx1Rxyv2osfDxQQuhBIwoipUGl87wU+p6WrpveNo6tF8plTUpeu6T9zhXkB+fH+fAyt3lmfGVGus6ys8veGysL88E4stvT3uRwKVegGzPxHElMPtRty9joUJwz1VzIZvGueiGu8RV+/ZzyIQAc35laokSS7q6m4+HU6Cq+ZfmPkSrVX2szcZ+jRx9dT/Ck7DZ04jJBnuMJpRXOReB+tkUzLC7Yfo3P55veVnrEx2EpUuGFsQgrH6F8X97gAbcBn4lLiwQ611i+ev8hGaCDfzXfh0Xq4oQ8bV7NeDVuccK4GOziKs+pcDURefqDPXpGtP54PDVh3FIqkg+XBDIZ1ouJVidQbn1iatauKcbPUwZ/iQPGVCwu95Pi7FYXatMYRw0ojGyk8Kg2f0c5FnSATWxSSF8zEcMqafkCeNJwKI5d/AZ462oRQ/8goW89rfZ X-MS-TrafficTypeDiagnostic: PA4PR03MB6847: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /rLcxF1ga8RxLw9XJ2grt/3sj3/g2xoJoe3sxxSTTCHRMhH4i6X0J1RgUGjzIdRlvbEp6Z9+/Ns/opKhaqgrt0JNto2m8UlqsIrcLNJLoABrxJVsxz6AR/NIH53YnKdLxfQS1GUy8d5kI+yy+Vf5vSpTLpuEVup0VQpRfog8Ejme+vETdHq6UvJFxYMtWy5IIsKhZuGEiR837jFYhup5c+2a+Zmgb4nR1giDeke/PcyO5ZJWdoEBwtwOsazbm5DIv9fEkIEKqc9xREH4+L0z/O6jf6sw3HKBgG3aLlk1kZ08BGYrZ6tM/IMTFNIP7Xew7YncFMsPT0COxDbAp62Ix28ydfNYaFaPgDxpPOl2niChDEr4RuMN9z49bX9iiopzMQFObA9WMF7QJ14EAjcEMLZauZPGu9svaO1jQzo2T5a/LW/M8qF2LOSTT7kq3wpI X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pR+I6nX+k2pnqNFP6Bz8k5ujANFTgTau/mqGIBl09BUr55V5//fzpyklrXQjDIa0nXU9ykfs2FnIgbCHeSBdHX8Zb+hSVKTcuDUDRBpVQfB5B+AwIWZeMHl9/94GxVeptOUVzATDUtt/XyYOGtgm4A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cfc826b-c45c-4501-6b9f-08d984183371 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:42:52.9128 (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: PA4PR03MB6847 Subject: [FFmpeg-devel] [PATCH 003/218] avfilter/formats: Add function to create AVFilterFormats with one entry 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: EAU3yAzQMas2 Most instances ff_add_formats() actually only ever add one format; this function can be used to simplify those callers. Signed-off-by: Andreas Rheinhardt --- libavfilter/formats.c | 6 ++++++ libavfilter/formats.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 1d2a51c0af..d5b8fa8e50 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -430,6 +430,12 @@ int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout) return 0; } +AVFilterFormats *ff_make_format_from_entry(int fmt) +{ + int fmts[2] = { fmt, -1 }; + return ff_make_format_list(fmts); +} + AVFilterFormats *ff_all_formats(enum AVMediaType type) { AVFilterFormats *ret = NULL; diff --git a/libavfilter/formats.h b/libavfilter/formats.h index 42fe068765..e19625ae6d 100644 --- a/libavfilter/formats.h +++ b/libavfilter/formats.h @@ -208,6 +208,12 @@ int ff_default_query_formats(AVFilterContext *ctx); av_warn_unused_result AVFilterFormats *ff_make_format_list(const int *fmts); +/** + * Equivalent to ff_make_format_list({const int[]}{ fmt, -1 }) + */ +av_warn_unused_result +AVFilterFormats *ff_make_format_from_entry(int fmt); + /** * Add fmt to the list of media formats contained in *avff. * If *avff is NULL the function allocates the filter formats struct