From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 59D1B46421 for ; Wed, 16 Aug 2023 16:21:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DDE868C69C; Wed, 16 Aug 2023 19:21:47 +0300 (EEST) Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9CD9C68C09B for ; Wed, 16 Aug 2023 19:21:40 +0300 (EEST) Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-1c4c7a83bcdso2964858fac.0 for ; Wed, 16 Aug 2023 09:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692202898; x=1692807698; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4BrZvniIt4ORJ9r+4LZX6/jF6JuiSqWQ1NppcxF2wkE=; b=gbfYbQUHq2hcQFA8seitBh36yaNq0oc5Ps300reUuD6joUEP0DqC+OD0miJ05H8l/b sQhtxDYOLlfx6iMbnMkAQf4krDifSQT8N8dRj7gXuWw2Wwr0sfsqR9+XbnDqBfMbW3L4 40Hkbh4YYgRFfr1wSHGIrsqEE8r3QmmTs4QMgoJqsrGo4GaknpndxQdrOnuRITtB1QuH +y/zBTgPeTBT8NUsF7MFE7NTaW27uVZt2yg/XswSUYHhKrjxbQ/HKCdbQUuIp3RpwbaO LkjnfmioKQXkZnOgYoi95U/eHlur2/ASuENGV5Y0v2X9KTPYXj9D/XKPooMUVgh9xvbU W8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692202898; x=1692807698; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4BrZvniIt4ORJ9r+4LZX6/jF6JuiSqWQ1NppcxF2wkE=; b=ZmVMpujy/kS0/bxjao8pYFSJ/1Hr5Lth11huRnu+WU/7r5E01dbHKvjIbnEIhqYiMp hMTanC+zdijXLqgnBghO4YsaR/Kit2o2qGEbYfjaty/Ip8+kigrWhweQG3tqqFZ5vWio YaQ3S6abUlLFjTShlZWQDKJfFNuSlOyteKrqGbrWfZvc0orFK8tbhJLrOvTbZ97GqqrP BuQrxSd2IPuP4K5Opp26vKlIeKBo/jUMNuJXHBFo2+aXD9sUG14tC4eViUAVdC/E3jIJ JIXotyiQGSYwLlMSrfCVNtao56GzMhunPn5ya9Mhb/ROiCgLrQIrzYZOUFBHQaO1h+dY 3ziA== X-Gm-Message-State: AOJu0YzaIhdaTm4v5cvI+scmmG+hfiYrZ3uch/KwbRFXmlTk0tn9ZX+M RaU8Jxj0FzKQb+DFmJzT+C1M8xP+2Ho= X-Google-Smtp-Source: AGHT+IHVvI6IAX8oWlw6GaMxvdQeiJEIZ1Voe5HPsk/9jl/RJiO673j6rX9hoDoSQpiJcVbeoCmewA== X-Received: by 2002:a05:6870:6003:b0:1bb:6485:7988 with SMTP id t3-20020a056870600300b001bb64857988mr2758465oaa.35.1692202898403; Wed, 16 Aug 2023 09:21:38 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id k20-20020a056830151400b006b469ace1b1sm6284478otp.22.2023.08.16.09.21.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Aug 2023 09:21:37 -0700 (PDT) Message-ID: <005533e0-4ae7-3624-587d-283d66186311@gmail.com> Date: Wed, 16 Aug 2023 13:21:39 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avutil/channel_layout: make pre-defined channel layouts C++ friendly 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 8/16/2023 12:44 PM, Zhao Zhili wrote: > From: Zhao Zhili > > C++ doesn't support designated initializers until C++20. We have > a bunch of pre-defined channel layouts, the gains to make them > usable in C++ exceed the losses. > > Signed-off-by: Zhao Zhili > --- > libavutil/channel_layout.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h > index f345415c55..817a5ad370 100644 > --- a/libavutil/channel_layout.h > +++ b/libavutil/channel_layout.h > @@ -359,7 +359,7 @@ typedef struct AVChannelLayout { > } AVChannelLayout; > > #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ > - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} > + { AV_CHANNEL_ORDER_NATIVE, (nb), { m }, NULL } Comment out the field names instead of removing them altogether, and add a comment about how this is done for the sake of c++ projects including this header. > > /** > * @name Common pre-defined channel layouts > @@ -397,7 +397,7 @@ typedef struct AVChannelLayout { > #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) > #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) > #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ > - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} > + { AV_CHANNEL_ORDER_AMBISONIC, 4, { 0 }, NULL } > /** @} */ > > struct AVBPrint; This needs a minor bump IMO. Something said c++ projects can look for before using these defines. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".