From: softworkz <softwo...@hotmail.com> This function works analog to the avtext_print_string() which already has a flags parameter.
Signed-off-by: softworkz <softwo...@hotmail.com> --- fftools/textformat/avtextformat.c | 21 +++++++++++++++++++++ fftools/textformat/avtextformat.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/fftools/textformat/avtextformat.c b/fftools/textformat/avtextformat.c index 406025d19d..b862b70d9f 100644 --- a/fftools/textformat/avtextformat.c +++ b/fftools/textformat/avtextformat.c @@ -311,6 +311,27 @@ void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t va } } +void avtext_print_integer_flags(AVTextFormatContext *tctx, const char *key, int64_t val, int flags) +{ + const AVTextFormatSection *section; + + if (!tctx || !key || tctx->level < 0 || tctx->level >= SECTION_MAX_NB_LEVELS) + return; + + section = tctx->section[tctx->level]; + + if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER || + (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO + && (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL) + && !(tctx->formatter->flags & AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS))) + return; + + if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) { + tctx->formatter->print_integer(tctx, key, val); + tctx->nb_item[tctx->level]++; + } +} + static inline int validate_string(AVTextFormatContext *tctx, char **dstp, const char *src) { const uint8_t *p, *endp, *srcp = (const uint8_t *)src; diff --git a/fftools/textformat/avtextformat.h b/fftools/textformat/avtextformat.h index e519094f4f..391ecdb624 100644 --- a/fftools/textformat/avtextformat.h +++ b/fftools/textformat/avtextformat.h @@ -139,6 +139,8 @@ void avtext_print_section_footer(AVTextFormatContext *tctx); void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val); +void avtext_print_integer_flags(AVTextFormatContext *tctx, const char *key, int64_t val, int flags); + int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char *val, int flags); void avtext_print_unit_int(AVTextFormatContext *tctx, const char *key, int value, const char *unit); -- 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-requ...@ffmpeg.org with subject "unsubscribe".