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 02ABB4102A for ; Sat, 12 Feb 2022 12:24:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A64B068B2A6; Sat, 12 Feb 2022 14:24:36 +0200 (EET) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2719A68B1FF for ; Sat, 12 Feb 2022 14:24:30 +0200 (EET) Received: by mail-yb1-f176.google.com with SMTP id e140so13290975ybh.9 for ; Sat, 12 Feb 2022 04:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=i5Vm7WCCzTBnl0GOhcvRl4Rb4nAmivt0DWFmnfGmVDU=; b=Xelpw6jBq9/hJS/63GWh+2iEf3TzGYwlaOvI+xZVlvzUPEwrmoR9KHykpaxMDbZNLq Pe9sgArGsCNOR3FwzWMnfxVjBxUtGdXhlxPafoPqEBd2NySf4XIo/XgaVeMNtteQyBzw zcoMGGqWkibYOztGY0bLaBMQsWFtnsH3o0BWakhJ0FPdp51AABRowWigP7uT9RtIs2/g cTsOWm/FaCEDiz8YHxAz+n5jxvkXIzxfmmrKR2u4fm/YqFkLPQp8BU7902Sg+GtGpwgX afjLMG5+XEXZH5o0gc8xF2BbTFpHixlgHArJ0Bs4v+1Kn1QY4XeEtHBJKk4eRBNmnsju p28w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=i5Vm7WCCzTBnl0GOhcvRl4Rb4nAmivt0DWFmnfGmVDU=; b=ytCm1xItlWZWG79OI+blFaikmI5Hh35ei5JmH9jSJoNKeXaVvbKWe29oZyawRJuO3J 5TbEeede4u8Y0fa60GdSrbI5wwTJLZw1yn1BothpH/wWEELpVdP9rQVZJFIyZtBDc1go mVQF0tgKc2l/Jjt+h9gEQY9nZ8tNUkSurJQf80hM2x4UsSvGA2PbWZbxHOOa03G8VtMI EEELDy8F/AnS817zdcYJSrStgPOoMHDHTv4Y9AAUwrCh7w4S6e5CkXje2aXdgFqbFDjO XyjU6Z0NXOwZ3zWeN+R3NxdxOiW0Dm0avwtmdPxP+0QbDQn8jcajAQG4kfyc5vUPDpKV m2tw== X-Gm-Message-State: AOAM530jxCKitJbwCBSoWENVLYIhHTfxWkMIA4XHzqEEwiHm4z1PYGhx f6SpZVqOG0LzCdoNywwQEnid4ffhmAxGZs0tSThfJ+iTtFU= X-Google-Smtp-Source: ABdhPJzztXHAbCMEVvnpwQbiRiRFGPJ0oGe5PC/hGTBwJnViU6Cj1FDZFCuuDEop8iaHhwCgIF5I6huO8ZOChkrF3Mc= X-Received: by 2002:a81:cf07:: with SMTP id u7mr6150162ywi.221.1644668668662; Sat, 12 Feb 2022 04:24:28 -0800 (PST) MIME-Version: 1.0 References: <20220212001301.4090-1-jamrial@gmail.com> In-Reply-To: <20220212001301.4090-1-jamrial@gmail.com> From: Paul B Mahol Date: Sat, 12 Feb 2022 13:25:01 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 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: On Sat, Feb 12, 2022 at 1:14 AM James Almer wrote: > This is unfortunately needed to remove (or reduce the awfulness) of certain > modules violating the AVFrame API and using sizeof(AVFrame). > Which modules? > 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 > --- > 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 > + > +#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 */ > -- > 2.35.1 > > _______________________________________________ > 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". > _______________________________________________ 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".