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 BA9754841D
	for <ffmpegdev@gitmailbox.com>; Tue, 22 Apr 2025 21:57:49 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E6D7B689EA6;
	Wed, 23 Apr 2025 00:57:01 +0300 (EEST)
Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com
 [209.85.215.181])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F06D468A375
 for <ffmpeg-devel@ffmpeg.org>; Wed, 23 Apr 2025 00:56:35 +0300 (EEST)
Received: by mail-pg1-f181.google.com with SMTP id
 41be03b00d2f7-af548cb1f83so5504748a12.3
 for <ffmpeg-devel@ffmpeg.org>; Tue, 22 Apr 2025 14:56:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1745358994; x=1745963794; darn=ffmpeg.org;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :references:in-reply-to:message-id:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=UZ663wolBp9j6zmNQ7IeseKlZ4m77QQK7vyVN4UXDJs=;
 b=aopewylTgTlWKW0Yj5o198KngFDprCaBEshDCCtsM9dGBmBbm12LNbv97XNrl/fCJo
 JHvVAkmN0r1kg8vcwlutzj32HpU9x8gIUIcecfLJzRWm1Qi4hDk/30ck5cfO0dYFBTaB
 azGKFRVNNZodLAJEWMzepo3qf1qh9WQcMvqjZoiTtY4j7TJpsTdjEd91mIDNyGWcYvJx
 Enxtd8hACJ8I7ADfzHy72MqlIo9x8c2AjfKU4RoqdpfZozUlvVNJtcItLoNEIhokNLVE
 Nnsl5PYxsqh25pwHL5i2oNewfRNAtKsV6GSbjx4Hofn5lvWqnhOz9/2eUQ34+EFRJJvw
 6uZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1745358994; x=1745963794;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :references:in-reply-to:message-id:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=UZ663wolBp9j6zmNQ7IeseKlZ4m77QQK7vyVN4UXDJs=;
 b=TvVAyf+4DmrcLcVfK13GJHDYX3VQD7Yxr4nICkNQ1+HFxe/VT0Bw3N61kaaAgofMhe
 GXS0uuUN4tFBhZBi0xfugHXjX3Ruz1TXO5EmOUZemq1McJIOGQ1aIY+l+G9G94LHNwKH
 IbpZTCmhguspKVLYDNFy2RLtI5Vd3dUhq/WpJHW3uWqzIZHNBrXMWatfwcbq3f/UevEP
 oH1dIh+pV0SruCqNMVhZwYmEfwOwx/5p24u2bv0uY+4JPuHsAKNysr4CvMdvlUM+osS0
 rkID4orv5MbIxHvck1TXikHcVUqJELQw9bGsLMWJ1Siaf0LW9qHA3w+WcJHcS38azzND
 KuJQ==
X-Gm-Message-State: AOJu0Yx2rOMHY1SBRmPU7QwZZVnD6arIDFqS/f1WSCNKbxCEM+pROrWT
 4oM20cCZ2fEqh7IK/7Geqv3TNm1yx31e2nYaN2XF6Sc57nc7WWEBlPr/WCuh
X-Gm-Gg: ASbGncvflTp5Rq4cyKDbWXiBLQdw0CCaRMSjRCFrKEqdAk8WgkmJNOd8Juw8v98rxfQ
 QuWUu+3LWISCudPKy8v4v7Z0VB8NAaNdp2OaFBqIlywSInKsLOHVei9ULeel8KU/tYAB88XD9cN
 DUdQLgF5adxIyDDkOnRNKqgs7Hta4UIHM/6wzN6pHKgUR0JFQWTIgpq8ziPZcUMYdPNNBdZvdm3
 8tLpWgLEVCPQfCywp3EskKRrgyrPDurjIrBh6Z+iRTxEXn8oSuURw9trbOgjhQg3NwDWzXYDdFV
 Qf7v49XXH3UOzDZKUFU+9SiSVnD/zwD8OXNCOhqpJPg8wfLa416dN7Dgfe6S3z4isWvhLA==
X-Google-Smtp-Source: AGHT+IHCHLz7+AHs/HnvNXDgrbE9fRq8xbBD+83L6hVdmR5QjOOui2IdIJiarAp+5GKfeM3+ByyWmg==
X-Received: by 2002:a05:6a21:339d:b0:1fe:90c5:7cee with SMTP id
 adf61e73a8af0-203cbd0b686mr24601141637.28.1745358994121; 
 Tue, 22 Apr 2025 14:56:34 -0700 (PDT)
Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-b0db13cb3b5sm7840551a12.38.2025.04.22.14.56.33
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 22 Apr 2025 14:56:33 -0700 (PDT)
From: softworkz <ffmpegagent@gmail.com>
X-Google-Original-From: softworkz <softworkz@hotmail.com>
Message-Id: <1fe4a8fe6c5c52078c4781f015edd9b29db7edb4.1745358943.git.ffmpegagent@gmail.com>
In-Reply-To: <pull.66.v5.ffstaging.FFmpeg.1745358943.ffmpegagent@gmail.com>
References: <pull.66.v4.ffstaging.FFmpeg.1745189954.ffmpegagent@gmail.com>
 <pull.66.v5.ffstaging.FFmpeg.1745358943.ffmpegagent@gmail.com>
Date: Tue, 22 Apr 2025 21:55:37 +0000
Fcc: Sent
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH v5 08/14] fftools/textformat: Add function
 avtext_print_integer_flags()
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/1fe4a8fe6c5c52078c4781f015edd9b29db7edb4.1745358943.git.ffmpegagent@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: softworkz <softworkz@hotmail.com>

This function works analog to the avtext_print_string() which already
has a flags parameter.

Signed-off-by: softworkz <softworkz@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 217d9da25e..4dae024814 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -301,6 +301,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 05a358132e..c97a477fa9 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -147,6 +147,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-request@ffmpeg.org with subject "unsubscribe".