From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTP id 4484C40FDB
	for <ffmpegdev@gitmailbox.com>; Sat, 12 Feb 2022 05:29:24 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A48A68B179;
	Sat, 12 Feb 2022 07:29:22 +0200 (EET)
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05olkn2087.outbound.protection.outlook.com [40.92.90.87])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C353F68AFAF
 for <ffmpeg-devel@ffmpeg.org>; Sat, 12 Feb 2022 07:29:15 +0200 (EET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=WzuPcv8Q4w0bPZIRHcPACfNn/iYgGMEgZpgjYxJhGjCiwrSN/hFIO+90rXXHNxYPGO6apqSpS/05c6awKLTqgrfHLoKfQS814iG+dXejgkDSG3crIzq2taHm9lt4DdGHEcZ3EnjQ+76R+5SdBMN3kQboc93UFRVHaG3erifdxqTd+2o3j5znCHfDskITjrrcQq72KnqVsHb0PsbKsTYs77vGTF4kAmk1XyMLQ/HzAhLsxiGY6ab0zo7/KatEE482vyhgGGEKEK9ZIYyN3+XJDss6bhsN/7/voNJZVMA2r3C3KHP2cOeVVlqWfmUAzAHqepw/wLsmhhTE45431Hu26g==
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=r0Pb6axZBGb1/iIVWcaXs50EHB59ouOWFLDthSLPj7Q=;
 b=mGY8IIthcTyOYOrthE7PnSGFSNJA04b58fNv6mH+pvARxxKyroVT8Mq4loxfmwgnpsUqpnn2vkY4wKrRFv8dW/YRoy42fU7suXJdSMnaTcbeL1n3Cp+SvzetwiRdThYzyHojwPV5S7zHHLOCKJtxT3pxTRNK04QkHyu50362sERHGnBvjr2SMJzEnm/K7wTISU9FHO+CaWsRXUx6yZg00FF/0X9uUrcCaM/JNC7TmyI9cnVWpp5s8eAyUxq0/X55zkJTG/vDUDY2kg5X848DYE+vxSHbDxMAiq5gY1Aa3zOvC56AMNZnc/OX29NmTT+xLlCKJK7RvFjJAISotAdhIw==
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=r0Pb6axZBGb1/iIVWcaXs50EHB59ouOWFLDthSLPj7Q=;
 b=AzdBcu++OdR2Cvm271vqUWPMiyvVo8L4I8sH3w+9S4cX41IibBJFx52It8ETW0K+GzmuOAydTXqBOKuMvDD1kdC4+x5aKG4zg+tngNHfOfqxrFIgczustKnpOW82H7tsLmPiO3h5Z3ijod8ZspKQeM1uo24Kr/v2EdOJtVDoLE2A799E5RpeibHmvWJXZ5ZKZ+tYmv8h57Zt2Le3B9fRlDjX6ULkujm6K6lt/K5twyHJ11dpMr30CZxtr9JUVjVKo9lBUQHKtkx3zckPeddf3Y2MEc57YJ/xlemJd+Fh9HaxKD2syQmJmUtq0SuC8Jp3jAl3H1gIc+y2AetgY8LdWQ==
Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22)
 by VI1PR03MB4701.eurprd03.prod.outlook.com (2603:10a6:803:53::26)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Sat, 12 Feb
 2022 05:29:13 +0000
Received: from AM7PR03MB6660.eurprd03.prod.outlook.com
 ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com
 ([fe80::ac56:2ff4:d304:ab22%5]) with mapi id 15.20.4975.011; Sat, 12 Feb 2022
 05:29:13 +0000
Message-ID: <AM7PR03MB66608C38E26CFB2B0491C4698F319@AM7PR03MB6660.eurprd03.prod.outlook.com>
Date: Sat, 12 Feb 2022 06:29:06 +0100
Content-Language: en-US
To: ffmpeg-devel@ffmpeg.org
References: <20220212001301.4090-1-jamrial@gmail.com>
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
In-Reply-To: <20220212001301.4090-1-jamrial@gmail.com>
X-TMN: [hzrhZcWBsMQFsWoS5J4JS6QffCsaRVwx]
X-ClientProxiedBy: AM6P195CA0085.EURP195.PROD.OUTLOOK.COM
 (2603:10a6:209:86::26) To AM7PR03MB6660.eurprd03.prod.outlook.com
 (2603:10a6:20b:1c1::22)
X-Microsoft-Original-Message-ID: <943910b2-cd09-355a-ad70-675595b92fb4@outlook.com>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 48a81bf6-d417-4606-97eb-08d9ede89aa2
X-MS-TrafficTypeDiagnostic: VI1PR03MB4701:EE_
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: G8uGI+U+aonWMjrehoVMvOiT4sKx+yg1v+AkyhHiDeLVawiy1PlnrhVOeFPlEPflOlkQ/MpGK1Ayv3xaZYGjWD3YB5/TSI5nLT0l4Mb2EFisu5MOP5QEUDGH8pIsHoQ2HZYmMyr2B6VkZEYE+JSUvI56Xt7eNUSs/iCfe8f/Q72A1AASxMYPo9zm+e/uGXGOTc+VPD/Hmsv3HurhSExgf1LEDXNuZ/U1LVyADAwAfHt20RU1h1Y7rqG2IZRUVsFnfEwfEwElbfn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3QmxJZ3czU2ZzanloeDVUUkJzWGtDQk5oOWNFZlU4?=
 =?utf-8?B?T1BUbmkxcS9lUENzcVNqOWl0NmswMzYyWUNxejdSUEpBbUtRdEo0UjF3MmRW?=
 =?utf-8?B?dHdRdTA2b2ZSSXR5MysxTkR5dUtuUDRGcUlXaS84VXRscWl1SXM0V3d5SkZR?=
 =?utf-8?B?THFTZjBDYThJalRpNm42Ukg1eU1mWjFqVnFjbGV1T1hqMFpoOTZERDR1d1RK?=
 =?utf-8?B?THlWcEhlMFNqSEVyZXIxUHVyU0tlK09yZTFRRGxwMEVJVlZuaFVoUkdXN1dp?=
 =?utf-8?B?cStWR20xbUh2ZDEybGliNEhKRytkRndtRjhYZmtBRnkxdVdwaUVqeTNzN3Yx?=
 =?utf-8?B?RGVMT1JBUENpdmR0bTlqdlNkNFVUd3g5Z1Z2eWNHWU5wVllGdjJ1OWJKWm01?=
 =?utf-8?B?ZWlGMWd1QVFzMW5naThwR05aR1E2bU15a3UwT2xqaE5vRjNuVnpyMHF0RU95?=
 =?utf-8?B?eDdhaGVzT0VNRTFCVStKMUNYTWZ6WDY4OEVueTBWbVhLam1LZnhMeiszdlky?=
 =?utf-8?B?bnZuK1JRTUZRQTFhbENFeVhuU3pTbDdiTFhSM3p6dG1wLzYrY2N0YWhTTUo2?=
 =?utf-8?B?bXpLVWI4V1dHNTRkSmFWZmlWS1B6RjlBQm84ekorK1NJNEoySWc5b2pzSUx0?=
 =?utf-8?B?R25Dei9QeGFpMkJlRjUyUTFMWmYzY3MvYjd3L0g5bzh0VWUyTzZlSXpBZyti?=
 =?utf-8?B?UXNHaHhZbjdSbnRjam5NclNNRE40WDNySEI3b1BEdk1PeXEzZz09?=
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 48a81bf6-d417-4606-97eb-08d9ede89aa2
X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2022 05:29:13.8114 (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: VI1PR03MB4701
Subject: Re: [FFmpeg-devel] [RFC][PATCH 1/4] avutil/frame: add an internal
 field to store the size of AVFrame
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/AM7PR03MB66608C38E26CFB2B0491C4698F319@AM7PR03MB6660.eurprd03.prod.outlook.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

James Almer:
> This is unfortunately needed to remove (or reduce the awfulness) of certain
> modules violating the AVFrame API and using sizeof(AVFrame).
> With this, the sizeof(AVFrame) value of the libavutil loaded at runtime can be
> used instead of the compile time value of whatever library included frame.h
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> This is sucks, but at least less so than the current situation.
> 
> I don't see wrapped_avframe going away anytime soon, so something must be done,
> and last time i tried to change how the packets are generated my approach was
> shut down, so here's another attempt.
> 
>  libavutil/frame.c          |  3 +++
>  libavutil/frame_internal.h | 33 +++++++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 libavutil/frame_internal.h
> 
> diff --git a/libavutil/frame.c b/libavutil/frame.c
> index 8997c85e35..a63d2979db 100644
> --- a/libavutil/frame.c
> +++ b/libavutil/frame.c
> @@ -23,6 +23,7 @@
>  #include "cpu.h"
>  #include "dict.h"
>  #include "frame.h"
> +#include "frame_internal.h"
>  #include "imgutils.h"
>  #include "mem.h"
>  #include "samplefmt.h"
> @@ -33,6 +34,8 @@
>                 (frame)->channels == \
>                 av_get_channel_layout_nb_channels((frame)->channel_layout))
>  
> +const size_t avpriv_avframe_size = sizeof(AVFrame);
> +
>  #if FF_API_COLORSPACE_NAME
>  const char *av_get_colorspace_name(enum AVColorSpace val)
>  {
> diff --git a/libavutil/frame_internal.h b/libavutil/frame_internal.h
> new file mode 100644
> index 0000000000..07c246f86a
> --- /dev/null
> +++ b/libavutil/frame_internal.h
> @@ -0,0 +1,33 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#ifndef AVUTIL_FRAME_INTERNAL_H
> +#define AVUTIL_FRAME_INTERNAL_H
> +
> +#include <stdint.h>

size_t is in stddef.h and some other headers, but not in stdint.h.

> +
> +#include "frame.h"
> +
> +/**
> + * sizeof(AVFrame). If you think you need to use it, then you need to change
> + * your code so you don't instead.
> + * Meant for exceptions like wrapped_avframe.
> + */
> +extern const size_t avpriv_avframe_size;
> +
> +#endif /* AVUTIL_FRAME_INTERNAL_H */

Missing av_export_avutil. (And aren't there systems where exporting data
is always problematic?)

- 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".