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 564744CDF9
	for <ffmpegdev@gitmailbox.com>; Mon, 14 Apr 2025 12:48:17 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 947E2687D02;
	Mon, 14 Apr 2025 15:47:40 +0300 (EEST)
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 307D7687C6E
 for <ffmpeg-devel@ffmpeg.org>; Mon, 14 Apr 2025 15:47:38 +0300 (EEST)
Received: by mail-pl1-f170.google.com with SMTP id
 d9443c01a7336-2260c91576aso34538425ad.3
 for <ffmpeg-devel@ffmpeg.org>; Mon, 14 Apr 2025 05:47:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744634857; x=1745239657; 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=cwDTSyUoK4Gs1V5TEnBtQf52u3X58ZGFEDczAxcPX/M=;
 b=maBTLGn3XNgFAg+RC8U8dYimII/GhSwC1n3HFf4NJQm1QDdVJtO0jZth9j54NbFbH9
 OgEsSzD9A3Ihg14wN8XHbcMcQpE/cRdz5dtAh1qDbiPgvIfMN5oMLu/Lii5qnJS6f7m4
 K1jnR+sm6/7p/iezWdOWlmFy40oP0rs+lXhRIOTQ5KIL53hpe4aHH3RDCqa5SScpGJ7m
 e5DqhZxvBkK2NaogZcDioCDlg2RljMDloJ+8MIO5K9I4FkpOnwy9oUlTDeVGS9ORGA3q
 CewnQIgjKDJJAu9yKPEP/pirnnTVLZXikEkNsgwlysKxy7xKUgCaR/8UU6J8nKvEZa4h
 Ivjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744634857; x=1745239657;
 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=cwDTSyUoK4Gs1V5TEnBtQf52u3X58ZGFEDczAxcPX/M=;
 b=HAKizxpSfqNI38wZ81lFrWCpKBMrUP0jcSguux2L/Yd2LEQsP8ue21eSemKXorF5Up
 dzgO5ypCCmrhjAlXG+8/Ocm+epc+jI31s4qLpyVgcf/bM3YMEdqJZOcDSSpTaFLwHZtx
 Fejg5sFFG14Pz+LkZKts4M7MSdLQwBbT1td2W/vSjOkwrDT3+cJcpSO3gzr/+BGxWdI8
 duBeInjsqgJiha/8TxLp5HSpnp7lQ1IJQPsiORMcddO6AJfYMgjO8VfOl9eklTnsF7cx
 eEFH0jjuv1vZp9wx3LB1FsxiDAgOMGYAN8cK/RcXoXSxzK4HzVuGORmqw15n2cbYErnR
 ZBVg==
X-Gm-Message-State: AOJu0YwuSQhyz1b+9+eI0wCXcj3wfGE0LIGCvfb7B9djPv0z+Crv7bq/
 atIugwkV0vDRMiK07Jm7LDIFdFiG6uQ/7FgDIeVMbuOQSHnmTp+dkV/0NQ==
X-Gm-Gg: ASbGnctpElavfmWLNT4ZjIxMkK9zHIAYCktOWIG1+u24+bTKzbCPrDMv7sDZENa4vf6
 qTV45gEj5vtgwB4fWmn1zfgfWsNM1gd48XEQElw3gXEWGpx8QcDz1j5H7Fj3ZTN1QuwbgS2IvXI
 /tpuomdtdSWTqUVq3/PbNBKNMqtMgTK9U9t9RHca6fb92/DkQUQDWRa57sA7V1Y4H4nzIbmKtBa
 4qMkTtlXq2uiwSwLtWE2u28vYVcTYrwf7OaLWWWrBvpFFMzBsGRX5bBdHLde5lA+Yg3OwYhcDdq
 pG3pNRdWRxUulwlskLgYuzqX03P4pcJdNexdQYMzePaO9XtKWyEyqDQeVmA=
X-Google-Smtp-Source: AGHT+IGEZ/v+/HthD5rd1bZXwINyMn12q0yJG2a7BwdZo8BZPqULpLPFXYx92+Uu5CRMTy39elFIEA==
X-Received: by 2002:a17:903:1450:b0:215:b1a3:4701 with SMTP id
 d9443c01a7336-22bea4ade2amr149059945ad.13.1744634857159; 
 Mon, 14 Apr 2025 05:47:37 -0700 (PDT)
Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-22ac7b8ea6csm98107485ad.97.2025.04.14.05.47.36
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 14 Apr 2025 05:47:36 -0700 (PDT)
From: softworkz <ffmpegagent@gmail.com>
X-Google-Original-From: softworkz <softworkz@hotmail.com>
Message-Id: <ce1191411c25940d1f94f7795fc2d7403370972e.1744634827.git.ffmpegagent@gmail.com>
In-Reply-To: <pull.66.ffstaging.FFmpeg.1744634826.ffmpegagent@gmail.com>
References: <pull.66.ffstaging.FFmpeg.1744634826.ffmpegagent@gmail.com>
Date: Mon, 14 Apr 2025 12:47:01 +0000
Fcc: Sent
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 4/9] 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/ce1191411c25940d1f94f7795fc2d7403370972e.1744634827.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 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-request@ffmpeg.org with subject "unsubscribe".