From patchwork Mon Sep 26 00:24:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38319 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1946565pzh; Sun, 25 Sep 2022 17:35:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62YmkABMkHSU+E0sWyv5niEAdYin/GLBENZ+Wp5sWIi9sU7NcROHITX3d+Pp/lpxKVW1Gm X-Received: by 2002:a17:907:6d83:b0:783:a0e6:4f53 with SMTP id sb3-20020a1709076d8300b00783a0e64f53mr1127649ejc.768.1664152501132; Sun, 25 Sep 2022 17:35:01 -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 ds3-20020a170907724300b0073dbc331a40si2951616ejc.188.2022.09.25.17.35.00; Sun, 25 Sep 2022 17:35:01 -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=hHtrAepr; 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 A833668BAB6; Mon, 26 Sep 2022 03:34:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2086.outbound.protection.outlook.com [40.92.90.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3373568A6C2 for ; Mon, 26 Sep 2022 03:34:50 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jsqljUPogfRJ+WquI65GYPLMHca9EgSqB3tFtAeTamSn+HSsUw7x6pyLfYltinFy3P3XbGhE0Zif3b8EHE5/dcVAB8KpdezVpnvxeNwAhFiXg4P9uVSUilPOUeo0LzsY+0oUFfP4KckvT4wXfivveUMoqoPWE60+kzB13No3mTTwKfei8bh5Q8A8+mROOnYHx7nE8HXYdxazKD/g6k0JFPj4CgYpb2M6xW7m53sEMEI6z/Nh/2967B1UDGp4XXzAOSIyOH/LuIFWfFMMI2RtGypyFWnAJFYNVFTZcDjUywQfmwB2Gdpdmxa4yLq4Mak1EpVhGZz5B7EluWLrdCVdQQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NGWI/fCcaFddMMvoguiINxIYCeGsqxecWF5XxPpW/+I=; b=J1cZ1Lo3gCdAA49KoudisRMeX+szkKEIO3zZtU0PB+Tc3Lps06PA9T+yTldzQmVW5mfJTJgMT+ioyrA2ayU+YxsTzNv+wyLtSCpOFXfY50Wf9JmZR8vPjbB5pxLgXgz5rhASM3G13eS9MzLC7ScGERhbS1lPKRkRr6B/7S8iaBob9zl9ExpBiKTawTZEBRwH8FeHIxjIsSjvnXTaZDlT+e6PtDrYhoB9o0VosIAxqDaROOtS9oPRoc67aqSLsjQUsGm/49oxe1jT6SGxxoaLYTAyZopSohMfrSNNVLfeRTTOtyEPhyqTVL6AgX6jwu6dRHQ2+Vc2J9/AUPX0iYZsbA== 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=NGWI/fCcaFddMMvoguiINxIYCeGsqxecWF5XxPpW/+I=; b=hHtrAeprsNEaAQpItmHrW3mttwqw3FwmTkRiAntsh9BzqlVbUDNxCNqNrhtinarN8civ5Koj0zN0SN5z+U+d7qko5UyKqBvTW/0E0fTmIUj7tGvhpvxynebvK/ITZIzjgea7Bhr4pxgLFA+ogIFVbWxs0tgqkKBAVsExOcY+8gYis/ZVHMdSdb8rUrT7d1wcWBcssaI5oeosLiaPgZWtDGfBJPSKEnb56P5yHvdc4bg4shQ4GGpy4Y7SkiRaQvT6gB2TrVrsfPFj/hdnPXcXph0SBz4RJg50eSJeMIWgmvv6kEaH1+McSpWSEFzBTTLxf0xHb3b7PpBfFY907o0dog== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS4P250MB0751.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:577::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Mon, 26 Sep 2022 00:34:47 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::85ac:1b92:90f:dc18]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::85ac:1b92:90f:dc18%4]) with mapi id 15.20.5654.016; Mon, 26 Sep 2022 00:34:47 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 02:24:13 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [+aGMEw+hzHuAsybdFCcrwRleeO+1CY0FqliIEizOV8U=] X-ClientProxiedBy: ZR0P278CA0032.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::19) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220926002414.3076511-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS4P250MB0751:EE_ X-MS-Office365-Filtering-Correlation-Id: 430f629b-dc6e-4faf-db3f-08da9f56ea48 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKxLc5tmG8wxoWeNUlxOu28QBZ2iHQ/Y48jj62uXyE1XLbf28spYNjGTRRnDOp5w5XXUJvOfs6a6XCJ4xQRq/AcKTcZpGR6dO3HNi0nfsKdVj7/ykwYsipCQfAjUM5BkZF8OxkTUXAv4J1KP2SbguWjOE8tyKD+fwj8q0TrAETk2PSKbVm9BE0R8Ao6FeMcPee8DFmIk5QdOeUTrkxIwa6atzB/lJWWKktV9PFtBpQ8hudbi/sheHRevjbwGsCO8QTfKPgk+/l/cS74od1UVX0FNdaZ3h7fHp2jbejhdGLUOwEVaCU4kWLw5sLthb3nQ6kd2JLyVqPUhdWzo/MfJvvNJTy0ZfmExBNYE6Kzo80/or39S+lEG0kUREjCNJHaOcaYqEIeNREPwnIpgn2wh20xGZ45hG6jN3b2imSQPXWPFHnSe1YNr4UnU1hwKILXeCzihk5BmtaUXBtOp30F03ecJEoPoDG6eTEI3dxeHlth9NCr8RyKtQWE858Nonmyrk0egGTCbmlqX0d7KF0QscgTcDFWcB0+MT5gPs2o76/345DQlV2syquAEpiny+mD/nH1s2K/QbH20BC71uSWEfE4WY6rngcblc+NklMGMoJL77k6MVHWfVgoRq2RDWBMLdzHkayxRPnROBe1fiZp6znBpLuRQpMsKcp1vRliNYrTKozDvnNUIhTaYqlnyNv5yD0bWNosaX0Vy6pbARw2fi1ckTAsY2SS8lx8= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aVq8PkzxmByo1i+b2oRC2+K839xGJFhAeCPwhe+RbN/VL8gxzP2Q+h2lwAO2pS4MzXwgcVg/ZMGPQfCPWxX/gpjggP6GTkSiX/+aX+PR5pc+CTj1Q8d0wCW1hbmwPgM7jQJMR77OsdpksR1vCaiuhH3coNhiY3qUf85RiId2MGzz960+wSdOXkx1mY0ttRwdKqcYHEIe84+Wux4VFXaICTtxu/tM/RA+SB27mvhcT+qUIm4fAYsU6y7LGHiY5Xv6WFtGVBrN9+qPO751MfYID0rESNprvDMKXQIKXNkcPfbHYBvwwEy8ZpQOlQb3Aq3wSvhZTU9y1l2O+4BzP1Zp2Fe2SONrQ4h+/Xhb+tdpj5HCixTVvArIBOG+5v215Zk1pOMTkuY0Dby1gqirsP0wleABHcmMvevt/0yUpJqEKrKerOjt/srf4YWCDFiyHrvIWHM/v1pV4pC1HK0ZCJDX+7yzqqaiEFAP6+RjoW0B0Hq0n+ywauvkDAV9OI/TfG1u8y/q6jYczo6zkzfqNh+v+N8tt1+pFtOfvR1ssfyZ2L6qZoOYB5nHsn19OALr1Zl3uiEFMOfE4xU5dlZf4Zhmhv4gE3KfAsv0wfehPo/u/5pWsqxyC4vuQ9WU/8pMjvrr96NofygWfmrAF60G2MUjrQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Zb3w2Cb1QKV2lSLa93opTmwphBuV0IMfFVGnPnFuU/ZU+f4nNRhZWftM7Y7nNLoNVinobII6dwHvahOfDhfLTeS/iYBp1g0OfJougE0P7l+gCRr3dNXJ/sP5kvm1mnWotDs1X/u9LcJdKMOx9cRP3fnIFOLucvuaW/y6/Un/lSvIkGBG+vu6KLKZUbhU4VPvAn+emjEQA8j3YI8dk7gSIfmO7QZOYG2yAIF9jH5Ip6KL5DfRWKLYnNYwaENPo9CMdvs2E3dD2oAeSFril6QQjbarjbXGFRXbvfFyDXxz6HqOquwM6pWgdTj4dkWFB7kZW/AV/bncTLta3fEtGe1JGCKZE86TdjrRyDh98qT6XKhS5PKYsyR0MMUseU9WjJa0VcgWu3I17O/8/di+i16kNDOGJW2D561jMWZHIlozdhcmiNVE3Hu/yGtP0Tvnme90ibKqKunY0A8qFWBI+bMY0fnEhCvGCbVus0bvBmKuPPNns/MvklDgehN0iAwxtY7Sa1Qmb6LNckkEWJdILhYukv/Y7/bAgbC2U57qoUSltY1jAhcYOcZ+z5kLIhjXP/ZbUbqceISgmdi5yvtA2o5njmB5TKA4dFTyE978F7+1tv6faENfpdn79i0udRtmpecy+tjnLTrIj928iQm+toSK20lSE8IlA8SuqCWWHEm0jd2QQaP8jrACK/2Sr6rGiFRYlAdudnh5VRk6y4obGG5U1OYHzSAHLCc/C1kK29BtV3ARNW6xHEuQTwjBExmBCEPxMejVKNLaZ58zCAI9FZMG5ugVwFxEwUMoabv1nUnugj1i0/mIVFBwCWxgEB0KSSpXsRj8AV5Aq8RDgpC1ZxmeU//amNPHjoC0LQp9sfpFpUlPZQ1ov2VnLe7x3Nn0QXwR1tSxUmQ/Fcufg1jkqJTVgK+zDJZuAt0F4UTUcAsWn6CfWmiGwl7BXyB0fR+KanSCT+497Zn3euyuf6OHUeAOi6Z9Wqdw5Y2O4WL1rdKHDAYOyc2WAMmz4/GMRMKKJveWSNxBNdNUHB+wHqCfOQTaRluOxcSiS5Uh+1WNz0EKt7KHQIGdmJCM1SfKc7lHisLdgxc9T9dOeY4vv33OQ1OoNn5/u86L40+sZhl07PtAEkfehLela9C4KLvGBT0IY3DHWVoV2K4dc/qZdPKrOOod6CLnLuktB3rdVjTsB0+ZgsMgfRFEgznY0mQwSVB8YBsDbaD+gtzPlSGM17MrsD4MqTQajjJrPf14GX5D0D7csPrvDS0FPnpltwyiUTu82ysqNhDj2PE4UXFHXLQpxZrsxf1WWxa818wvUaOUVfPWqEyQhpiRD822k4RDladgtI14 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 430f629b-dc6e-4faf-db3f-08da9f56ea48 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 00:34:47.5337 (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: AS4P250MB0751 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/codec_internal: Avoid deprecation warnings for channel_layouts 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: 2LAdOCN4wG+D AVCodec.channel_layouts is deprecated and Clang (unlike GCC) warns when setting this field in a codec definition. Fortunately, Clang (unlike GCC) allows to use FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec), so that one can create simple macros to set AVCodec.channel_layouts that also suppress deprecation warnings for Clang. (Notice that some of the codec definitions were already inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed. Also notice that setting AVCodec.channel_layouts was not guarded by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it it without removing all the codeblocks would not have worked.) Signed-off-by: Andreas Rheinhardt --- According to godbolt both of these assumptions about Clang are true for the oldest Clang version provided by godbolt (namely 3.0). Can someone test audiotoolboxenc just to be sure? libavcodec/aacdec.c | 8 ++------ libavcodec/aacdec_fixed.c | 4 +--- libavcodec/ac3enc_fixed.c | 6 +----- libavcodec/ac3enc_float.c | 6 +----- libavcodec/alacenc.c | 6 +----- libavcodec/aptxdec.c | 8 ++------ libavcodec/aptxenc.c | 8 ++------ libavcodec/audiotoolboxenc.c | 2 +- libavcodec/codec_internal.h | 19 +++++++++++++++++++ libavcodec/dcaenc.c | 11 +++-------- libavcodec/eac3enc.c | 6 +----- libavcodec/g722enc.c | 4 +--- libavcodec/libcodec2.c | 8 ++------ libavcodec/libfdk-aacenc.c | 4 +--- libavcodec/libgsmenc.c | 8 ++------ libavcodec/libmp3lame.c | 6 +----- libavcodec/libshine.c | 6 +----- libavcodec/libspeexenc.c | 6 +----- libavcodec/libtwolame.c | 7 +------ libavcodec/mlpenc.c | 8 ++------ libavcodec/mpegaudioenc_fixed.c | 6 +----- libavcodec/mpegaudioenc_float.c | 6 +----- libavcodec/opusenc.c | 5 +---- libavcodec/pcm-blurayenc.c | 7 ++----- libavcodec/pcm-dvdenc.c | 9 ++------- libavcodec/ra144enc.c | 4 +--- libavcodec/s302menc.c | 5 ----- libavcodec/sbcdec.c | 5 +---- libavcodec/sbcenc.c | 5 +---- libavcodec/vorbisdec.c | 4 +--- 30 files changed, 57 insertions(+), 140 deletions(-) diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 2d448103df..2fdfd6b221 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -566,9 +566,7 @@ const FFCodec ff_aac_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layout, .flush = flush, .p.priv_class = &aac_decoder_class, @@ -594,9 +592,7 @@ const FFCodec ff_aac_latm_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layout, .flush = flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 4b2085335d..8c5dad2813 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -464,9 +464,7 @@ const FFCodec ff_aac_fixed_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layout, .p.priv_class = &aac_decoder_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index a22d3b4abf..a52a598152 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -119,7 +119,6 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx) } -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_ac3_fixed_encoder = { .p.name = "ac3_fixed", CODEC_LONG_NAME("ATSC A/52A (AC-3)"), @@ -135,10 +134,7 @@ const FFCodec ff_ac3_fixed_encoder = { .p.priv_class = &ff_ac3enc_class, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.supported_samplerates = ff_ac3_sample_rate_tab, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_ac3_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, }; -FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index 6238980690..3ca7d113c2 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -123,7 +123,6 @@ av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx) return ff_ac3_encode_init(avctx); } -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_ac3_encoder = { .p.name = "ac3", CODEC_LONG_NAME("ATSC A/52A (AC-3)"), @@ -138,11 +137,8 @@ const FFCodec ff_ac3_encoder = { AV_SAMPLE_FMT_NONE }, .p.priv_class = &ff_ac3enc_class, .p.supported_samplerates = ff_ac3_sample_rate_tab, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_ac3_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; -FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 362d4f8ba6..0f685d71d6 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -648,7 +648,6 @@ static const AVClass alacenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_alac_encoder = { .p.name = "alac", CODEC_LONG_NAME("ALAC (Apple Lossless Audio Codec)"), @@ -660,12 +659,9 @@ const FFCodec ff_alac_encoder = { .init = alac_encode_init, FF_CODEC_ENCODE_CB(alac_encode_frame), .close = alac_encode_close, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = alac_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(alac_channel_layouts) .p.ch_layouts = ff_alac_ch_layouts, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, }; -FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c index d254b3026b..3ae7a00803 100644 --- a/libavcodec/aptxdec.c +++ b/libavcodec/aptxdec.c @@ -183,9 +183,7 @@ const FFCodec ff_aptx_decoder = { .init = ff_aptx_init, FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, @@ -202,9 +200,7 @@ const FFCodec ff_aptx_hd_decoder = { .init = ff_aptx_init, FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 114e286fe2..5fc0378f5d 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -276,9 +276,7 @@ const FFCodec ff_aptx_encoder = { .init = aptx_encode_init, FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, @@ -297,9 +295,7 @@ const FFCodec ff_aptx_hd_encoder = { .init = aptx_encode_init, FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c index 02a863bf03..1ccfda4d20 100644 --- a/libavcodec/audiotoolboxenc.c +++ b/libavcodec/audiotoolboxenc.c @@ -627,7 +627,7 @@ static const AVOption options[] = { .p.priv_class = &ffat_##NAME##_enc_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | \ AV_CODEC_CAP_ENCODER_FLUSH CAPS, \ - .p.channel_layouts = CHANNEL_LAYOUTS, \ + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(CHANNEL_LAYOUTS) \ .p.ch_layouts = CH_LAYOUTS, \ .p.sample_fmts = (const enum AVSampleFormat[]) { \ AV_SAMPLE_FMT_S16, \ diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 2d9b4f6460..e3b77e6dea 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -276,6 +276,25 @@ typedef struct FFCodec { .update_thread_context_for_user = NULL #endif +#if FF_API_OLD_CHANNEL_LAYOUT +#define CODEC_OLD_CHANNEL_LAYOUTS(...) CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(((const uint64_t[]) { __VA_ARGS__, 0 })) +#if defined(__clang__) +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) \ + FF_DISABLE_DEPRECATION_WARNINGS \ + .p.channel_layouts = (array), \ + FF_ENABLE_DEPRECATION_WARNINGS +#else +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) .p.channel_layouts = (array), +#endif +#else +/* This is only provided to allow to test disabling FF_API_OLD_CHANNEL_LAYOUT + * without removing all the FF_API_OLD_CHANNEL_LAYOUT codeblocks. + * It is of course still expected to be removed when FF_API_OLD_CHANNEL_LAYOUT + * will be finally removed (along with all usages of these macros). */ +#define CODEC_OLD_CHANNEL_LAYOUTS(...) +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) +#endif + #define FF_CODEC_DECODE_CB(func) \ .cb_type = FF_CODEC_CB_TYPE_DECODE, \ .cb.decode = (func) diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index 46618c13f9..eec6965b5f 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -1324,14 +1324,9 @@ const FFCodec ff_dca_encoder = { .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = sample_rates, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_2_2, - AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT1, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_5POINT0, + AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c index 648c93dcaa..78d4f1399a 100644 --- a/libavcodec/eac3enc.c +++ b/libavcodec/eac3enc.c @@ -249,7 +249,6 @@ void ff_eac3_output_frame_header(AC3EncodeContext *s) } -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_eac3_encoder = { .p.name = "eac3", CODEC_LONG_NAME("ATSC A/52 E-AC-3"), @@ -264,11 +263,8 @@ const FFCodec ff_eac3_encoder = { AV_SAMPLE_FMT_NONE }, .p.priv_class = &eac3enc_class, .p.supported_samplerates = ff_ac3_sample_rate_tab, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_ac3_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; -FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index dc044c320d..bc08211b1d 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -381,9 +381,7 @@ const FFCodec ff_adpcm_g722_encoder = { .close = g722_encode_close, FF_CODEC_ENCODE_CB(g722_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index 581ef04ce2..5728d915c2 100644 --- a/libavcodec/libcodec2.c +++ b/libavcodec/libcodec2.c @@ -189,9 +189,7 @@ const FFCodec ff_libcodec2_decoder = { .init = libcodec2_init_decoder, .close = libcodec2_close, FF_CODEC_DECODE_CB(libcodec2_decode), -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) }; const FFCodec ff_libcodec2_encoder = { @@ -209,7 +207,5 @@ const FFCodec ff_libcodec2_encoder = { .init = libcodec2_init_encoder, .close = libcodec2_close, FF_CODEC_ENCODE_CB(libcodec2_encode), -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) }; diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index fc2e71c51f..d589964453 100644 --- a/libavcodec/libfdk-aacenc.c +++ b/libavcodec/libfdk-aacenc.c @@ -494,8 +494,6 @@ const FFCodec ff_libfdk_aac_encoder = { .p.profiles = profiles, .p.supported_samplerates = aac_sample_rates, .p.wrapper_name = "libfdk", -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layouts, }; diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c index 9ad430bf62..bd3b1420aa 100644 --- a/libavcodec/libgsmenc.c +++ b/libavcodec/libgsmenc.c @@ -127,9 +127,7 @@ const FFCodec ff_libgsm_encoder = { FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, @@ -148,9 +146,7 @@ const FFCodec ff_libgsm_ms_encoder = { FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index c8a6eb8c33..26e58baa3d 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -345,11 +345,7 @@ const FFCodec ff_libmp3lame_encoder = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = libmp3lame_sample_rates, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index e266229f03..2f6a9233e0 100644 --- a/libavcodec/libshine.c +++ b/libavcodec/libshine.c @@ -140,11 +140,7 @@ const FFCodec ff_libshine_encoder = { .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = libshine_sample_rates, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index 2191e7dac7..9fdb247863 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -354,11 +354,7 @@ const FFCodec ff_libspeex_encoder = { .close = encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c index 2168b3cdf6..9c0156aa25 100644 --- a/libavcodec/libtwolame.c +++ b/libavcodec/libtwolame.c @@ -228,12 +228,7 @@ const FFCodec ff_libtwolame_encoder = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index a8b0486cf3..1bc8995c58 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -2252,9 +2252,7 @@ const FFCodec ff_mlp_encoder = { .close = mlp_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_mlp_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) .p.ch_layouts = ff_mlp_ch_layouts, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; @@ -2274,9 +2272,7 @@ const FFCodec ff_truehd_encoder = { .close = mlp_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c index 3b2bcb3594..afbffe766b 100644 --- a/libavcodec/mpegaudioenc_fixed.c +++ b/libavcodec/mpegaudioenc_fixed.c @@ -37,11 +37,7 @@ const FFCodec ff_mp2fixed_encoder = { .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c index 64b5bbda6e..212709c291 100644 --- a/libavcodec/mpegaudioenc_float.c +++ b/libavcodec/mpegaudioenc_float.c @@ -38,11 +38,7 @@ const FFCodec ff_mp2_encoder = { .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index a7a9d3a5f5..324fcd64a6 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -740,10 +740,7 @@ const FFCodec ff_opus_encoder = { .close = opus_encode_end, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.supported_samplerates = (const int []){ 48000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t []){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/pcm-blurayenc.c b/libavcodec/pcm-blurayenc.c index 03ed88b8ae..62e86e722f 100644 --- a/libavcodec/pcm-blurayenc.c +++ b/libavcodec/pcm-blurayenc.c @@ -279,8 +279,7 @@ const FFCodec ff_pcm_bluray_encoder = { .init = pcm_bluray_encode_init, FF_CODEC_ENCODE_CB(pcm_bluray_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { + CODEC_OLD_CHANNEL_LAYOUTS( AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, @@ -290,9 +289,7 @@ const FFCodec ff_pcm_bluray_encoder = { AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT0, - AV_CH_LAYOUT_7POINT1, - 0 }, -#endif + AV_CH_LAYOUT_7POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index e9349680e8..011d0a2f00 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -181,13 +181,8 @@ const FFCodec ff_pcm_dvd_encoder = { .init = pcm_dvd_encode_init, FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_5POINT1, - AV_CH_LAYOUT_7POINT1, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_5POINT1, diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index d9448e88c8..ea537f3f80 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -549,8 +549,6 @@ const FFCodec ff_ra_144_encoder = { .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]){ 8000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, }; diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c index ad59325ec4..3bd657f945 100644 --- a/libavcodec/s302menc.c +++ b/libavcodec/s302menc.c @@ -184,9 +184,4 @@ const FFCodec ff_s302m_encoder = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]) { 48000, 0 }, - /* .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_QUAD, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX, - 0 }, */ }; diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index 51411eb16b..3fac2f5016 100644 --- a/libavcodec/sbcdec.c +++ b/libavcodec/sbcdec.c @@ -374,10 +374,7 @@ const FFCodec ff_sbc_decoder = { .init = sbc_decode_init, FF_CODEC_DECODE_CB(sbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c index d7e9fb4198..721c97e1ea 100644 --- a/libavcodec/sbcenc.c +++ b/libavcodec/sbcenc.c @@ -352,10 +352,7 @@ const FFCodec ff_sbc_encoder = { .priv_data_size = sizeof(SBCEncContext), .init = sbc_encode_init, FF_CODEC_ENCODE_CB(sbc_encode_frame), -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 0d04e7c2c4..4a85500c10 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1876,9 +1876,7 @@ const FFCodec ff_vorbis_decoder = { .flush = vorbis_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_vorbis_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_vorbis_channel_layouts) .p.ch_layouts = ff_vorbis_ch_layouts, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, From patchwork Mon Sep 26 00:35:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38320 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1946881pzh; Sun, 25 Sep 2022 17:35:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d385qIJR0OXjbg0g994pUyH+gYEuxg5B++GVLnFjBKzCF++K7ON1dhmQwVXP4baCLtbus X-Received: by 2002:a17:907:6e14:b0:782:4659:14c1 with SMTP id sd20-20020a1709076e1400b00782465914c1mr15726737ejc.196.1664152556030; Sun, 25 Sep 2022 17:35:56 -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 ey8-20020a0564022a0800b004573189b5cfsi2476126edb.525.2022.09.25.17.35.55; Sun, 25 Sep 2022 17:35:56 -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=b4cNFLvE; 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 D98CC68BB1C; Mon, 26 Sep 2022 03:35:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2082.outbound.protection.outlook.com [40.92.90.82]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3E0DB68BA9F for ; Mon, 26 Sep 2022 03:35:47 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nz/T8Hvui5vvqKh+YI/x5OL9q49I9V+74xWcYuilC8mF9YVib0WV1BAiUSskfwC0JYwmRiES6Gzbgs9FkIDXn53/cpVje7Rcf4cMhCfzJMRaiTCDkYFrUQXWq4Dslk17UhUns1GiaJg9hXAOAZ0/AN8qVTb9iTkMouqwiOSHleFgqnuJwuUoHUKDf27AgKln80W4jQfNcMUPCxSaA0knOIt5uyN2Yggi48Nd382kvUMCFxfpLCak/+Wkfey5d2u7fQW3jfa0bWa7ZGKdFKJ35jk1OqCEaAW/10M+rrWorbfAf0KXT48Y+PvGY+O42EKbbmSCNpkKNGZetPZRC2fWlw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+LfIvpe2A7USzzepLHC6VHhXxAqdf0pUNE0kWMokyXg=; b=HeaE9fOZzhO9ky7viCG9rT/N3h42W+EZJxdTTucP0mtJkyHOyqgIzg+XMQAGJiruKF/+0eD++MjjzHq6Jty3BE8vFhQC+WA+Riu/kvJ0KljLJc9RX0BN+/eWE3pdKFLq1Ko5/xwmPZedipyXcQGcTQ+U46rOA5jh+7ThpvEDcW7duIb4qg0gE4UQi7D4PjuEchp+f4EDokX3AK7juA2gsmcp3+gKIk0Q3l1KU4r6Wq2vtWO21HRqF0Rw3aAQUUTFZVJA/TBY89HJk4jOfqDAkHt9KCBf2cxXfoP2RT1xW4fUjF+cTaG6eo9YwfzBu0ZtRdRNHTHrL2ikn7FsE3ZhrQ== 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=+LfIvpe2A7USzzepLHC6VHhXxAqdf0pUNE0kWMokyXg=; b=b4cNFLvELNixryFNG686e4l4u+RzazHW6+iXKnw6tiD6gHAoOMw21Duk8IEc18xr9+c9CWtGK3DpeafzBx7DwBjWhl7HX7vS479n/GVy+0t8RnZ485OqHAq+UXdBxSrrxElBCF6mgn4v5JSaKCwx/a6P7fULGdZz4t2sMraZYgy3qrZyKr6ro9m5wqboEgvTLYdc2Lja7EjSuG60cGs/z7/EUvi8zA36ZPARYCVAXgteu2+x+b5WcGv0IEI9qD/Sxrm8J9w/Zhy0iNA5YrBrDZLEo0OYeIGhMfKJY2GojCjrtj846U6wjQAhgStaMLeadVZUOoHj8Yn091i2laaDUA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS4P250MB0751.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:577::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Mon, 26 Sep 2022 00:35:45 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::85ac:1b92:90f:dc18]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::85ac:1b92:90f:dc18%4]) with mapi id 15.20.5654.016; Mon, 26 Sep 2022 00:35:45 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2022 02:35:45 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [p1+Pk8b5BjAiDUsmVzHB8+EDNgcvnfLvNbIKYluyml4=] X-ClientProxiedBy: ZR0P278CA0105.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::20) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220926003545.3202750-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS4P250MB0751:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c13445a-5ca0-4d02-d0ab-08da9f570d05 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKxLc5tmG8wxoWeNUlxOu28QCZNG6HIisiJ71k6r2tda6w3vjtevMVIrC5mqhgfgrhPlelJyS0QZLDkuo5+tWC42oCjizZavPx8wMFaEan3O4/JeOn3IlZwJgGh9Gz394ERRk73i2fuR0u7JIYd6TgOD3ADsqXyk+CUeRDwnMEBcWPDGBtBXF/43KWjRaipPfTTjWDvcJfKa7OJkIt40S4FxCrlXo5y4MKP9InlF2HTT1jS+v/UWlpXyQexDeqgmhCe6q+pmyoVi5xf4bPojCxb0nQAwUBRoc6XDH1NVw6rU9ESvN0cXY+50LOa1BA4mbvYIpCGFWc29Myesf6qfC37p+R3m22EZ/J6Z+mHgTcLGryRNVpHk+QcEVjoyUXmOEsMBzH2F+tsVx4h3VJufmmdJbe1tdOu+TTN985rzP9VdyPDcdvGCG6z44DFIsdE9H8dl5BntZj7dnp/DARGqbLk3zDno9VyEJDes29TMoSUKqt30aZVESXmbAGf6QyOMQZcezH+ZXCDtfSFvnhhPDN0b0x/WeCxb/tp+tI5REwVyNpo0T7JC751n+/TJFc8uusZCjpvuXMI7UjkQFJWa8mIjuRR7xrBTyRUQjgE/THRTw25Zq5e5ycAyolgJDKhI2/1jWR1g/J3bSgIcnqbJQ2GmPlyLQ6M9bQHFflkf6/q4Q4kW3C3kuDpi4tpg1WoIKVomap1jOOa+CBFPUcUpMgap8zLof2VcdLk= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vpyXeUSahMNV15dXkPngaKP1cGw9D6aZSO49Q80XDkiz+dJFIN5bqK77cvCWRDqx2NtnnF+D41UxWnbZ0tiKQ6KrfRTp7Pa/h0Ey+guM+tjg/w3HhWgmGlLs+Xq76s+CrcTCipB6nG7uztPdvYyLhPvbykeecNEsDTt+ywJ5NHee5Ou82JMfYuodRVwizBZukAIID9B148ccpNpnNEPzZ4rp3M2tA0pOz3adoi9fl/wO9bRP2Ijant3Qf9bqhdV+nJgi4xOiSBRlBqMOqmP8qwJA3Nap+RJfThWehqCPGZBS3Gc/DjIn47d8pUY58fi4XnOg6/KXEMHACAoQsL0ixa8m89kdShkOeKWeHvVukUm+XuMCRCU90ESC1V7yZu3gAo0Y7csCZUdvC96yV1Be8Ma69d2/s1AOZ7yVm41XzITDkg76XM2jbz1+Vf1s/wsTH5HKd0/ouK0KlcLJPAq6zOUClPh008ffjpkCcIujWzH22VXQOb1i7kurM+Gq1mda3LQJdkJKoadb6cUw5ylQ3wWVZZZuIT7LyPoxpQsbA53VaiwZ7lv/XgoqaqqhIk+UohQPf/KQ30MlQFTk+2HGJ8Obhpb/LoDfe6lGREqY2hueEKBvGbrVwJrNbGXCudvs8Ef/Oa8QyMSidTC9hy5C1g== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Rxqr9J4XugTogAph5sDjYdtti8QIoaprmn7YRQY4+abVK3YknuhsPmo/wEHrj7MuMNKluH2HsdY/ScMl09cTq1XkuQIlrj6lsgVmCpSo0l9Kjw/M4c3RKrS3WOYL5L6BdalIOxN3QgJ5Vhrc99iaGiHHyZzE5UoRmzbtiLdvoC2Meg/qd+Jf/85oFbAljU6GABrIlhJFm0zDkedJYChY+xjFmAIoToZsEJ1K8esqnFwbRp9Oa9p2XpbeRWuhVD47NXyor2b/5zq6LDS93YaNt4PD3ob+FLI005PMvBJm9gMKcNBbasJROBZ8GygkkBc0BBokSZJolW8bgfgX0CP50fdfE2Zv647PCP1F7usGtb1T12mwVzXhwfQE2fTtLmt1sAAOHYpsgBCKq/MCSAU6PQbBOREYFlZAxlUg2NtRbSwfc8vQy/k6qLzQn52wGcxnKiDDA7vHS7+OZhih8YyWUP52wdxTsCc6GujJId9CBKuRuSJw6e4uSIr/uprZuWSSvOcPKZRbgDzHAvcaXKrdP2fHE2z5uBiP8+xo+9BcfGoMN3Kl4W5UeP1KaDqFLlEKVaCb3YlhcLC6EA+EBrbtbX8F5pA6fWwkJdIiVIh+UnovnKzYA1Q6w5edzSTeUmNnQ9Vi7qlG9iFQ+MOuWepj7bY2+1vWlS+1gvhm6QB4QxT9Hx7umlAf2G50dFU5UUehLXCBuibXQSKZ3y8J2d0y10ru7DF4uCpj3wzsZjmrNTV7T6HhsukO4fb0yfPn39/CWVQq+n7uZAho5NJZs0kahR294ZWhPuS+cF68KU8GD22/sc6+x1iHJceUHAVLu9fADiR+s3Ju+5K/SPKsU960m5090SNnpJSXD8O4JI/9uXjrrKJ02SxhSRCmPu3B1Hn/QzLwaTVfgX/UffQ0MGz0dV7MPbDtxCcBK3AM5bDNxoBhXHKihyjYllatp35sBH3577UTTQtgHxDQpmS9S39XTqIpLLSeQvtAezKp+EGIjpeDtMeeNFBxdk3mvfs5v8fov5JDXV3NIO14HXDS2l+kvamElCUcBlu6mOqCDTprtOF36SJhXIAAsZRFMqhXJ6dOMHAngoAWFRwTbZk54dDuwOCH2NFSRwiM9Wi7mnr8epbEvYRTF8jY0L57R1ktor7hu875Xb3DO9xT8yeWiv03wZ1+aKpVQlMd/zY2WKPOo/0xNkcJABw/KDuOnQ8b3rR2uq3T7JkndqclqDguB3gBwFYTKYmMysDWLp+2HSMXR/rWxcu+5IUvx5VgNgi+XQ+cXSN4oZZMHvfkifmii1j3eRSNHISFB/p00fsl/tQ5xHiWV3B2KMXx7xvj9k8gWRNF X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c13445a-5ca0-4d02-d0ab-08da9f570d05 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 00:35:45.7521 (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: AS4P250MB0751 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/aacdectab: Remove empty channel layouts 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: BYlF3BhnHJvv They will be mistaken for the sentinel of the arrays they are in, thereby hiding the 6.1, 7.1 and 22.2 layouts. (This doesn't really matter, as these arrays are informational only for decoders.) Signed-off-by: Andreas Rheinhardt --- libavcodec/aacdectab.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h index e03026806d..e38b93a534 100644 --- a/libavcodec/aacdectab.h +++ b/libavcodec/aacdectab.h @@ -73,7 +73,7 @@ static const uint8_t aac_channel_layout_map[16][16][3] = { }; #if FF_API_OLD_CHANNEL_LAYOUT -static const uint64_t aac_channel_layout[16] = { +static const uint64_t aac_channel_layout[] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, @@ -81,9 +81,6 @@ static const uint64_t aac_channel_layout[16] = { AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_7POINT1_WIDE_BACK, - 0, - 0, - 0, AV_CH_LAYOUT_6POINT1, AV_CH_LAYOUT_7POINT1, AV_CH_LAYOUT_22POINT2, @@ -92,7 +89,7 @@ static const uint64_t aac_channel_layout[16] = { }; #endif -static const AVChannelLayout aac_ch_layout[16] = { +static const AVChannelLayout aac_ch_layout[] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_SURROUND, @@ -100,9 +97,6 @@ static const AVChannelLayout aac_ch_layout[16] = { AV_CHANNEL_LAYOUT_5POINT0_BACK, AV_CHANNEL_LAYOUT_5POINT1_BACK, AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, - { 0 }, - { 0 }, - { 0 }, AV_CHANNEL_LAYOUT_6POINT1, AV_CHANNEL_LAYOUT_7POINT1, AV_CHANNEL_LAYOUT_22POINT2,