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 A22404553A for ; Tue, 31 Jan 2023 21:01:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C177B68BE85; Tue, 31 Jan 2023 23:01:44 +0200 (EET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2029.outbound.protection.outlook.com [40.92.91.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 12C2868BDB5 for ; Tue, 31 Jan 2023 23:01:39 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UbS9P3bUsp+CvLMA8TMxSne5ubpHyaRYVScBkkyP6i7Ml7/peA/8llYEfHn4V8aHiTixYO6eq37K+yU1XdgVgYWosWi+ODg+1/dxZkXeVOHdwfA/PWVSip1V641TH4OjjNh5Rtqa4Jfrmn3eTaBn658yL6Wkx65J5/53HIXmMlSjcyZLCevgmUJRbft4aO4tTn9sXHBz1VMSNf+KTxKEOUDNNLo7tv42DE/I9EQc5m+cfQ+97O7/mU/BSIEMy8y3NflMAb9cFL3IoRcHaWay0ZKLTHojT6w/WsBqj0RmHjppNfP8zyj8/3XQtw3qYMasz6K8VTCe/RoL+yIa1rcvNA== 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=c0XkF6KfDPHTmSZhklcchz058swmLAheM9SFm9XGWBw=; b=FSNihY/m4Regp98EjbRU/E17sTQI9Tr7oiRXkpWoiqUyAevv/DudESKfZ8M8DEMOEnJl0I1l+k80vIogxZwz2nQZbT8vIcKsQS9UY/bD18k2QvPBp9iA8G/Ce6qMBEcd//t1SSevBQD3gTMDGjqFLArMWid83i5VQq9vUpW08On0fjT1r83J297h3S59Qlgk0rCUELCxeQbF1vM4kEpkaTTYSPnaoa2pehVO9x3HVJtYscLETEmWvy33mp4othJbhBGiGb97CLkyyQhPf3Z21d3PmpIKUcdFrOtrZay7seLcn//f6Db5PMfFMGpSbmiMVXR0LVV6Xc3QoX5VgHr8MA== 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=c0XkF6KfDPHTmSZhklcchz058swmLAheM9SFm9XGWBw=; b=l1/ieRpzxWIZFTaFCz4OamWHBok4HjdaHbbcI8LiHFNnHgJKcrIdeE1iUeH70IGhWhwoZiMZmoBOOC+zKGYdJJooE1ztJHBuHotzSttJcimFL60buZsDT++FSSEF+Bv/7GvCcFae0iQYKRpnfCN9jcC1Y/rnTS5MwmBFn+/nJxpKVzEungmQviQiFPmkKDKuVL554NAex7wfFH/9qrsTLdJ2JXQrSVkyTMIz2vttOczamT7r0uwCgDwjl4jct9zwp3vf5LIlEjvDUd/qyO0Cnnf2dn2meQYCjz8az7IV/j7eM4XM/cgfwSHPF4oOVXGBhEQBsAMlxV4UAPgrRq3k/A== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0103.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:372::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Tue, 31 Jan 2023 21:01:37 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::a65f:2ae7:256a:ab96]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::a65f:2ae7:256a:ab96%9]) with mapi id 15.20.6002.033; Tue, 31 Jan 2023 21:01:37 +0000 Message-ID: Date: Tue, 31 Jan 2023 22:02:05 +0100 To: ffmpeg-devel@ffmpeg.org References: <20230130122937.12258-1-anton@khirnov.net> <167517302897.4503.15130184316413800795@lain.khirnov.net> <167517470800.4503.4882536660599256492@lain.khirnov.net> <167517869808.4503.13103529212008047943@lain.khirnov.net> Content-Language: en-US From: Andreas Rheinhardt In-Reply-To: X-TMN: [dXBuLQLksPqhyxLLp19EEUfhPXz6lmsy] X-ClientProxiedBy: ZR0P278CA0157.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::22) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <90d917d5-c51d-aa43-f7a2-6155e4f37ba0@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0103:EE_ X-MS-Office365-Filtering-Correlation-Id: de43b5f3-8ce6-4851-dc6b-08db03ce577a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WM6ynKTM1+kqzcW9eY4lN3wjpo3ExIFxX5D7a78YRampWNNTU5Ib7MHs34qEPjkWooEnR4p6dNVDdBvxfE57mgRm5nC2p+YKQTyZEHfHfPW4jnWjxu5LISB3iyo06LVF/qBREmYHRHU75xjrAzIePPC23rSJGHVIUknipxKy3SoqjV/jd196L2y37KTj6/ARJR1tla8poW4tEpa46VrxsT3PIToFxk1ZZy41okRFTuD2tGeD6TeXMF+2zRiz+cS26OecFIZFB0MV/OcqG1oOfnYv5sjHPiP7RV53FKRcthNTQj5xYHepjt1iF8G3Xw3rIQHnf5X/QD2unkRq4rIqBL+JKwNEPu3+BA8K8VTggRDlEcCTm79AGZzQCpLcPbikJ9neZHLPUJyObqVsfvTxcbmZDmor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JkSDdR?= =?utf-8?B?VWVwVWY4UkYvY2ZkVSsvNVVPdzloMEtPQkZTUVgxbDdVWk9ITjliOGdUak5a?= =?utf-8?B?V2pidVRlN2piTzlLZFpZbEdaR3BWSnU2c1YwdTZWUldZRjBNcHUvM25KekJC?= =?utf-8?B?dHZlUytMZjFGZ3hlWkJWQThCZEl1bHUzaUlaUTNzT3VETmNCeHcyR3ZpUWVM?= =?utf-8?B?UXpCY0s3WXlFTUF0bVhocThyQ0xaZGoxd2p6d0RqMW1nSGhxcFhRbDJlbDBi?= =?utf-8?Q?9Ph9RTkyuyMlwaaM6s=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: de43b5f3-8ce6-4851-dc6b-08db03ce577a X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 21:01:37.1216 (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: AS8P250MB0103 Subject: Re: [FFmpeg-devel] [PATCH] lavfi: get rid of FF_INTERNAL_FIELDS 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Nicolas George: > Nicolas George (12023-01-31): >>> * it prevents filterlink internals from being visible in a >>> public header, where they have no business being >>> * it is a step towards hiding more of lavfi internals from public >>> headers >>> * the same pattern is already and ever more widely used in the other > > Note to the TC who will decide: I do not oppose the efforts mentioned in > these two points (that are actually the same points twice), I only > oppose this particular solution because of this drawback: > >> * It requires the developers to remember which field is public and which >> field is private, which is not something relevant here (is is relevant >> elsewhere). > > Without looking very far, I can think of several different ways of > hiding the internal fields better without requiring changes to the > implementation. I would not oppose such a change. > Details please. I can only think of the following: a) Allow the use of -fms-extensions. This allows structs with tags and typedefs thereof to be used as unnamed struct members with the members of the unnamed structure being treated as members of the enclosing structure. One could then use a pointer to the big internal structure internally and one does not need to remember whether a field is internal or not. There is still a problem, though: One needs to cast from AVFilterContext.(inputs|outputs). This should be done via dedicated inlined getters, but this is a bit more typing. E.g. "input_from_ctx(ctx, i)" instead of "ctx->inputs[i]". Of course, it might also be shorter if someone has a short name. GCC, Clang, MSVC and the IIRC the intel compilers support this. b) Add a big #define AVFILTERLINK in avfilter.h that expands to the public part of AVFilterLink and change the declaration of AVFilterLink to "struct AVFilterLink { AVFILTERLINK };" and use declare the internal struct via "struct FilterLinkInternal { AVFILTERLINK /* actual internal fields */ };" This has the downside of actually being an aliasing violation and of adding considerable ugliness to avfilter.h, in particular during deprecations (like with FF_API_OLD_CHANNEL_LAYOUT -- you can't check via #if in the implementation of a macro). I also don't know whether it plays nicely with tools that deal with source code annotations. c) Wrap the internal part in an #ifdef HAVE_AV_CONFIG_H, optionally using #if defined(HAVE_AV_CONFIG_H) && defined(BUILDING_avfilter). d) Same as c), but strip this stuff from installed headers. I consider b)-d) as inferior to a), which I consider superior to Anton's proposal, but the big drawback is its reliance on a compiler extension. - Andreas _______________________________________________ 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".