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 ESMTPS id 32BE94D9C3 for ; Thu, 27 Feb 2025 14:01:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E27CC68CCAF; Thu, 27 Feb 2025 16:01:54 +0200 (EET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE25268C79C for ; Thu, 27 Feb 2025 16:01:48 +0200 (EET) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2234bec7192so24586895ad.2 for ; Thu, 27 Feb 2025 06:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740664907; x=1741269707; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=ihXKQ0YdnS2YPBb8Hw1uk7wmSiQbP1RqOak8SrgzoEM=; b=J1a1teNSLVPZCMFEPnWVmiMX8Efs1Nj0bae8FGAR2PezPwk/+k6tLAK1kaG8AfU18O l5QhE4vax3zUoyF/oTzObYhwVth5pDFI+YuI2+4d4rNITjoIrpeSN4sUcGryKPrbnRuF N9MbbxnuIM9Id3nRqKpZddRyNhiK18GAjKKOyooRQGeiSDScze1soiLjASsYs7C26JZv 4Kz99E3L4jk1EU5TjBe3kZjNq8d9+vnwz/BZTe45l4qHyJSWmyE9+ZGZoj20MBTxnTTa BNHOtYstY/CiCuSQ72V4ejPOyYCg7CY+voGO5jS1S6JNenZ3Ts1tI+7dBG/odZqv3PfM Y7Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740664907; x=1741269707; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ihXKQ0YdnS2YPBb8Hw1uk7wmSiQbP1RqOak8SrgzoEM=; b=sBetQJ5Bgo6E+2a3CIdxojZ0bbVt6joS6ARHDa+mI6gUBsGZ3NnEqZRz8OV0Mia40I sXpmNt+iTELyC/NvUneY5k0C70wV+4trteXL+InZm8KjYq/r650VNi7SK+hfKPcUQNWt d7KRB4F/zXzK1TMbX4+/SxRsrjPoAPc2sjEIoZ9htCM+6Q94sgwhPR/zOl0ZF8j3vImJ dWVkDEYQwyFD/mdOA/mXB646pNaJYJUWYgog4N5KX9r0lUBOjrSfCN0NEg8GRzLHjqLt OoxHLum0neyN8nbUfPBoOtsgvEf5goiu7MsQ+DQ752ZdJN3685KP/XtEvz54aAwaFsgZ pVJw== X-Gm-Message-State: AOJu0Ywr/nNj2yG7ih8a5Wg/Du/FiYL9NOBH+yZZsWruIox8HNBiEF5r jV2b7sYJRrKDa4rqvfUhyxLSoN+2NIi9u9ED6ksAlzU/IPUVXKX9EtpqwQ== X-Gm-Gg: ASbGncspWli3AEuaSPWgKWBHdvSayTHb4yl0rg5lQz4SCn4n8iqKtppU9VK1cRnXmbK DyC+Kg5bTm2dyoSfMnZaMHr9ecMSMPN0qSFMT70d6q9t4h3Gxy3W58MIiawS4Zaoxhl0XdqCvLn mDVukNlncQCF1X7D9W7ve8cjH8lJMrIR8pucae/BYAGpSPaQDE4dYtMFayCMSdDPQdddRL2BzOv TBBdQuz8mnxYSlY0agxFuIzGUBJnz6wDjnlVVln3obVgXiNFn+O4zt2/7ojE3+RmNb8D54d+NU9 jdvZYAdLZgkfGsHCMw4aq1rwoJFlV797CP9RbU5nCy5I X-Google-Smtp-Source: AGHT+IH5y2IliWcLJlElCcEqjU3KJF05lIUyqOPzU+VaHEq6uoQkDdTh0mZHwTLjIPWXXnbY/eErLw== X-Received: by 2002:a05:6a00:1493:b0:730:91b8:af1 with SMTP id d2e1a72fcca58-7348be367c2mr12252181b3a.18.1740664906731; Thu, 27 Feb 2025 06:01:46 -0800 (PST) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-aee7de1ac92sm1410761a12.28.2025.02.27.06.01.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Feb 2025 06:01:46 -0800 (PST) Message-Id: From: ffmpegagent Date: Thu, 27 Feb 2025 14:01:32 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 0/8] [RFC] avtextformat: Transform text writing into an independent 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 Cc: softworkz 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: Hello everybody, this is an effort to pull out the text writing code from ffprobe and shape it as an independent API. To avoid any other big refacoring in the future, this patchset is building it up as a public API in avutil, but it's not that I would be insisting this to happen (or maybe not yet). It could very well remain private and only shared by ffprobe and ffmpeg (filtergraph printing) for the time being. Would like to know what people are thinking about - specifically and in general. This patchset doesn't aim to improve or change the API itself - that would be a bit too much at once. The primary functional changes made were those which were required to gain independence of the specific way of use inside ffprobe - without causing any change to the output. Locally, I had some failing FATE tests locally but the CI build with FATE (here on GitHub) finished without error. Non-functional changes are naming, made in the spirit of ramping up for becoming a public API (possibly), and there's also a separation of functionality: Currently, everything is called "writer" in some way, without making any distinctions. The main change is that there are now: * Text Formatters: AVTextFormatter and AVTextFormatContext These are obviously in charge of formatting the output (csv, json, xml, compact, etc.) * Text Writers: AVTextWriter and AVTextWriterContext Responsible for writing the formatted text somewhere. Currently 3 writers exist * stdouwriter * aviowriter - can output to a file or to an existing avio context * bufferwriter - writes to a provided AVBprint buffer I'll be happy about any hints or comments! Known Issues * Mixes avutil and fftool changes in commits (I kept it preliminarily like that as it's easier to follow. Otherwise it would be a huge single commit to ffprobe.c) * No changelog, ApiChange entries and version bumps * Public API isn't documented yet * Some variables haven't been renamed yet (like wctx to tctx) * Not sure whether every single commit builds successfully, the final one does Open Questions * I'm not sure about the best way to expose the formatters and writers to consumers Currently, there's still the register_formatter() way in ffprobe.c and writers are accessible only via creator functions (like avtextwriter_create_avio) * There are two header files (avtextformat.h, avtextwriters.h), reflecting the separation betwen formatters and writers and a separate code file for each formatter and writer, all in a subfolder named textformat. Not sure what the preferences are, it was hard to find a comparable precedence. Will change when asked to. * Do we want flags to be #defines always or can they be enums? * Will it need a public/private separation (like recently introduced for other entities)? Thanks softworkz (8): ffprobe/avtextformat: Rename and move writer structs ffprobe/avtextformat: Rename and move writer functions and options ffprobe/avtextformat: Generalize ffprobe specifics ffprobe/avtextformat: Rename flags and enums ffprobe/avtextformat: Move flags ffprobe/avtextformat: Rename writer to formatter ffprobe/avtextformat: Move formatters to avutil ffprobe/avtextformat: Split out text writers as independent classes fftools/ffprobe.c | 2188 ++++----------------------- libavutil/Makefile | 12 + libavutil/avtextformat.h | 170 +++ libavutil/avtextwriters.h | 68 + libavutil/textformat/avtextformat.c | 641 ++++++++ libavutil/textformat/tf_compact.c | 285 ++++ libavutil/textformat/tf_default.c | 150 ++ libavutil/textformat/tf_flat.c | 177 +++ libavutil/textformat/tf_ini.c | 165 ++ libavutil/textformat/tf_json.c | 220 +++ libavutil/textformat/tf_xml.c | 224 +++ libavutil/textformat/tw_avio.c | 129 ++ libavutil/textformat/tw_buffer.c | 91 ++ libavutil/textformat/tw_stdout.c | 82 + 14 files changed, 2737 insertions(+), 1865 deletions(-) create mode 100644 libavutil/avtextformat.h create mode 100644 libavutil/avtextwriters.h create mode 100644 libavutil/textformat/avtextformat.c create mode 100644 libavutil/textformat/tf_compact.c create mode 100644 libavutil/textformat/tf_default.c create mode 100644 libavutil/textformat/tf_flat.c create mode 100644 libavutil/textformat/tf_ini.c create mode 100644 libavutil/textformat/tf_json.c create mode 100644 libavutil/textformat/tf_xml.c create mode 100644 libavutil/textformat/tw_avio.c create mode 100644 libavutil/textformat/tw_buffer.c create mode 100644 libavutil/textformat/tw_stdout.c base-commit: 99e2af4e7837ca09b97d93a562dc12947179fc48 Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-56%2Fsoftworkz%2Fsubmit_textformat-v1 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-56/softworkz/submit_textformat-v1 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/56 -- ffmpeg-codebot _______________________________________________ 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".