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 ESMTPS id 4B61F401A8
	for <ffmpegdev@gitmailbox.com>; Fri, 21 Feb 2025 13:09:58 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 906E668C664;
	Fri, 21 Feb 2025 15:09:53 +0200 (EET)
Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A647068C664
 for <ffmpeg-devel@ffmpeg.org>; Fri, 21 Feb 2025 15:09:46 +0200 (EET)
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 51LD9jPV016932
 for <ffmpeg-devel@ffmpeg.org>; Fri, 21 Feb 2025 14:09:46 +0100
Received: by phare.normalesup.org (Postfix, from userid 1001)
 id D54762EFDF; Fri, 21 Feb 2025 14:09:45 +0100 (CET)
Date: Fri, 21 Feb 2025 14:09:45 +0100
From: Nicolas George <george@nsup.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <Z7h7Gfp2ZOKUlnYp@phare.normalesup.org>
References: <pull.52.ffstaging.FFmpeg.1739959172.ffmpegagent@gmail.com>
 <0750b971f9ae0fc38917e0a3b3ccb7ad2e8cd221.1739959172.git.ffmpegagent@gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <0750b971f9ae0fc38917e0a3b3ccb7ad2e8cd221.1739959172.git.ffmpegagent@gmail.com>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (nef.ens.fr [129.199.96.32]); Fri, 21 Feb 2025 14:09:46 +0100 (CET)
Subject: Re: [FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_graphprint: Add
 options for filtergraph printing
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/Z7h7Gfp2ZOKUlnYp@phare.normalesup.org/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

softworkz (HE12025-02-19):
> From: softworkz <softworkz@hotmail.com>
> 
> The key benefits are:
> 
> - Different to other graph printing methods, this is outputting:
>   - all graphs with runtime state
>     (including auto-inserted filters)
>   - each graph with its inputs and outputs
>   - all filters with their in- and output pads
>   - all connections between all input- and output pads
>   - for each connection:
>     - the runtime-negotiated format and media type
>     - the hw context
>     - if video hw context, both: hw pixfmt + sw pixfmt
> - Output can either be printed to stdout or written to specified file
> - Output is machine-readable
> - Use the same output implementation as ffprobe, supporting multiple
>   formats
> 
> Note: This commit includes only the default and JSON writers.

This patch contains a lot of code copy-pasted from ffprobe. Moreover, it
is copy-pasted from 2018 ffprobe, with seven years of bugfixes omitted.
Copy-pasting non-trivial amounts of code is a big no, experienced
developers should know better. It is a big no among other reasons
precisely because bug fixes on one copy will likely be skipped on the
other copies.

When the same code is needed in multiple parts of the project, it needs
to be moved into a library with a proper API.

For JSON, and more generally ffprobe's writers, since it was quite
obvious we need structured output at other places than ffprobe, I had
started working on it. IIRC, I had the JSON output done, with no dynamic
allocations if the structure is not too deep. But of course, since it
uses strings, it requires a good strings API, which is being blocked.

Regards,

-- 
  Nicolas George
_______________________________________________
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".