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 04E4946062 for ; Tue, 2 May 2023 16:53:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B52968C195; Tue, 2 May 2023 19:53:51 +0300 (EEST) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2618168C072 for ; Tue, 2 May 2023 19:53:44 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 342Grh9h000859 for ; Tue, 2 May 2023 18:53:43 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 48DCBEB5BF; Tue, 2 May 2023 18:53:43 +0200 (CEST) Date: Tue, 2 May 2023 18:53:43 +0200 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: <20230428095508.221826-1-george@nsup.org> <20230428095508.221826-2-george@nsup.org> <3106500.VeKRRRbgAb@basile.remlab.net> MIME-Version: 1.0 In-Reply-To: <3106500.VeKRRRbgAb@basile.remlab.net> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 02 May 2023 18:53:43 +0200 (CEST) Subject: Re: [FFmpeg-devel] [PATCH 2/8] lavu: new AVWriter 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: multipart/mixed; boundary="===============8378652088810483888==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8378652088810483888== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WBy91Ca2itbgqTwK" Content-Disposition: inline --WBy91Ca2itbgqTwK Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable R=E9mi Denis-Courmont (12023-05-02): > Indirecting the printf function seems pretty pointless. The last thing yo= u=20 Please re-read the code, there is no other way of obtaining a va_list =66rom an actual argument than making a call to a vararg function. > want are different implementations of printf() with different limitations= =2E And=20 > it makes writing different backends needlessly complex, while you could j= ust=20 > use vasprintf(). >=20 > Typically, with this kind of abstraction, only the raw bytes writing is= =20 > abstracted away. Examples include funopen() and fopencookie(). >=20 > As for hypothetical use cases whence vasprintf() wouldb e "too slow", the= n=20 > should not use printf()-style or function pointers to begin with. Besides= if=20 > you _really_ want to avoid the heap allocation, you can also use fopencoo= kie()=20 > on systems that provide it or equivalent. Being portable and not doing dynamic allocation are two major points of the design, so you will excuse me if I pass on that suggestion. > That sounds like it belongs in whichever backend actually wants to heap- > allocate the output buffer, not the frontend. There is nothing about heap allocation in this code. And if code can be in the framework common to all backends, then it is where it belongs, not duplicated in each backend. > This is an abstraction inversion (and also highly inefficient) + what I n= oted=20 > above. See above, it is necessary. (If you think it is not, try doing better.) > This is an analogue of puts/fputs, not "print". This is an analogue of puts, fputs and print, and I decided to call it print. > Same problems and overengineering as above. I think you are missing something important about the purpose of this code, but I cannot guess what exactly. Please be more detailed about why you think it is overengineered and point how you would do it simpler. Thanks for the comments. --=20 Nicolas George --WBy91Ca2itbgqTwK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6ooRQGBoNzw0KnwPcZVLI8pNxgwFAmRRQBUACgkQcZVLI8pN xgxTCw/+NMt/BcUYnBJJSMjCgCDUogIa5fY5RBnhbdLPwYBMhl/WLZN7mf14t0aS FAuaShcw3QR6LkmM2RdWqROFbnIGeK/ocawr6iiPHSZF9Vt7Pzm7LvHx3H2sWupT brw+LDS3FJYGAJibUBB0d9nPUqpWNa8s9VfiBHpiT7A/BjJI0dRNgXNJXb+X72fZ kw9rsUyt50TLV2Iu34IxPbzxbxSpWdWsDYAcmreCtW+0RJEkD4gNaxiLzrtwDT+J 5M1kBRuTEUc9RMf5S1LwX5yaqC0A919yTE5I42RRK2zzmt751ZZiaozIvX39FytP j0U41qkjXZ/u9DEpPKqn+KI4sPU6zsKBPIDb8+LZF8IS1IVlA0kVTvoa/Ts7OweQ UQN78+/9aGKbX5HnztNuJ8whfkfj6SH6pKUirTLlRH9RavUo1Ahj5ablskoI/94u os4u9W56vGCQqNw0xRNb2aVZHXf9tOq9E9NuVrVCKKK/W60xhhB4tISbHj6yhVAy 7IcvLs1Qh9hUDny5xy/v1W3ZydM4okhGgqBFT9CMZiI1VKsKhJ0TfsbPGUqKAyou O3mRIP18UvxyvYds0cVOln5VLjWGbKYovqXtk+z4NVGYsQDcYDUvr8KXxw51iIuY Nj9Ud2xFxVDOPU5BRqCdTupq9ZZ0m5oxmqbc1Ylto/gm7OULEC0= =4jBt -----END PGP SIGNATURE----- --WBy91Ca2itbgqTwK-- --===============8378652088810483888== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============8378652088810483888==--