aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/textformat
Commit message (Collapse)AuthorAgeFilesLines
* fftools/textformat: remove unreachable code in tf_mermaidMarvin Scholz2025-07-051-4/+1
| | | | | | | | | Integer writing is impossible here as the first branch was dead code, so remove it completely. Fix CID 1646948 Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: renamings in print_unit_int for consistency (cosmetic)Nicolas Gaullier2025-06-272-3/+3
| | | | | Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: fix print 64 bit integersNicolas Gaullier2025-06-272-2/+2
| | | | | | | | | | | Regression in ffprobe since textformat introduction in d7a3f68feae0b1c3718f9d2671c6d41c60a40680. Fixes #11638 Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Reviewed-by: Marvin Scholz <epirat07@gmail.com> Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: do not return earlyMarvin Scholz2025-06-261-1/+0
| | | | | | | | | This would make the goto dead code and also would not properly call avtext_context_close. Fix CID 1646939 Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: remove noop freeMarvin Scholz2025-06-261-2/+0
| | | | | | The tctx->hash was freed already right before. Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: narrow variable scopesMarvin Scholz2025-06-261-9/+6
| | | | Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: remove leftover comments in mermaid_print_valueMarvin Scholz2025-06-261-4/+1
| | | | | | Remove some leftover commented code and an extraneous semicolon. Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: exit early in mermaid_print_valueMarvin Scholz2025-06-261-10/+2
| | | | | | | Doesn't change the logic, instead of exiting in each of the two branches below, just exit before. Reviewed-by: softworkz <softworkz@hotmail.com>
* fftools/textformat/avtextformat: Fix races when initializing formattersAndreas Rheinhardt2025-06-021-21/+12
| | | | | Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Avoid relocationsAndreas Rheinhardt2025-06-021-2/+2
| | | | | Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/graph/graphprint: Fix races when initializing graphprintAndreas Rheinhardt2025-06-021-2/+5
| | | | | | | | | | | | | Setting print_graphs_format (in case no -print_graphs_format option was specified) is racy, as is using av_strtok() to split it. Both have been removed. Notice that using av_strtok() was destructive: In the absence of races the options would only have been applied for the first initialization. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/tf_mermaid: Add missing uninit and fix leakssoftworkz2025-05-281-8/+37
| | | | | | | | - merge forgotten uninit from work branch - add set_str() function to free before overwriting - fix some other leaks Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: correctly propagate uninit error codesMarton Balint2025-05-164-6/+8
| | | | | | This allows catching IO errors occuring at file close. Signed-off-by: Marton Balint <cus@passwd.hu>
* Revert "fftools/textformat/avtextformat: Make close functions return void"Marton Balint2025-05-163-6/+10
| | | | | This reverts commit 7684243fbe6e84fecb4a039195d5fda8a006a2a4 and a888975a3c25760027cd59932f5c1ad04368db8b.
* fftools/graphprint: Add execution graph printingsoftworkz2025-05-154-1/+731
| | | | | | | | | | | | | | | | | | | | | 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 Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: Add flags param to function avtext_print_integer()softworkz2025-05-152-7/+19
| | | | | | | Make this function work analog to avtext_print_string() which already has a flags parameter. Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/tf_internal: Use av_default_item_namesoftworkz2025-05-151-5/+1
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: Introduce common header and deduplicate codesoftworkz2025-05-1511-141/+160
| | | | | | | | | Also change writer_printf signature in AVTextWriter to use va_list, so that it can be called by the new function writer_printf() in tf_internal.h. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()softworkz2025-05-152-19/+15
| | | | | | | | This allows future addition of options without changes to the signature of avtext_context_open(). Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/avtextformat: Re-use BPrint in loopsoftworkz2025-05-151-9/+14
| | | | | | | | | 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: Rename name param to key for API consistencysoftworkz2025-05-152-10/+10
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: Remove unused print_rational() pointer from AVTextFormattersoftworkz2025-05-152-6/+0
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: Apply quality improvementssoftworkz2025-05-157-45/+82
| | | | | | | | | | | | Perform multiple improvements to increase code robustness. In particular: - favor unsigned counters for loops - add missing checks - avoid possible leaks - move variable declarations to inner scopes when feasible - provide explicit type-casting when needed Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat: Apply formatting and whitespace changessoftworkz2025-05-159-156/+172
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
* fftools/textformat/avtextformat: Remove unused variableAndreas Rheinhardt2025-04-171-1/+0
| | | | | | | Forgotten in a888975a3c25760027cd59932f5c1ad04368db8b. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Make close functions return voidAndreas Rheinhardt2025-04-163-9/+6
| | | | | | | Just like normal close functions. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Add missing AVERROR()Andreas Rheinhardt2025-04-161-2/+2
| | | | | Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Initialize stuff earlierAndreas Rheinhardt2025-04-161-6/+6
| | | | | | | | | | | | | avtext_context_close() calls av_opt_free() on an AVTextFormatContext as well as av_bprint_finalize() on the containing section_pbuf AvBPrints, yet it can happen that the AVBPrints have not been initialized (only zeroed) and that av_opt_set_defaults() has not been called. This works, but it is not really documented to do so. So ensure that the options and the AVBPrints have been initialized when avtext_context_close() is called. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Fix segfault upon allocation errorAndreas Rheinhardt2025-04-161-4/+6
| | | | | | | | Would happen if an AVTextFormatContext's private context could not be allocated. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Fix segfault upon allocation errorAndreas Rheinhardt2025-04-161-4/+6
| | | | | Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* textformat/tw_avio: Remove close_on_uninit param from create_fileAndreas Rheinhardt2025-04-162-3/+3
| | | | | | | | | | avtextwriter_create_file() creates an AVIOContext whose pointer resides in its private context. If it were not always closed on uninit, the AVIOContext would leak, so it makes no sense to have this parameter. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/tw_avio: Use avio_closep()Andreas Rheinhardt2025-04-161-3/+2
| | | | | | | Avoids leaving dangling pointers behind. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/tw_avio: Don't flush unnecessarilyAndreas Rheinhardt2025-04-161-1/+0
| | | | | | | avio_close() automatically flushes the AVIOContext. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/tw_avio: Remove unused private classAndreas Rheinhardt2025-04-161-12/+3
| | | | | | | This AVTextWriter does not have any options. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat: Use "", not <> for lavu headersAndreas Rheinhardt2025-04-166-30/+16
| | | | | | | Also remove unused headers. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat/avtextformat: Simplify avtext_print_rational()Andreas Rheinhardt2025-04-161-4/+3
| | | | | | | | Use snprintf() directly instead of initializing an AVBPrint just for this. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/textformat: Extract and generalize textformat api from ffprobe.csoftworkz2025-04-1112-0/+2411
Signed-off-by: softworkz <softworkz@hotmail.com>