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 3B47044195 for ; Wed, 31 Aug 2022 03:13:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15B3968BB11; Wed, 31 Aug 2022 06:13:20 +0300 (EEST) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B151868BAF4 for ; Wed, 31 Aug 2022 06:13:13 +0300 (EEST) Received: by mail-qk1-f180.google.com with SMTP id g16so9925267qkl.11 for ; Tue, 30 Aug 2022 20:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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; bh=H1+rvHxEvB3kQarIsgedYGib4cdlYK4Q88kEvDCs/E4=; b=YQU8NKi5BRhsm7s4JVOF2uIb3MKe9A2NHrtWr7qEmtRYsLJBtkaXSq3w1fUwS/ujxq B4/2S1cHASV0UsbUUDQ/7gLAmXp5voLLmKmhjbLzECsth1GIvI12JFz6IOW0XNywVzjM GA5WnXkz3Fjjq9VNlQ6H/Vgdna7nj7dsYxoWEZrX2X8j13LNiM0kHwHMiX2X/atu5Qcm wSv/5/e16lv8PVmS9kxiM52UWatOnRHX8jmWlSz9SPfxvnK0ul5BKEDcXFmsi0khSPrT sdw6lgv7ZCfiJI7tupN02siRo7OnB965XWQqRJ7pcI+e36Pw8LmSl08WrQy2Q1Ux2SMd zXyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=H1+rvHxEvB3kQarIsgedYGib4cdlYK4Q88kEvDCs/E4=; b=eZcXHiPHPNIBblI3aFp1+KzjctY4LipQaU+pH8P6jtd3/xAmM70nqs+CLzImbtFlRj jER3teVS/kj0qX1r1Otai4CsAX8/DqLPvgH4vckXVOMZMF2uMMbe89aJ2U9Qo9rRtGIr MPZ7Pd+HBpQ7mvkKG7AuARcxCbTMX+eVNnaGCEhHd7uWIUH61jNt6wnsHItm/pmBmJvm hqHfrSwunambZC+UDdbx4LuNrHU9IfltcJ2eUAEme34E5BHrfHJ7QeAOmwrkIvMmOuTm UQ1INltxBlfmfxbB8zQMbvrvlxWaNkk5X9IBS7Uwj3CCzFd6cLhBz0L9R46mmXLJGlBv j7+Q== X-Gm-Message-State: ACgBeo1kmRydukb6Y9+2JdP4tQePJ7XQPrwL63tYTYABWl2UW/X9g4q4 eSBpqsZ5WLh4tNQvsZ3qNtjMVBswYcc= X-Google-Smtp-Source: AA6agR51IYJ84/6kQptmcWbkql99jkNd11nOywf5li9LOquoDJwC2Pv19PcrxEQFGpi4PzbafwPCxQ== X-Received: by 2002:a05:620a:170c:b0:6bb:208c:d276 with SMTP id az12-20020a05620a170c00b006bb208cd276mr14322356qkb.539.1661915592356; Tue, 30 Aug 2022 20:13:12 -0700 (PDT) Received: from [192.168.1.35] (c-68-41-54-207.hsd1.mi.comcast.net. [68.41.54.207]) by smtp.gmail.com with ESMTPSA id bj4-20020a05620a190400b006b5c061844fsm9078109qkb.49.2022.08.30.20.13.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Aug 2022 20:13:12 -0700 (PDT) Message-ID: <016b2b74-2f94-e2e6-e1cc-e0bcb409c162@gmail.com> Date: Tue, 30 Aug 2022 23:13:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US-large To: ffmpeg-devel@ffmpeg.org References: <20220824151828.24218-1-george@nsup.org> <5520bdbb-0f14-8409-32c6-92c14fb8e8eb@gmail.com> From: Leo Izen In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter 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/30/22 15:37, Nicolas George wrote: > Leo Izen (12022-08-30): >> Is there a reason this is AVWriter wr = foo() and not AVWriter *wr = foo()? >> Most other APIs return pointers to structs, rather than structs themselves >> (see: av_packet_alloc). Using a pointer would prevent us from having >> sizeof(AVWriter) as part of the ABI, as was done with AVPacket. > > Yes: to return a pointer, you need somewhere to store the structure. One > of the point of AVWriter is that you can store it on the stack to avoid > dynamic allocations when the string is short enough. > > Note that AVWriter is exactly two pointers. It will always be two > pointers, and all the objects that I intend to introduce later will > always be two pointers: one const pointer for the methods, one pointer > for the object itself. > > This design is essential to the features I promised for AVWriter and for > later. > I don't see how you are planning on avoiding dynamic allocations by stack-allocating AVWriter when AVWriter itself only contains two pointers. I also don't see how this design is essential to the features you promised in a way that can't be done by just not making sizeof(AVWriter) part of the ABI and returning pointers to a struct. - Leo Izen (thebombzen) _______________________________________________ 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".