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 4F0E84E84B for <ffmpegdev@gitmailbox.com>; Thu, 8 May 2025 01:37:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A572368C044; Thu, 8 May 2025 04:37:11 +0300 (EEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2206F687DC6 for <ffmpeg-devel@ffmpeg.org>; Thu, 8 May 2025 04:37:05 +0300 (EEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-22e8461d872so5431855ad.3 for <ffmpeg-devel@ffmpeg.org>; Wed, 07 May 2025 18:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746668223; x=1747273023; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Nu0e2G+gAHf8unPU5G3OFX/6X/xuxK08a5Rwl6WUBHY=; b=RC/wTLlWXskrR+7SEIwflk2IRn+wBlLnYyjRlQYXZVSaE24Do80S1Z2x846z+mhwch LWpHhqXHgtrGcopwGl5h9+rdtCK343uWA4KR/PJ6SsoA0nGtM9lWnv8vR3lFk7iXvo3v BAd9LQpQKMVaSHpW5tjh9oGw98J6zh0rwnfU/pOo5RUd05hig3ekW3o2m/GVr1G/7Biz RASIuZbki9pBoHjOU8WG1AylzX4wpPxT3VtXVyfxkMPl0tjQqqh+vW4qSOy7Uyk74l/S OxfE84wBhbBjb0/6W0J2jZf6SpXqrvJaMVHrcRsmHusUonU5qNtnepjo0PHvaFlF6Spo dVjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746668223; x=1747273023; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nu0e2G+gAHf8unPU5G3OFX/6X/xuxK08a5Rwl6WUBHY=; b=YMNWg3iYXJPtoHVfSat6aSjnDVFEaw0kVaHiEKlDGfKX/L8gZH3p1JIksJdndUetlt bfXUlX4j71FRaMZibx1dLvVrIs98FeBG72QwxWItPzCfb1Fh/yHMLrwAVu7WzPLjdgQh 6/mRIzctP4n++2k28tR1YjwFOBWOv0A8ZgkCJK+QjGKZld4MVomCAJay2hdXsLq3nKkK Z2eIqgR42+e3/H55tXWv1pD5N0cI6A+fFYl/FmYqKxhxyq0XiVetP26ssO3v214qJwxN qMBG0aWsTids0f5VhGb1RT2fxhMjh00rpd+MdXFvdrpm3TuBp6hMawfX1Dxqs7ZA6HPR d/ew== X-Gm-Message-State: AOJu0YyXeZSEUWBD+qFtd5uesnsvKva3deRXwih0HFvFH3mirRHPglu/ 78EBFyPcGBzMDpUUZrRszAwkrj7U9XDIHfHUDgoFN8vn9r6S3xwpnEIfAw== X-Gm-Gg: ASbGnctnBK4m2bbeBQfJU1pe4bn0lWAiqHKV0joL2kW11JJQrUtAaCG99ql11XURlyk XgIhoXchoopGmlbBIudkpWdFvmxyf49KF4ggB7AOmK6qeHgiurRT1jIS2/GvYEVVPX6ar1kNegr CeDfSw3zeQ6RXBtfIM1d3DBRdpf6vI+3VGACDjnjOagrYNEyhvlc1N+m85GKYGhN93rb5kDpX4i +OvfB5f++UrifzeBOv3YYvfU3icjDTz8PXEAExg7DQnjvKC9loVQGfmA3d2JFRFC+zvC92XIn07 vm2Jm4tO4vSEoX/KHOS6ywLdYs/XKorPVk00LiljCFJjC5NdlTd5kMX2aVE= X-Google-Smtp-Source: AGHT+IEpUUySh8P2ffHgtii0NDXKC3Lrjp4DlpHNkfmLsWWRiFgzPmk1sRPGJYBGWPwdf1bWAbBflw== X-Received: by 2002:a17:903:2344:b0:220:e362:9b1a with SMTP id d9443c01a7336-22e862cbe06mr21703085ad.25.1746668222763; Wed, 07 May 2025 18:37:02 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b1fb3c6a4d1sm10157198a12.65.2025.05.07.18.37.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2025 18:37:02 -0700 (PDT) Message-Id: <pull.66.v12.ffstaging.FFmpeg.1746668216.ffmpegagent@gmail.com> In-Reply-To: <pull.66.v11.ffstaging.FFmpeg.1746398104.ffmpegagent@gmail.com> References: <pull.66.v11.ffstaging.FFmpeg.1746398104.ffmpegagent@gmail.com> From: ffmpegagent <ffmpegagent@gmail.com> Date: Thu, 08 May 2025 01:36:41 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v12 00/15] Execution Graph 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> Cc: softworkz <softworkz@hotmail.com> 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/pull.66.v12.ffstaging.FFmpeg.1746668216.ffmpegagent@gmail.com/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> Shortest cover letter for my longest-running FFmpeg patchset: * Apply * Build * Add the "-sg" switch to any FFmpeg command line * Press 'q' when you don't want to wait SG = Show Graph Documentation and examples can be found here: https://github.com/softworkz/ffmpeg_output_apis/wiki Version Updates =============== V2 == * Rebased on top of Andreas' improvements * Applied changes from review (thanks, Andreas) V3 == * Fixed all "new warnings" * Fixed out-of-tree building (thanks, Michael) V4 == * Resolved merge conflict * Fixed build on MinGW (missing include due to WIN32_LEAN_AND_MEAN being defined) (thanks, Michael) V5 == * Applied changes as per review from Stefano (thanks!) * Introduced AVTextFormatOptions struct for options in avtext_context_open() V6 == * Fix "new warning" in 2nd last commit * Squash patches 04 and 05 (they weren't truely independent) * Applied changes as per review from Stefano (thanks!) V7 == * Bitten by OOT builds once again (thanks, Michael) V8 == * New commit Remove void (*print_rational) from AVTextFormatter (unused) * New commit fftools/textformat: Rename name param to key for API consistency * print_int Extend existing function instead of adding print_int_flags * Fix registered_formatters[] array size * avtextwriters.h: Remove unused includes * graphprint.c: Make BPrint inits consistent * tf_json: Check nesting level for value printing * And other review suggestions by Stefano (thanks!) V9 == * Handle cases where no zlib is available (thanks, Michael) and provide configure switch (--disable-resource-compression) V10 === * Fix shared build by not using private URL API from avformat (thanks, Michael) V11 === * Resubmit because Patchwork was broken V12 === * Apply requested changes from review (thanks, Stefano) . softworkz (15): fftools/textformat: Apply formatting and whitespace changes fftools/textformat: Apply quality improvements fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter fftools/textformat: Rename name param to key for API consistency fftools/avtextformat: Re-use BPrint in loop fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open() fftools/textformat: Introduce common header and deduplicate code fftools/tf_internal: Use av_default_item_name fftools/textformat: Add flags param to function avtext_print_integer() fftools/ffmpeg_filter: Move some declaration to new header file avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx() fftools/resources: Add resource manager files with build-time compression fftools/ffmpeg_mux: Make ms_from_ost() inline fftools/graphprint: Add execution graph printing fftools/graphprint: Now, make it a Killer-Feature! configure | 5 + doc/APIchanges | 3 + doc/ffmpeg.texi | 14 + ffbuild/common.mak | 43 +- fftools/Makefile | 22 +- fftools/ffmpeg.c | 4 + fftools/ffmpeg.h | 4 + fftools/ffmpeg_filter.c | 195 +---- fftools/ffmpeg_filter.h | 234 ++++++ fftools/ffmpeg_mux.h | 2 +- fftools/ffmpeg_opt.c | 17 + fftools/ffprobe.c | 15 +- fftools/graph/filelauncher.c | 205 +++++ fftools/graph/graphprint.c | 1153 ++++++++++++++++++++++++++++ fftools/graph/graphprint.h | 62 ++ fftools/resources/.gitignore | 4 + fftools/resources/Makefile | 13 + fftools/resources/graph.css | 353 +++++++++ fftools/resources/graph.html | 86 +++ fftools/resources/resman.c | 231 ++++++ fftools/resources/resman.h | 50 ++ fftools/textformat/avtextformat.c | 239 +++--- fftools/textformat/avtextformat.h | 78 +- fftools/textformat/avtextwriters.h | 16 +- fftools/textformat/tf_compact.c | 117 +-- fftools/textformat/tf_default.c | 55 +- fftools/textformat/tf_flat.c | 51 +- fftools/textformat/tf_ini.c | 62 +- fftools/textformat/tf_internal.h | 81 ++ fftools/textformat/tf_json.c | 64 +- fftools/textformat/tf_mermaid.c | 658 ++++++++++++++++ fftools/textformat/tf_mermaid.h | 41 + fftools/textformat/tf_xml.c | 68 +- fftools/textformat/tw_avio.c | 18 +- fftools/textformat/tw_buffer.c | 9 +- fftools/textformat/tw_stdout.c | 10 +- libavfilter/avfilter.c | 9 + libavfilter/avfilter.h | 12 + 38 files changed, 3724 insertions(+), 579 deletions(-) create mode 100644 fftools/ffmpeg_filter.h create mode 100644 fftools/graph/filelauncher.c create mode 100644 fftools/graph/graphprint.c create mode 100644 fftools/graph/graphprint.h create mode 100644 fftools/resources/.gitignore create mode 100644 fftools/resources/Makefile create mode 100644 fftools/resources/graph.css create mode 100644 fftools/resources/graph.html create mode 100644 fftools/resources/resman.c create mode 100644 fftools/resources/resman.h create mode 100644 fftools/textformat/tf_internal.h create mode 100644 fftools/textformat/tf_mermaid.c create mode 100644 fftools/textformat/tf_mermaid.h base-commit: 1b643e3f65d75a4e6a25986466254bdd4fc1a01a Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-66%2Fsoftworkz%2Fsubmit_print_execution_graph-v12 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-66/softworkz/submit_print_execution_graph-v12 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/66 Range-diff vs v11: 1: 7e8fddd1b8 ! 1: 52f1c392b3 fftools/textformat: Formatting and whitespace changes @@ Metadata Author: softworkz <softworkz@hotmail.com> ## Commit message ## - fftools/textformat: Formatting and whitespace changes + fftools/textformat: Apply formatting and whitespace changes Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> @@ fftools/textformat/avtextformat.c: void avtext_context_close(AVTextFormatContext int use_value_prefix, int use_byte_value_binary_prefix, @@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form - av_dict_free(&opts); - } - -- if (show_data_hash) { -+ if (show_data_hash) - if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) { - if (ret == AVERROR(EINVAL)) { - const char *n; -@@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form + av_log(NULL, AV_LOG_ERROR, " %s", n); + av_log(NULL, AV_LOG_ERROR, "\n"); } - return ret; +- return ret; ++ goto fail; } -- } + } - /* validate replace string */ - { @@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form if (ret < 0) { AVBPrint bp; @@ fftools/textformat/avtextformat.c: fail: { tctx->level++; av_assert0(tctx->level < SECTION_MAX_NB_LEVELS); -@@ fftools/textformat/avtextformat.c: void avtext_print_section_header(AVTextFormatContext *tctx, - void avtext_print_section_footer(AVTextFormatContext *tctx) +@@ fftools/textformat/avtextformat.c: void avtext_print_section_footer(AVTextFormatContext *tctx) { int section_id = tctx->section[tctx->level]->id; -- int parent_section_id = tctx->level ? + int parent_section_id = tctx->level ? - tctx->section[tctx->level-1]->id : SECTION_ID_NONE; -+ int parent_section_id = tctx->level -+ ? tctx->section[tctx->level - 1]->id -+ : SECTION_ID_NONE; ++ tctx->section[tctx->level - 1]->id : SECTION_ID_NONE; if (parent_section_id != SECTION_ID_NONE) { tctx->nb_item[tctx->level - 1]++; @@ fftools/textformat/tf_compact.c: static void compact_print_section_header(AVText if (section->flags & AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE) { // add /TYPE to prefix @@ fftools/textformat/tf_compact.c: static void compact_print_section_header(AVTextFormatContext *wctx, const void * - char c = - (*p >= '0' && *p <= '9') || - (*p >= 'a' && *p <= 'z') || -- (*p >= 'A' && *p <= 'Z') ? av_tolower(*p) : '_'; -+ (*p >= 'A' && *p <= 'Z') -+ ? (char)(char)av_tolower(*p) -+ : '_'; - av_bprint_chars(section_pbuf, c, 1); - } } av_bprint_chars(section_pbuf, ':', 1); 2: 86ea1c4df5 ! 2: 0499b73c87 fftools/textformat: Apply quality improvements @@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext * ret = AVERROR(ENOMEM); goto fail; @@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form - av_log(NULL, AV_LOG_ERROR, " %s", n); - av_log(NULL, AV_LOG_ERROR, "\n"); - } -- return ret; -+ goto fail; - } /* validate replace string */ { @@ fftools/textformat/avtextformat.c: void avtext_print_section_header(AVTextFormat + } + int section_id = tctx->section[tctx->level]->id; - int parent_section_id = tctx->level - ? tctx->section[tctx->level - 1]->id + int parent_section_id = tctx->level ? + tctx->section[tctx->level - 1]->id : SECTION_ID_NONE; @@ fftools/textformat/avtextformat.c: void avtext_print_section_footer(AVTextFormatContext *tctx) void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val) 3: 455c13c6ff ! 3: 5b2106ad0d fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter @@ Metadata ## Commit message ## fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter + Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> ## fftools/textformat/avtextformat.h ## 4: 624ac50f29 ! 4: e599979391 fftools/textformat: Rename name param to key for API consistency @@ Metadata ## Commit message ## fftools/textformat: Rename name param to key for API consistency + Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> ## fftools/textformat/avtextformat.c ## 5: 26af65e6f2 ! 5: da6a27182d fftools/avtextformat: Re-use BPrint in loop @@ Metadata ## Commit message ## fftools/avtextformat: Re-use BPrint in loop - Instead of initializing a new BPrint in each iteration of - the loop, re-use the same BPrint struct and just clear it + Instead of initializing a new BPrint in case of UTF decode error, + re-use the same BPrint struct and just clear it for each iteration. + Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> ## fftools/textformat/avtextformat.c ## @@ fftools/textformat/avtextformat.c: void avtext_print_integer(AVTextFormatContext - const uint8_t *p, *endp; + const uint8_t *p, *endp, *srcp = (const uint8_t *)src; AVBPrint dstbuf; -+ AVBPrint bp_invalid_seq; ++ AVBPrint invalid_seq; int invalid_chars_nb = 0, ret = 0; + *dstp = NULL; av_bprint_init(&dstbuf, 0, AV_BPRINT_SIZE_UNLIMITED); -+ av_bprint_init(&bp_invalid_seq, 0, AV_BPRINT_SIZE_UNLIMITED); ++ av_bprint_init(&invalid_seq, 0, AV_BPRINT_SIZE_UNLIMITED); - endp = src + strlen(src); - for (p = src; *p;) { @@ fftools/textformat/avtextformat.c: void avtext_print_integer(AVTextFormatContext - av_log(tctx, AV_LOG_DEBUG, - "Invalid UTF-8 sequence %s found in string '%s'\n", bp.str, src); + -+ av_bprint_clear(&bp_invalid_seq); ++ av_bprint_clear(&invalid_seq); + -+ bprint_bytes(&bp_invalid_seq, p0, p - p0); ++ bprint_bytes(&invalid_seq, p0, p - p0); + -+ av_log(tctx, AV_LOG_DEBUG, "Invalid UTF-8 sequence %s found in string '%s'\n", bp_invalid_seq.str, src); ++ av_log(tctx, AV_LOG_DEBUG, "Invalid UTF-8 sequence '%s' found in string '%s'\n", invalid_seq.str, src); invalid = 1; } @@ fftools/textformat/avtextformat.c: static inline int validate_string(AVTextForma end: av_bprint_finalize(&dstbuf, dstp); -+ av_bprint_finalize(&bp_invalid_seq, NULL); ++ av_bprint_finalize(&invalid_seq, NULL); return ret; } 6: 3aa16bc39f ! 6: 4c0452cff7 fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open() @@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext * if (nb_sections > SECTION_MAX_NB_SECTIONS) { av_log(tctx, AV_LOG_ERROR, "The number of section definitions (%d) is larger than the maximum allowed (%d)\n", nb_sections, SECTION_MAX_NB_SECTIONS); -@@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form - av_dict_free(&opts); - } - -- if (show_data_hash) -+ if (show_data_hash) { - if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) { - if (ret == AVERROR(EINVAL)) { - const char *n; -@@ fftools/textformat/avtextformat.c: int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form - } - goto fail; - } -+ } - - /* validate replace string */ - { ## fftools/textformat/avtextformat.h ## @@ fftools/textformat/avtextformat.h: struct AVTextFormatContext { 7: 10c5e71cd1 = 7: dfbcbfaef9 fftools/textformat: Introduce common header and deduplicate code 8: 4c1471f65c = 8: 43189acea0 fftools/tf_internal: Use av_default_item_name 9: 7d28b0f03c = 9: 4d4748bb4c fftools/textformat: Add flags param to function avtext_print_integer() 10: a0d38f429a = 10: 493ed24e9e fftools/ffmpeg_filter: Move some declaration to new header file 11: 53db985728 = 11: 997d93b0b4 avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx() 12: 2405f535bf = 12: ed92ac7577 fftools/resources: Add resource manager files with build-time compression 13: a7576bbbfc = 13: 32887c68e8 fftools/ffmpeg_mux: Make ms_from_ost() inline 14: 1bdd305940 = 14: 2ba841ad80 fftools/graphprint: Add execution graph printing 15: 4e04962fb4 = 15: f1cfa5fc2a fftools/graphprint: Now, make it a Killer-Feature! -- 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".