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 8F5BD4D427 for <ffmpegdev@gitmailbox.com>; Fri, 18 Apr 2025 02:58:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8F74468A995; Fri, 18 Apr 2025 05:57:41 +0300 (EEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D957F68A56A for <ffmpeg-devel@ffmpeg.org>; Fri, 18 Apr 2025 05:57:40 +0300 (EEST) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-739be717eddso1179812b3a.2 for <ffmpeg-devel@ffmpeg.org>; Thu, 17 Apr 2025 19:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744945059; x=1745549859; 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=9B71ommJoKAj6AVwLso1fz+tmpK2i3JP/RxJeHfscZo=; b=YoTISDiUNMRT8wd74ms7kMj1fqgmznptvP0CgWzMcaVcwDKmPF3QFDAgAin9HWyxrr U7pU91q8NztV8bYgyMNPO1t50CC+6qM2FEX06MmjHCrqE0Ocmyf3H36oCHGYyhkvAE0A zQvz0Ogw+0pf8c3LYB8waizFcem8/hqQjb1H2Y+Enrxi2kjsYyD93uR+A6LYOKx7AIyM dek+GcjI8i79y/B/CAgDPk/zy6QwrGPYYGoy8uDIzZCsyQ6tQLPeU9Ikdn8CzQD4+jyB 6B/X0nFa3bRhTqtS32jHXb9ysn6fjddM8fl4ndfEAck0/EbQGY92iHUK/COn5YXrQgnN W//g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744945059; x=1745549859; 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=9B71ommJoKAj6AVwLso1fz+tmpK2i3JP/RxJeHfscZo=; b=IYo7bPibTCHnHJsCefmKmGpYbf5UYQU7hl4D2VbxychziI3/CBB5v3KerzutaRd4eB rl4+xEXanpNo9CopITHw9uxZx98jBgp+jQz5NimOnVXulYrX+kdJ0CKTcvK3zcIovwZ1 XOcdoT8VzvxVJBshOJnNZUUCOkJ0E00JYRhZtMsxrKCNH7LAiqYouG0BHDv/0l2s6jnK gvhQZZjCDuNvQXPzrRYFa20XJUszOZLH4rRnPRqfkBLYDmpIiFkHlnk/3DI8Cp2lsoxn kEcuOELHs8sYxMKv7XvXgACOvlghYBl6ErIK7hJmleKeVticeLoiMPfeQFku0u35EzFP E/SA== X-Gm-Message-State: AOJu0Ywmdz2ooAgwdDyLoyqcYG+rILHiyUXnnQpDY067Y9N9e1VZUHEs H18xGsgGw/wvm1221T0TRRbBU4uQUfaM3ecAxjQ7X1/ESjly+T3NgVyqjA== X-Gm-Gg: ASbGncsfrae2Te9TjfvjbUFF/DK9ypGTMQMP/hsgQ10Wa7vGsF9QNRThlc2du85X+sS SR0Uz1qZPDaAoDfTO2BB17bINBtj1OxXAOCJp+hfUO/RE9xw2UkD+w8YZea/IDggQlNo5KtqfnJ pFAgIvLguD3COjPAq/O0dSrQ85BKthB8jgIDMQEn++BS+o+qtRNkTmZNqTUnMXtu/xcQGCwx22l Fg8zE3c/ow/TtAVtym9dAT9nHgKTmMAt/t9tTR35U02FoJFU3y5FSJ/QFsZ2I/lAmXe2VQT6Xv4 ZGlZtNI1jQwOS6Y/63LlNzH2I8O9ST41M3PzftWZ/Ect4pLj7Nm3VqIH4X8= X-Google-Smtp-Source: AGHT+IFfqTor0CfUdtv9rMTPdao2I36mgCJGQNnDnOvMAXIxlo1t6sUpttEy8KYAKZF6HqEOJd/6Sg== X-Received: by 2002:a05:6a00:130d:b0:736:47a5:e268 with SMTP id d2e1a72fcca58-73dc147bc16mr1456268b3a.1.1744945058929; Thu, 17 Apr 2025 19:57:38 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73dbf8c03b2sm645071b3a.7.2025.04.17.19.57.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Apr 2025 19:57:38 -0700 (PDT) From: softworkz <ffmpegagent@gmail.com> X-Google-Original-From: softworkz <softworkz@hotmail.com> Message-Id: <a3fe7abcfee2b68d9fe269aaf8c03ccc8feefb39.1744945024.git.ffmpegagent@gmail.com> In-Reply-To: <pull.66.v3.ffstaging.FFmpeg.1744945024.ffmpegagent@gmail.com> References: <pull.66.v2.ffstaging.FFmpeg.1744798340.ffmpegagent@gmail.com> <pull.66.v3.ffstaging.FFmpeg.1744945024.ffmpegagent@gmail.com> Date: Fri, 18 Apr 2025 02:56:58 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v3 05/11] 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/a3fe7abcfee2b68d9fe269aaf8c03ccc8feefb39.1744945024.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 893b11298e..d2d84c4f1d 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 aea691f351..16cd9b214f 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".