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 DF0ED43570 for ; Thu, 16 Jun 2022 23:01:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1FA8068B875; Fri, 17 Jun 2022 02:01:38 +0300 (EEST) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 22A1668B815 for ; Fri, 17 Jun 2022 02:01:31 +0300 (EEST) Received: by mail-ej1-f45.google.com with SMTP id fu3so5463586ejc.7 for ; Thu, 16 Jun 2022 16:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UKmeO26Ndz7dOccFVfmY4rY4w1LUb63m8lYw/Cm8PCk=; b=o02weA6FuTcWZDAac+WzgLjsTwYdZ5a6ph8FS+s00y1XrQLF4NA3PZ0XqazOK+J7Un MSp6MsfaaVAWRLeCGzPrww2KreQUChp10NLN/uPnqyATCsbwevZAU5LZY4k6nYj6/ZrS IavX84tWyV+B6ZgVR7XBqbfYeQ4+SAL/mFFsw81l6oDL6Jq4d23Qh8cbymLc14nZZ7eP tFDhF+yrMR/j2EeUnRNTkBDgVx7mkO8p6DCFOLZEBaCMiYRSfxOAQ29+FjYHPEbW1oee oDRaJPeI8PM4LGxSwhv2xlWtPp+BPPMzPv/FXBAsxHOACY2tZRGt2RqRnQuSRCb19yNW PYKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=UKmeO26Ndz7dOccFVfmY4rY4w1LUb63m8lYw/Cm8PCk=; b=jAneE5LQVgUDMMH/1yfDiU+YYZzB0FuF/BD33J2e5g1IvnRAWizQN7+u71I3NzKxWL 2+L5DGCs2izPO8lDoWudD6iuVyxpBrl8KGNIIFZkOrApk9sSAZO45nGegCONSnKG/mRY maaIDsBYCyFLDdydVS/D2jykpUu5QLleEJFa0NZI0CDjVTWlfxlgOnG9Ypd1gqbqbBPk oB2s6e4X63LCfyjttRaSnO7q10wADLCX7tjXynjyHTR7/eY2jZs4SuJ3VUw6fzKvasIq MvpxlwLlkMlJ2JFyLZ/XpMHqNimTVd0JIObMuY07svF6MLpPNTgzZj4ktF/hYICsy4V7 fDOQ== X-Gm-Message-State: AJIora/c8txtaRNYlU3l6lDskpiWd9YTmwMOLdGQLgDPF7djjDcx4ZRm UZSrpVLURuN4kYG4L1UHbeCikw5IZL4= X-Google-Smtp-Source: AGRyM1txxSOcJXEs9MnRWnmcjNNSbDH1PgA4qMtXHcm0qiNArvQ9guAw82D0e2jgErS/3P1cbeNd2A== X-Received: by 2002:a17:906:5187:b0:712:477:df9b with SMTP id y7-20020a170906518700b007120477df9bmr6665234ejk.424.1655420490253; Thu, 16 Jun 2022 16:01:30 -0700 (PDT) Received: from mariano (dynamic-adsl-78-14-101-54.clienti.tiscali.it. [78.14.101.54]) by smtp.gmail.com with ESMTPSA id b6-20020aa7dc06000000b0042dc882c823sm2657787edu.70.2022.06.16.16.01.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 16:01:29 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id F1A1CBFA36; Fri, 17 Jun 2022 01:01:27 +0200 (CEST) Date: Fri, 17 Jun 2022 01:01:27 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20220616230127.GA173404@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: <20220615205649.GD11679@mariano> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.13.2 (2019-12-18) Subject: Re: [FFmpeg-devel] The case for a good string API 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: Hi Nicolas! On date Thursday 2022-06-16 17:47:40 +0200, Nicolas George wrote: > Stefano Sabatini (12022-06-15): > > Hi, and sorry for the long delay (I'll comment soon about the AVWriter > > API). > > Thanks. I was starting to despair that somebody else gives a damn about > it. > > > Before jumping to the discussion, probably it's good to think a bit > > about the bprint.h API and its limitations (the ones which come to mind > > are: no errors in case of truncation, and possible inefficiency due to > > the realloc). So while it covers the case for small strings (and it's > > not that bad IMO from the API point of view), probably it's underkill > > for data serialization. > > > > Do you have more in mind about its limitations? > > The limitations of BPrint were one of the motivations to start working > on this. But I am not sure what you are referring to exactly. > > BPrint already has a means to test for truncation in case of memory > allocation failure. I tried to make it a little harder to forget with > dynamic AVWriter, but it is a fine line between harder to forget and > annoying to use. Right, I completely forgot about it. > Regarding realloc(), I am even more confused: we cannot avoid a dynamic > allocation if the string is larger than the initial buffer. But AVWriter > goes a step further in that direction: if you want to write to a file or > to the network, it can do so on the fly, without using a dynamic buffer. I was thinking about mempool (and no, I don't think it's really neeeded for this use case). I still had to read the implementation, now I think I got what this is about. > > Also, is the new API supposed to be a replacement for AVBprint or is > > it supposed to live in parallel with it (to serve different purposes)? > > Eventually, I would like to have all useful features of BPrint in the > dynamic buffer AVWriter and deprecate BPrint, since that was written in > part to learn and do BPrint better. OK, sounds good. _______________________________________________ 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".