预防高原反应吃什么药| 飞地是什么意思| 露酒是什么意思| 绿豆汤有什么功效| 什么是纤维化| 炎性结节是什么意思| 口臭口干口苦是什么原因| 女人左手心痒预示什么| 雌激素是什么东西| 白砂糖是什么糖| 苏小小属什么生肖| 情绪是什么意思| 屁股长痣代表什么| 授记是什么意思| 脚筋疼是什么原因| 幻灭是什么意思| 姐姐的小孩叫什么| 翡翠是什么材质| 嘴干嘴苦是什么原因| 腿经常抽筋是什么原因| 太多的借口太多的理由是什么歌| 汽车abs是什么意思| 什么是gmp| 占是什么意思| 贪心不足蛇吞象什么意思| 脚底痛挂什么科| 6.1号是什么星座| 高血压适合吃什么水果| 什么是纯净水| 阴道炎症用什么药| 小孩子流鼻血是什么原因| 体测是什么意思| 孕妇查凝血是检查什么| 痛风有什么不能吃| 1977年五行属什么| 怀孕10多天有什么症状| 下颌骨紊乱挂什么科| 唇炎应该挂什么科室| 取环后月经量少是什么原因| 抄送和密送是什么意思| 马华读什么| 特斯拉发明了什么| 喉咙痒干咳吃什么药| 肾阳虚有什么症状男性| 第一次见面送女生什么花| 正月十六是什么星座| 怀孕初期什么症状| 臃肿是什么意思| 什么辣椒香而不辣| 血压的低压高是什么原因| 耳鸣吃什么药效果好| 口腔异味是什么原因引起的| 梦见大火是什么意思| 吃什么治便秘| 96年是什么年| 姑婆的儿子叫什么| 喝什么养胃最好| 鱼和熊掌不可兼得什么意思| 听雨是什么意思| 梦见着火了是什么征兆| 钙化是什么意思| 灵芝有什么作用| 清晨醒来口苦是什么原因| 双规什么意思| 工匠精神是什么| 湿疹为什么要查肝功能| 彩铅是什么| 虫字旁与什么有关| 条线是什么意思| 尿多是什么问题| 向日葵代表什么象征意义| 广东话扑街是什么意思| 骨钙素是什么| 一个月一个太念什么| 39年属什么生肖| 戒备心是什么意思| 宝宝吃什么鱼比较好| 落子无悔是什么意思| 指甲横纹是什么原因| 什么样的大便是正常的| 手机为什么没信号| 肝血管瘤挂什么科| 香港为什么不用人民币| 七月份可以种什么菜| 什么是滑档| 阿达子是什么| 乳腺应该挂什么科| 女人大姨妈来了吃什么最好| fsh是什么意思| 玉树临风是什么意思| 乳腺炎不能吃什么| 三sprit是什么牌子| 微白蛋白高是什么情况| 为的笔顺是什么| 肚脐眼位置疼是什么原因| 女人吃鹅蛋有什么好处| 10月24是什么星座| 脚趾发紫是什么原因| 智齿长什么样子图片| 久旱逢甘露是什么意思| 闲聊是什么意思| 白色病变是什么病| 考上公务员意味着什么| 屁眼火辣辣的疼是什么原因| 猫叫是什么原因| 神经衰弱吃什么药好| 何首乌泡酒有什么作用| 下肢动脉硬化吃什么药| 血清铁蛋白低说明什么| 丹参粉有什么作用和功效| 医院特需门诊什么意思| 扁桃体发炎能吃什么水果| 白毫银针属于什么茶| 三叉神经痛吃什么药效果好| 含量是什么意思| 宫寒可以吃什么水果| 公主病是什么意思| 是什么数学符号| 外传是什么意思| 来月经腰酸腰痛什么原因造成的| 湿热带下是什么意思| 小朋友流鼻血是什么原因| 高血压用什么药| 什么解酒| 咽炎挂什么科室| 667什么意思| 素来是什么意思| 一什么方向| 威海的海是什么海| 去医院打耳洞挂什么科| 婴幼儿屁股红擦什么| adhd是什么| 原始鳞状上皮成熟是什么意思| 68年属猴是什么命| 为什么男生| saba是什么药| eoa是什么意思| 1870年是什么朝代| 03年属什么生肖| screenx影厅是什么| 10月24是什么星座| 电视为什么打不开| 灰指甲用什么药最有效| 胸口不舒服是什么原因| 脑ct挂什么科| 手指伸不直是什么原因| 中国什么时候灭亡| 1948年中国发生了什么| 家庭油炸用什么油好| seeya是什么意思| sq是什么意思| 孩提是什么意思| 黑壳虾吃什么| 糖类抗原125偏高说明什么| 鼻衄是什么意思| 咽口水喉咙痛吃什么药| 什么是m属性| 半熟芝士是什么意思| 悠着点是什么意思| 吽是什么意思| 金贵肾气丸治什么病| 一致是什么意思| 乐五行属什么| cg动画是什么意思| 张少华什么时候去世的| 嫁妆是什么意思| 眉头长痘痘是因为什么原因引起的| 养肝吃什么药| 缺少雌激素的女性会有什么症状| 泥鳅吃什么| 天然气是什么气体| 上校是什么级别| 计数是什么意思| 血小板计数偏高是什么意思| 氯偏高是什么原因| 乙肝抗体阴性什么意思| 什么是结扎| 古人的婚礼在什么时间举行| 头皮毛囊炎用什么药| 脂溶性是什么意思| 37属什么| 桃李满天下是什么意思| 蛟龙是什么意思| 什么是负数| 马蹄什么季节上市| 黄豆什么时候种| 梦见打老鼠是什么征兆| 石英岩质玉是什么玉| 做什么菜适合放胡椒粉| 漂白粉是什么| 含锶矿泉水有什么好处| 腋窝疼是什么原因| 一只眼皮肿是什么原因| 梦见自己的手镯断了什么意思| 行善积德是什么生肖| 脸上浮肿是什么原因导致的| 买二手苹果手机要注意什么| 胎儿顶臀长是什么意思| 黄痰吃什么药最好| 血管鼓起来是什么原因| 英语介词是什么意思| 新生儿什么时候可以喝水| 198是什么意思| 仰卧起坐有什么好处| 积是什么| 人中发红是什么原因| 诺如病毒是什么病| 今年56岁属什么生肖| 舍什么救什么| ppt是什么单位| 8月20号什么星座| 腔调是什么意思| 急性肠胃炎可以吃什么| 包子都有什么馅| bp是什么意思| 番茄酱和番茄沙司有什么区别| 眼睛干涩吃什么中成药| 心意已决是什么意思| 小孩子注意力不集中是什么原因| 站桩对身体有什么好处和功效| 心绞痛用什么药最好| 小产可以吃什么水果| 黄连水有什么作用与功效| 神经外科和神经内科有什么区别| 铁罗汉是什么茶| 男人做梦梦到蛇是什么意思| 坤宁宫是干什么的| 脱敏是什么意思| 假酒喝了有什么症状| 上火了吃什么水果降火最快| 藏在什么里的爱| 百毒不侵是什么意思| 温水煮青蛙什么意思| 为什么喝茶会睡不着| 韭黄和韭菜有什么区别| 靖五行属性是什么| 胆汁反流是什么原因引起的| 心率过低有什么危害| 荔枝晒干了叫什么| pg在医学是什么意思| 玄武是什么动物| 活血化瘀是什么意思| 抗凝药是什么意思| 首发是什么意思| 大人发烧吃什么药| vca是什么牌子| 脑血管挂什么科| 宫颈肥大伴纳氏囊肿是什么意思| 刚拔完智齿可以吃什么| 男人是什么| 梗米是什么米| 鹿加几念什么| 子字属于五行属什么| 蛇吃什么东西| 王不见王是什么意思| 叙字五行属什么| 黄褐斑内调吃什么中药| 婴儿什么时候会走路| 胸口闷疼是什么原因| 毛豆吃多了有什么坏处| 神经病是什么意思| 苍龙七宿的秘密是什么| 属虎生什么属相宝宝好| 血糖仪什么牌子的好用又准确| 百度

科技部就社会上有人冒用科技部名义征集项目发表声明


Directory: ../../../ffmpeg/
File: src/fftools/textformat/tf_ini.c
Date: 2025-08-04 00:43:16
Exec Total Coverage
Lines: 43 51 84.3%
Functions: 4 4 100.0%
Branches: 19 29 65.5%

Line Branch Exec Source
1 /*
2 * Copyright (c) The FFmpeg developers
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <limits.h>
22 #include <stdarg.h>
23 #include <stdint.h>
24 #include <stdio.h>
25 #include <string.h>
26
27 #include "avtextformat.h"
28
29 #include "libavutil/bprint.h"
30 #include "libavutil/opt.h"
31 #include "tf_internal.h"
32
33 /* Default output */
34
35 typedef struct DefaultContext {
36 const AVClass *class;
37 int nokey;
38 int noprint_wrappers;
39 int nested_section[SECTION_MAX_NB_LEVELS];
40 } DefaultContext;
41
42 /* INI format output */
43
44 typedef struct INIContext {
45 const AVClass *class;
46 int hierarchical;
47 } INIContext;
48
49 #undef OFFSET
50 #define OFFSET(x) offsetof(INIContext, x)
51
52 static const AVOption ini_options[] = {
53 { "hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1 },
54 { "h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1 },
55 { NULL },
56 };
57
58 DEFINE_FORMATTER_CLASS(ini);
59
60 724 static char *ini_escape_str(AVBPrint *dst, const char *src)
61 {
62 724 int i = 0;
63 char c;
64
65
2/2
✓ Branch 0 taken 6141 times.
✓ Branch 1 taken 724 times.
6865 while ((c = src[i++])) {
66
2/7
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 14 times.
✓ Branch 6 taken 6127 times.
6141 switch (c) {
67 case '\b': av_bprintf(dst, "%s", "\\b"); break;
68 case '\f': av_bprintf(dst, "%s", "\\f"); break;
69 case '\n': av_bprintf(dst, "%s", "\\n"); break;
70 case '\r': av_bprintf(dst, "%s", "\\r"); break;
71 case '\t': av_bprintf(dst, "%s", "\\t"); break;
72 14 case '\\':
73 case '#':
74 case '=':
75 case ':':
76 14 av_bprint_chars(dst, '\\', 1);
77 /* fallthrough */
78 6141 default:
79
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6141 times.
6141 if ((unsigned char)c < 32)
80 av_bprintf(dst, "\\x00%02x", (unsigned char)c);
81 else
82 6141 av_bprint_chars(dst, c, 1);
83 6141 break;
84 }
85 }
86 724 return dst->str;
87 }
88
89 42 static void ini_print_section_header(AVTextFormatContext *wctx, const void *data)
90 {
91 42 INIContext *ini = wctx->priv;
92 42 AVBPrint *buf = &wctx->section_pbuf[wctx->level];
93 42 const AVTextFormatSection *section = tf_get_section(wctx, wctx->level);
94 42 const AVTextFormatSection *parent_section = tf_get_parent_section(wctx, wctx->level);
95
96
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 42 times.
42 if (!section)
97 return;
98
99 42 av_bprint_clear(buf);
100
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 41 times.
42 if (!parent_section) {
101 1 writer_put_str(wctx, "# ffprobe output\n\n");
102 1 return;
103 }
104
105
2/2
✓ Branch 0 taken 38 times.
✓ Branch 1 taken 3 times.
41 if (wctx->nb_item[wctx->level - 1])
106 38 writer_w8(wctx, '\n');
107
108 41 av_bprintf(buf, "%s", wctx->section_pbuf[wctx->level - 1].str);
109
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 41 times.
41 if (ini->hierarchical ||
110 !(section->flags & (AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY | AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER))) {
111
2/2
✓ Branch 0 taken 38 times.
✓ Branch 1 taken 3 times.
41 av_bprintf(buf, "%s%s", buf->str[0] ? "." : "", wctx->section[wctx->level]->name);
112
113
2/2
✓ Branch 0 taken 31 times.
✓ Branch 1 taken 10 times.
41 if (parent_section->flags & AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY) {
114 62 unsigned n = parent_section->flags & AV_TEXTFORMAT_SECTION_FLAG_NUMBERING_BY_TYPE
115 28 ? wctx->nb_item_type[wctx->level - 1][section->id]
116
2/2
✓ Branch 0 taken 28 times.
✓ Branch 1 taken 3 times.
31 : wctx->nb_item[wctx->level - 1];
117 31 av_bprintf(buf, ".%u", n);
118 }
119 }
120
121
2/2
✓ Branch 0 taken 39 times.
✓ Branch 1 taken 2 times.
41 if (!(section->flags & (AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY | AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER)))
122 39 writer_printf(wctx, "[%s]\n", buf->str);
123 }
124
125 362 static void ini_print_str(AVTextFormatContext *wctx, const char *key, const char *value)
126 {
127 AVBPrint buf;
128
129 362 av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED);
130 362 writer_printf(wctx, "%s=", ini_escape_str(&buf, key));
131 362 av_bprint_clear(&buf);
132 362 writer_printf(wctx, "%s\n", ini_escape_str(&buf, value));
133 362 av_bprint_finalize(&buf, NULL);
134 362 }
135
136 316 static void ini_print_int(AVTextFormatContext *wctx, const char *key, int64_t value)
137 {
138 316 writer_printf(wctx, "%s=%"PRId64"\n", key, value);
139 316 }
140
141 const AVTextFormatter avtextformatter_ini = {
142 .name = "ini",
143 .priv_size = sizeof(INIContext),
144 .print_section_header = ini_print_section_header,
145 .print_integer = ini_print_int,
146 .print_string = ini_print_str,
147 .flags = AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS | AV_TEXTFORMAT_FLAG_SUPPORTS_MIXED_ARRAY_CONTENT,
148 .priv_class = &ini_class,
149 };
150

tide什么意思 什么是甲状腺 什么是鬼压床 1007是什么星座 pn是什么
前列腺钙化斑是什么意思 颈椎病吃什么药最好 降钙素原高是什么原因 什么什么若狂 白蛋白低是什么原因
吃牛肉对身体有什么好处 右手小指疼痛预兆什么 皮草是什么意思 夏天防中暑备什么药 百分点是什么意思
什么是美尼尔氏综合症 检查骨头做什么检查 鹅蛋孕妇吃有什么好处 阳历三月是什么星座 梦见找对象是什么意思
胃动力不足是什么原因造成的sanhestory.com 未见明显胚芽是什么意思hcv9jop3ns4r.cn 肺阴虚吃什么药hebeidezhi.com 梵高的星空表达了什么hcv7jop6ns9r.cn 今天是什么好日子hcv9jop2ns7r.cn
属马的是什么星座hcv7jop6ns8r.cn 肘关节发黑是什么原因hcv8jop7ns9r.cn 肝内脂肪浸润是什么意思hcv9jop7ns1r.cn 横店是什么hcv8jop6ns3r.cn 胆红素偏高是什么意思hcv8jop2ns8r.cn
王的五行属性是什么hcv9jop5ns3r.cn 血小板高是什么引起的wuhaiwuya.com lov是什么意思hcv7jop4ns6r.cn 七月初七是什么星座hcv8jop3ns8r.cn 路政属于什么单位hcv8jop6ns1r.cn
鲜卑族现在是什么族hcv8jop4ns9r.cn 转氨酶高是什么0735v.com 叶酸在什么食物里最多hcv8jop3ns4r.cn 夏天是什么样的hcv8jop9ns4r.cn 皮肤过敏吃什么hcv8jop6ns7r.cn
百度