爱叶有什么作用和功效| 人造海蜇丝是什么做的| 胃肠感冒吃什么食物比较好| 梦见车翻了是什么预兆| 屁股疼是什么原因引起的| 大便不成形是什么原因造成的| 血小板低吃什么| 老是头晕是什么原因| 铁树开花是什么意思| 白羊座和什么座最配| 吃洋葱有什么好处和坏处| 梦见梯子是什么意思| 什么乎乎| 蝴蝶长什么样| 女性分泌物像豆腐渣用什么药| 月季黑斑病用什么药| 午时是什么时候| 回苏灵又叫什么| 手足口病有什么症状| 排酸对身体有什么好处| 什么鱼最好吃| 父亲的弟弟叫什么| 胃炎吃什么药| 小孩黑眼圈很重是什么原因| 屁多又臭是什么原因| 精液发黄是什么原因| 2是什么生肖| 荣耀是什么品牌| 陆地上最大的动物是什么| 雾化器是干什么用的| 努尔哈赤姓什么| 失意是什么意思| 壬水是什么水| 八月十八号是什么星座| 大便一粒粒是什么原因| 荷叶有什么功效和作用| 躺下就头晕是什么原因| 大名鼎鼎的鼎是什么意思| 头发掉的多是什么原因| 中医四诊指的是什么| 别开生面是什么意思| 见到黑猫代表什么预兆| 肠系膜多发淋巴结是什么意思| 经常晕倒是什么原因引起的| 性生活后尿路感染是什么原因| d3什么时候吃效果最好| 孩子晚上磨牙是什么原因| 皮卡丘站起来变成了什么| 儿童受凉咳嗽吃什么药| 脂蛋白a高是什么原因| 免疫固定电泳查什么的| 什么叫留守儿童| 甲状腺功能亢进吃什么药| 大佬什么意思| 特应性皮炎是什么病| 王维有什么之称| 小孩打喷嚏流鼻涕吃什么药| 蜂蜜什么时候喝最佳| 为什么会长针眼| 什么水果可以减肥刮油脂| 狗被蜱虫咬了有什么症状| 子宫前位后位有什么区别| 慢性浅表性胃炎伴糜烂吃什么药| absolue是兰蔻的什么产品| 排卵期后面是什么期| 药食同源什么意思| 什么农药最毒| mask是什么意思| 焦糖色搭配什么颜色好看| 指甲盖发紫是什么原因| 花红是什么意思| 肝火旺盛是什么意思| 金榜题名是什么生肖| 什么情况下会宫外孕| 鼻梁痛什么原因引起的| 瓜尔佳氏现在姓什么| 三九胃泰治什么胃病效果好| 眼睛红血丝是什么原因| 上海曙光医院擅长什么| 易是什么意思| 什么样的枫叶| 关节疼是什么原因| 孕妇吃榴莲对胎儿有什么好处| 夜晚的星星像什么| 10月26是什么星座| 为什么男怕属鸡| 胃痉挛吃什么药| 老年痴呆症是什么原因引起的| 问羊知马是什么生肖| 感冒看什么科| 阴道为什么会排气| ova什么意思| 五心烦热吃什么中成药| 天秤座的幸运色是什么| 海里是什么单位| 子宫内膜息肉有什么症状| 福禄是什么意思| 膳食是什么意思| 吨位是什么意思| 红薯的别名叫什么| 排骨炖苦瓜有什么功效| 五毛是什么意思| 福报是什么意思| 一个立一个羽读什么| 红红的苹果像什么句子| 哺乳期吃辣椒对宝宝有什么影响| 西米是什么做的| 藜麦是什么东西| 做爱都有什么姿势| 血压测不出来什么原因| 大姨妈期间适合吃什么水果| 低密度脂蛋白偏高是什么原因| 腹部彩超能查出什么| 布鲁斯是什么| 专业术语是什么意思| 耳蜗是什么| 什么人什么目| 吃什么菜对肝好怎么养肝| 喝水牙疼是什么原因| 经期喝什么汤| 下腹部胀是什么原因| 运动后喝什么水最好| 7月17号是什么星座| 烈女怕缠郎是什么意思| 什么什么为什么| 伟五行属性是什么| lyocell是什么面料| 瘪是什么意思| uspa是什么牌子| 喝老陈皮水有什么好处| 相恋纪念日送什么礼物| 晚上喝牛奶有什么好处和坏处| 高考考生号是什么| 外阴湿疹用什么药| 血糖高会出现什么症状| 孕妇血糖高对胎儿有什么影响| 柬埔寨为什么叫柬埔寨| 血压低压低是什么原因| 错过是什么意思| 气血亏虚吃什么中成药| 男人左手麻木什么原因| 武汉有什么好玩的地方| 无后为大是什么意思| 博五行属性是什么| 想呕吐是什么原因| 气虚血虚吃什么中成药| 飞行模式有什么用| 舒张压低是什么原因| 突然头晕眼花站不稳是什么原因| 主是什么结构的字体| 乱的偏旁是什么| 什么叫机械手表| 墨菲定律讲的是什么| 人生得意须尽欢是什么意思| 燕窝是什么东西| 黄金有什么作用| 整个后背疼是什么原因| 化干戈为玉帛是什么意思| 盐袋子热敷有什么好处| 2月23日什么星座| 情绪高涨是什么意思| 27岁属相是什么生肖| 牛肉和什么不能一起吃| 龙配什么生肖最好| ptp是什么意思| 吃什么食物补钙| 蔷薇色是什么颜色| 11月8日是什么星座| 副镇长是什么级别| 新生儿甲状腺偏高有什么影响| 人大是干什么的| 蓝莓有什么好处| 除草剂中毒有什么症状| 6月5日是世界什么日| 吃饭快了有什么坏处| 极是什么意思| chb是什么意思| 白居易主张什么| 什么是企业年金| 父母都是a型血孩子是什么血型| 睡觉头晕是什么原因引起的| gary是什么意思| 仙人掌有什么作用| 皮肤起小水泡很痒是什么原因| 二月是什么星座| 嗓子痒吃什么药| 宝宝乳糖不耐受喝什么奶粉比较好| 儿童咳嗽吃什么消炎药| 胡萝卜富含什么维生素| 循序渐进是什么意思| 为什么手会掉皮| 腰椎间盘突出什么症状| 87岁属什么| 鳄鱼吃什么| 晕车药吃多了有什么副作用| 感恩节吃什么| 猪横脷是什么| 梦到自己老公出轨是什么意思| 什么除草剂三年不长草| 2049年是什么年| cp是什么意思| 1月21日什么星座| 宫高是什么意思| 什么叫高血脂| 糙皮病是什么病| whan是什么意思| 痔疮用什么药| 室性期前收缩是什么意思| 糖尿病患者能吃什么水果| 下面干涩是什么原因导致的| 扬是什么生肖| foreplay是什么意思| 2018 年是什么年| 婴儿湿疹不能吃什么| 99新是什么意思| 梦见做被子什么意思| 秽是什么意思| 体检报告都检查什么| 断章取义什么意思| 抛光是什么意思| 叶凡为什么找石昊求救| 淋巴门消失是什么意思| 胸膜炎是什么症状| 延迟是什么意思| 9月14日是什么星座| 拉屎黑色的是什么原因| 全日制专科是什么意思| 扎心是什么意思| 牙齿发白是什么原因| 好高什么远| 我知道你在想什么| 秋天都有什么| 双十一从什么时候开始| 菟丝子是什么| 黑脚鸡是什么品种| 白头翁是什么| 抽烟对身体有什么危害| ivy什么意思| 感冒低烧是什么原因| 猫贫血吃什么补血最快| 间断性是什么意思| 神经疼痛吃什么药| 纸片人是什么意思| 什么叫三观| 彧读什么| 双子座男生喜欢什么样的女生| 9月6日什么星座| 女生为什么喊你男神| 血糖高的人吃什么好| 痰湿是什么意思| 7月29号是什么星座| 有肝病的人吃什么好| 什么是健康证| 让我爱你然后把我抛弃是什么歌| 越位是什么意思| 血流信号是什么意思| 红肉是什么| 拉肚子喝什么粥| 软冷冻室一般放什么东西| 崩漏带下是什么症状| 口干是什么原因| cd4是什么意思| 扇子骨是什么肉| syp是什么意思| 百度

(信息)道简心康心血管康复医生集团成立


Directory: ../../../ffmpeg/
File: src/libavformat/options.c
Date: 2025-08-04 00:43:16
Exec Total Coverage
Lines: 173 244 70.9%
Functions: 16 19 84.2%
Branches: 95 138 68.8%

Line Branch Exec Source
1 /*
2 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
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 #include "avformat.h"
21 #include "avformat_internal.h"
22 #include "avio_internal.h"
23 #include "demux.h"
24 #include "internal.h"
25
26 #include "libavcodec/avcodec.h"
27 #include "libavcodec/codec_par.h"
28
29 #include "libavutil/avassert.h"
30 #include "libavutil/iamf.h"
31 #include "libavutil/internal.h"
32 #include "libavutil/intmath.h"
33 #include "libavutil/mem.h"
34 #include "libavutil/opt.h"
35
36 /**
37 * @file
38 * Options definition for AVFormatContext.
39 */
40
41 FF_DISABLE_DEPRECATION_WARNINGS
42 #include "options_table.h"
43 FF_ENABLE_DEPRECATION_WARNINGS
44
45 2606 static const char* format_to_name(void* ptr)
46 {
47 2606 AVFormatContext* fc = (AVFormatContext*) ptr;
48
2/2
✓ Branch 0 taken 1688 times.
✓ Branch 1 taken 918 times.
2606 if(fc->iformat) return fc->iformat->name;
49
1/2
✓ Branch 0 taken 918 times.
✗ Branch 1 not taken.
918 else if(fc->oformat) return fc->oformat->name;
50 else return fc->av_class->class_name;
51 }
52
53 56821 static void *format_child_next(void *obj, void *prev)
54 {
55 56821 AVFormatContext *s = obj;
56
4/4
✓ Branch 0 taken 23218 times.
✓ Branch 1 taken 33603 times.
✓ Branch 2 taken 22750 times.
✓ Branch 3 taken 468 times.
56821 if (!prev && s->priv_data &&
57
4/4
✓ Branch 0 taken 22748 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 2526 times.
✓ Branch 3 taken 20222 times.
22750 ((s->iformat && s->iformat->priv_class) ||
58
3/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2526 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2528 s->oformat && s->oformat->priv_class))
59 20224 return s->priv_data;
60
6/6
✓ Branch 0 taken 27126 times.
✓ Branch 1 taken 9471 times.
✓ Branch 2 taken 27114 times.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 13557 times.
✓ Branch 5 taken 13557 times.
36597 if (s->pb && s->pb->av_class && prev != s->pb)
61 13557 return s->pb;
62 23040 return NULL;
63 }
64
65 enum {
66 CHILD_CLASS_ITER_AVIO = 0,
67 CHILD_CLASS_ITER_MUX,
68 CHILD_CLASS_ITER_DEMUX,
69 CHILD_CLASS_ITER_DONE,
70
71 };
72
73 #define ITER_STATE_SHIFT 16
74
75 27791653 static const AVClass *format_child_class_iterate(void **iter)
76 {
77 // we use the low 16 bits of iter as the value to be passed to
78 // av_(de)muxer_iterate()
79 27791653 void *val = (void*)(((uintptr_t)*iter) & ((1 << ITER_STATE_SHIFT) - 1));
80 27791653 unsigned int state = ((uintptr_t)*iter) >> ITER_STATE_SHIFT;
81 27791653 const AVClass *ret = NULL;
82
83
2/2
✓ Branch 0 taken 117387 times.
✓ Branch 1 taken 27674266 times.
27791653 if (state == CHILD_CLASS_ITER_AVIO) {
84 117387 ret = &ff_avio_class;
85 117387 state++;
86 117387 goto finish;
87 }
88
89
2/2
✓ Branch 0 taken 8563519 times.
✓ Branch 1 taken 19110747 times.
27674266 if (state == CHILD_CLASS_ITER_MUX) {
90 const AVOutputFormat *ofmt;
91
92
2/2
✓ Branch 1 taken 21820014 times.
✓ Branch 2 taken 117258 times.
21937272 while ((ofmt = av_muxer_iterate(&val))) {
93 21820014 ret = ofmt->priv_class;
94
2/2
✓ Branch 0 taken 8446261 times.
✓ Branch 1 taken 13373753 times.
21820014 if (ret)
95 8446261 goto finish;
96 }
97
98 117258 val = NULL;
99 117258 state++;
100 }
101
102
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 19228005 times.
19228005 if (state == CHILD_CLASS_ITER_DEMUX) {
103 const AVInputFormat *ifmt;
104
105
2/2
✓ Branch 1 taken 42560158 times.
✓ Branch 2 taken 117228 times.
42677386 while ((ifmt = av_demuxer_iterate(&val))) {
106 42560158 ret = ifmt->priv_class;
107
2/2
✓ Branch 0 taken 19110777 times.
✓ Branch 1 taken 23449381 times.
42560158 if (ret)
108 19110777 goto finish;
109 }
110 117228 val = NULL;
111 117228 state++;
112 }
113
114 finish:
115 // make sure none av_(de)muxer_iterate does not set the high bits of val
116
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 27791653 times.
27791653 av_assert0(!((uintptr_t)val >> ITER_STATE_SHIFT));
117 27791653 *iter = (void*)((uintptr_t)val | (state << ITER_STATE_SHIFT));
118 27791653 return ret;
119 }
120
121 2606 static AVClassCategory get_category(void *ptr)
122 {
123 2606 AVFormatContext* s = ptr;
124
2/2
✓ Branch 0 taken 1688 times.
✓ Branch 1 taken 918 times.
2606 if(s->iformat) return AV_CLASS_CATEGORY_DEMUXER;
125 918 else return AV_CLASS_CATEGORY_MUXER;
126 }
127
128 static const AVClass av_format_context_class = {
129 .class_name = "AVFormatContext",
130 .item_name = format_to_name,
131 .option = avformat_options,
132 .version = LIBAVUTIL_VERSION_INT,
133 .child_next = format_child_next,
134 .child_class_iterate = format_child_class_iterate,
135 .category = AV_CLASS_CATEGORY_MUXER,
136 .get_category = get_category,
137 };
138
139 108125 static int io_open_default(AVFormatContext *s, AVIOContext **pb,
140 const char *url, int flags, AVDictionary **options)
141 {
142 int loglevel;
143
144
2/2
✓ Branch 0 taken 103559 times.
✓ Branch 1 taken 4566 times.
108125 if (!strcmp(url, s->url) ||
145
4/4
✓ Branch 0 taken 102750 times.
✓ Branch 1 taken 809 times.
✓ Branch 2 taken 62 times.
✓ Branch 3 taken 102688 times.
103559 s->iformat && !strcmp(s->iformat->name, "image2") ||
146
4/4
✓ Branch 0 taken 809 times.
✓ Branch 1 taken 62 times.
✓ Branch 2 taken 663 times.
✓ Branch 3 taken 146 times.
871 s->oformat && !strcmp(s->oformat->name, "image2")
147 ) {
148 107917 loglevel = AV_LOG_DEBUG;
149 } else
150 208 loglevel = AV_LOG_INFO;
151
152
2/2
✓ Branch 0 taken 819 times.
✓ Branch 1 taken 107306 times.
108125 av_log(s, loglevel, "Opening \'%s\' for %s\n", url, flags & AVIO_FLAG_WRITE ? "writing" : "reading");
153
154 108125 return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist);
155 }
156
157 108124 static int io_close2_default(AVFormatContext *s, AVIOContext *pb)
158 {
159 108124 return avio_close(pb);
160 }
161
162 16148 AVFormatContext *avformat_alloc_context(void)
163 {
164 FormatContextInternal *fci;
165 FFFormatContext *si;
166 AVFormatContext *s;
167
168 16148 fci = av_mallocz(sizeof(*fci));
169
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16148 times.
16148 if (!fci)
170 return NULL;
171
172 16148 si = &fci->fc;
173 16148 s = &si->pub;
174 16148 s->av_class = &av_format_context_class;
175 16148 s->io_open = io_open_default;
176 16148 s->io_close2= io_close2_default;
177
178 16148 av_opt_set_defaults(s);
179
180 16148 si->pkt = av_packet_alloc();
181 16148 si->parse_pkt = av_packet_alloc();
182
2/4
✓ Branch 0 taken 16148 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 16148 times.
16148 if (!si->pkt || !si->parse_pkt) {
183 avformat_free_context(s);
184 return NULL;
185 }
186
187 16148 return s;
188 }
189
190 132269 const AVClass *avformat_get_class(void)
191 {
192 132269 return &av_format_context_class;
193 }
194
195 #define DISPOSITION_OPT(ctx) \
196 { "disposition", NULL, offsetof(ctx, disposition), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, \
197 .flags = AV_OPT_FLAG_ENCODING_PARAM, .unit = "disposition" }, \
198 { "default", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEFAULT }, .unit = "disposition" }, \
199 { "dub", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DUB }, .unit = "disposition" }, \
200 { "original", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ORIGINAL }, .unit = "disposition" }, \
201 { "comment", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_COMMENT }, .unit = "disposition" }, \
202 { "lyrics", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_LYRICS }, .unit = "disposition" }, \
203 { "karaoke", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_KARAOKE }, .unit = "disposition" }, \
204 { "forced", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_FORCED }, .unit = "disposition" }, \
205 { "hearing_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_HEARING_IMPAIRED }, .unit = "disposition" }, \
206 { "visual_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_VISUAL_IMPAIRED }, .unit = "disposition" }, \
207 { "clean_effects", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS }, .unit = "disposition" }, \
208 { "attached_pic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ATTACHED_PIC }, .unit = "disposition" }, \
209 { "timed_thumbnails", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_TIMED_THUMBNAILS }, .unit = "disposition" }, \
210 { "non_diegetic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_NON_DIEGETIC }, .unit = "disposition" }, \
211 { "captions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, .unit = "disposition" }, \
212 { "descriptions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, .unit = "disposition" }, \
213 { "metadata", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, .unit = "disposition" }, \
214 { "dependent", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEPENDENT }, .unit = "disposition" }, \
215 { "still_image", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_STILL_IMAGE }, .unit = "disposition" }, \
216 { "multilayer", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_MULTILAYER }, .unit = "disposition" }
217
218 static const AVOption stream_options[] = {
219 DISPOSITION_OPT(AVStream),
220 { "discard", NULL, offsetof(AVStream, discard), AV_OPT_TYPE_INT, { .i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX,
221 .flags = AV_OPT_FLAG_DECODING_PARAM, .unit = "avdiscard" },
222 { "none", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONE }, .unit = "avdiscard" },
223 { "default", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_DEFAULT }, .unit = "avdiscard" },
224 { "noref", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONREF }, .unit = "avdiscard" },
225 { "bidir", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_BIDIR }, .unit = "avdiscard" },
226 { "nointra", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONINTRA }, .unit = "avdiscard" },
227 { "nokey", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONKEY }, .unit = "avdiscard" },
228 { "all", .type = AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_ALL }, .unit = "avdiscard" },
229 { NULL }
230 };
231
232 static const AVClass stream_class = {
233 .class_name = "AVStream",
234 .item_name = av_default_item_name,
235 .version = LIBAVUTIL_VERSION_INT,
236 .option = stream_options,
237 };
238
239 1 const AVClass *av_stream_get_class(void)
240 {
241 1 return &stream_class;
242 }
243
244 17492 AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
245 {
246 FFStream *sti;
247 AVStream *st;
248 AVStream **streams;
249
250
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17492 times.
17492 if (s->nb_streams >= s->max_streams) {
251 av_log(s, AV_LOG_ERROR, "Number of streams exceeds max_streams parameter"
252 " (%d), see the documentation if you wish to increase it\n",
253 s->max_streams);
254 return NULL;
255 }
256 17492 streams = av_realloc_array(s->streams, s->nb_streams + 1, sizeof(*streams));
257
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17492 times.
17492 if (!streams)
258 return NULL;
259 17492 s->streams = streams;
260
261 17492 sti = av_mallocz(sizeof(*sti));
262
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17492 times.
17492 if (!sti)
263 return NULL;
264 17492 st = &sti->pub;
265
266 17492 st->av_class = &stream_class;
267 17492 st->codecpar = avcodec_parameters_alloc();
268
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17492 times.
17492 if (!st->codecpar)
269 goto fail;
270
271 17492 sti->fmtctx = s;
272
273
2/2
✓ Branch 0 taken 8539 times.
✓ Branch 1 taken 8953 times.
17492 if (s->iformat) {
274 8539 sti->avctx = avcodec_alloc_context3(NULL);
275
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8539 times.
8539 if (!sti->avctx)
276 goto fail;
277
278 8539 sti->info = av_mallocz(sizeof(*sti->info));
279
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8539 times.
8539 if (!sti->info)
280 goto fail;
281
282 #if FF_API_R_FRAME_RATE
283 8539 sti->info->last_dts = AV_NOPTS_VALUE;
284 #endif
285 8539 sti->info->fps_first_dts = AV_NOPTS_VALUE;
286 8539 sti->info->fps_last_dts = AV_NOPTS_VALUE;
287
288 /* default pts setting is MPEG-like */
289 8539 avpriv_set_pts_info(st, 33, 1, 90000);
290 /* we set the current DTS to 0 so that formats without any timestamps
291 * but durations get some timestamps, formats with some unknown
292 * timestamps have their first few packets buffered and the
293 * timestamps corrected before they are returned to the user */
294 8539 sti->cur_dts = RELATIVE_TS_BASE;
295 } else {
296 8953 sti->cur_dts = AV_NOPTS_VALUE;
297 }
298
299 17492 st->index = s->nb_streams;
300 17492 st->start_time = AV_NOPTS_VALUE;
301 17492 st->duration = AV_NOPTS_VALUE;
302 17492 sti->first_dts = AV_NOPTS_VALUE;
303 17492 sti->probe_packets = s->max_probe_packets;
304 17492 sti->pts_wrap_reference = AV_NOPTS_VALUE;
305 17492 sti->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
306
307 17492 sti->last_IP_pts = AV_NOPTS_VALUE;
308 17492 sti->last_dts_for_order_check = AV_NOPTS_VALUE;
309
2/2
✓ Branch 0 taken 297364 times.
✓ Branch 1 taken 17492 times.
314856 for (int i = 0; i < MAX_REORDER_DELAY + 1; i++)
310 297364 sti->pts_buffer[i] = AV_NOPTS_VALUE;
311
312 17492 st->sample_aspect_ratio = (AVRational) { 0, 1 };
313 #if FF_API_INTERNAL_TIMING
314 17492 sti->transferred_mux_tb = (AVRational) { 0, 1 };;
315 #endif
316
317 17492 sti->need_context_update = 1;
318
319 17492 s->streams[s->nb_streams++] = st;
320 17492 return st;
321 fail:
322 ff_free_stream(&st);
323 return NULL;
324 }
325
326 #define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
327 #define OFFSET(x) offsetof(AVStreamGroupTileGrid, x)
328 static const AVOption tile_grid_options[] = {
329 { "grid_size", "size of the output canvas", OFFSET(coded_width),
330 AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS },
331 { "output_size", "size of valid pixels in output image meant for presentation", OFFSET(width),
332 AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS },
333 { "background_color", "set a background color for unused pixels",
334 OFFSET(background), AV_OPT_TYPE_COLOR, { .str = "black"}, 0, 0, FLAGS },
335 { "horizontal_offset", NULL, OFFSET(horizontal_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
336 { "vertical_offset", NULL, OFFSET(vertical_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
337 { NULL },
338 };
339 #undef OFFSET
340
341 static const AVClass tile_grid_class = {
342 .class_name = "AVStreamGroupTileGrid",
343 .version = LIBAVUTIL_VERSION_INT,
344 .option = tile_grid_options,
345 };
346
347 #define OFFSET(x) offsetof(AVStreamGroupLCEVC, x)
348 static const AVOption lcevc_options[] = {
349 { "video_size", "size of video after LCEVC enhancement has been applied", OFFSET(width),
350 AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS },
351 { NULL },
352 };
353 #undef OFFSET
354
355 static const AVClass lcevc_class = {
356 .class_name = "AVStreamGroupLCEVC",
357 .version = LIBAVUTIL_VERSION_INT,
358 .option = lcevc_options,
359 };
360
361 168 static void *stream_group_child_next(void *obj, void *prev)
362 {
363 168 AVStreamGroup *stg = obj;
364
2/2
✓ Branch 0 taken 95 times.
✓ Branch 1 taken 73 times.
168 if (!prev) {
365
2/5
✓ Branch 0 taken 49 times.
✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
95 switch(stg->type) {
366 49 case AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT:
367 49 return stg->params.iamf_audio_element;
368 46 case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION:
369 46 return stg->params.iamf_mix_presentation;
370 case AV_STREAM_GROUP_PARAMS_TILE_GRID:
371 return stg->params.tile_grid;
372 case AV_STREAM_GROUP_PARAMS_LCEVC:
373 return stg->params.lcevc;
374 default:
375 break;
376 }
377 }
378 73 return NULL;
379 }
380
381 #undef FLAGS
382
383 static const AVClass *stream_group_child_iterate(void **opaque)
384 {
385 uintptr_t i = (uintptr_t)*opaque;
386 const AVClass *ret = NULL;
387
388 switch(i) {
389 case AV_STREAM_GROUP_PARAMS_NONE:
390 i++;
391 // fall-through
392 case AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT:
393 ret = av_iamf_audio_element_get_class();
394 break;
395 case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION:
396 ret = av_iamf_mix_presentation_get_class();
397 break;
398 case AV_STREAM_GROUP_PARAMS_TILE_GRID:
399 ret = &tile_grid_class;
400 break;
401 case AV_STREAM_GROUP_PARAMS_LCEVC:
402 ret = &lcevc_class;
403 break;
404 default:
405 break;
406 }
407
408 if (ret)
409 *opaque = (void*)(i + 1);
410 return ret;
411 }
412
413 static const AVOption stream_group_options[] = {
414 DISPOSITION_OPT(AVStreamGroup),
415 {"id", "Set group id", offsetof(AVStreamGroup, id), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM },
416 { NULL }
417 };
418
419 static const AVClass stream_group_class = {
420 .class_name = "AVStreamGroup",
421 .item_name = av_default_item_name,
422 .version = LIBAVUTIL_VERSION_INT,
423 .option = stream_group_options,
424 .child_next = stream_group_child_next,
425 .child_class_iterate = stream_group_child_iterate,
426 };
427
428 const AVClass *av_stream_group_get_class(void)
429 {
430 return &stream_group_class;
431 }
432
433 85 AVStreamGroup *avformat_stream_group_create(AVFormatContext *s,
434 enum AVStreamGroupParamsType type,
435 AVDictionary **options)
436 {
437 AVStreamGroup **stream_groups;
438 AVStreamGroup *stg;
439 FFStreamGroup *stgi;
440
441 85 stream_groups = av_realloc_array(s->stream_groups, s->nb_stream_groups + 1,
442 sizeof(*stream_groups));
443
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 85 times.
85 if (!stream_groups)
444 return NULL;
445 85 s->stream_groups = stream_groups;
446
447 85 stgi = av_mallocz(sizeof(*stgi));
448
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 85 times.
85 if (!stgi)
449 return NULL;
450 85 stg = &stgi->pub;
451
452 85 stg->av_class = &stream_group_class;
453 85 av_opt_set_defaults(stg);
454 85 stg->type = type;
455
3/5
✓ Branch 0 taken 41 times.
✓ Branch 1 taken 38 times.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
85 switch (type) {
456 41 case AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT:
457 41 stg->params.iamf_audio_element = av_iamf_audio_element_alloc();
458
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 41 times.
41 if (!stg->params.iamf_audio_element)
459 goto fail;
460 41 break;
461 38 case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION:
462 38 stg->params.iamf_mix_presentation = av_iamf_mix_presentation_alloc();
463
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 38 times.
38 if (!stg->params.iamf_mix_presentation)
464 goto fail;
465 38 break;
466 6 case AV_STREAM_GROUP_PARAMS_TILE_GRID:
467 6 stg->params.tile_grid = av_mallocz(sizeof(*stg->params.tile_grid));
468
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
6 if (!stg->params.tile_grid)
469 goto fail;
470 6 stg->params.tile_grid->av_class = &tile_grid_class;
471 6 av_opt_set_defaults(stg->params.tile_grid);
472 6 break;
473 case AV_STREAM_GROUP_PARAMS_LCEVC:
474 stg->params.lcevc = av_mallocz(sizeof(*stg->params.lcevc));
475 if (!stg->params.lcevc)
476 goto fail;
477 stg->params.lcevc->av_class = &lcevc_class;
478 av_opt_set_defaults(stg->params.lcevc);
479 break;
480 default:
481 goto fail;
482 }
483
484
2/2
✓ Branch 0 taken 23 times.
✓ Branch 1 taken 62 times.
85 if (options) {
485
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 23 times.
23 if (av_opt_set_dict2(stg, options, AV_OPT_SEARCH_CHILDREN))
486 goto fail;
487 }
488
489 85 stgi->fmtctx = s;
490 85 stg->index = s->nb_stream_groups;
491
492 85 s->stream_groups[s->nb_stream_groups++] = stg;
493
494 85 return stg;
495 fail:
496 ff_free_stream_group(&stg);
497 return NULL;
498 }
499
500 383 static int stream_group_add_stream(AVStreamGroup *stg, AVStream *st)
501 {
502 383 AVStream **streams = av_realloc_array(stg->streams, stg->nb_streams + 1,
503 sizeof(*stg->streams));
504
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 383 times.
383 if (!streams)
505 return AVERROR(ENOMEM);
506
507 383 stg->streams = streams;
508 383 stg->streams[stg->nb_streams++] = st;
509
510 383 return 0;
511 }
512
513 389 int avformat_stream_group_add_stream(AVStreamGroup *stg, AVStream *st)
514 {
515 389 const FFStreamGroup *stgi = cffstreamgroup(stg);
516 389 const FFStream *sti = cffstream(st);
517
518
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 389 times.
389 if (stgi->fmtctx != sti->fmtctx)
519 return AVERROR(EINVAL);
520
521
2/2
✓ Branch 0 taken 956 times.
✓ Branch 1 taken 383 times.
1339 for (int i = 0; i < stg->nb_streams; i++)
522
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 950 times.
956 if (stg->streams[i]->index == st->index)
523 6 return AVERROR(EEXIST);
524
525 383 return stream_group_add_stream(stg, st);
526 }
527
528 144425 static int option_is_disposition(const AVOption *opt)
529 {
530 277455 return opt->type == AV_OPT_TYPE_CONST &&
531
5/6
✓ Branch 0 taken 133030 times.
✓ Branch 1 taken 11395 times.
✓ Branch 2 taken 133030 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 110770 times.
✓ Branch 5 taken 22260 times.
144425 opt->unit && !strcmp(opt->unit, "disposition");
532 }
533
534 int av_disposition_from_string(const char *disp)
535 {
536 for (const AVOption *opt = stream_options; opt->name; opt++)
537 if (option_is_disposition(opt) && !strcmp(disp, opt->name))
538 return opt->default_val.i64;
539 return AVERROR(EINVAL);
540 }
541
542 8480 const char *av_disposition_to_string(int disposition)
543 {
544 int val;
545
546
2/2
✓ Branch 0 taken 265 times.
✓ Branch 1 taken 8215 times.
8480 if (disposition <= 0)
547 265 return NULL;
548
549 8215 val = 1 << ff_ctz(disposition);
550
2/2
✓ Branch 0 taken 144425 times.
✓ Branch 1 taken 3180 times.
147605 for (const AVOption *opt = stream_options; opt->name; opt++)
551
4/4
✓ Branch 1 taken 110770 times.
✓ Branch 2 taken 33655 times.
✓ Branch 3 taken 5035 times.
✓ Branch 4 taken 105735 times.
144425 if (option_is_disposition(opt) && opt->default_val.i64 == val)
552 5035 return opt->name;
553
554 3180 return NULL;
555 }
556

2026是什么年 猪血不能和什么一起吃 为什么一到晚上就咳嗽 晚生是什么意思 青睐什么意思
牙疼挂什么科 血小板低会引发什么病 明年是什么年啊 肺结核传染途径是什么 什么人不适合喝骆驼奶
奶酪和芝士有什么区别 六月二十五号是什么星座 左手小手指麻木是什么原因引起的 头皮痒用什么洗发水效果好 扁桃和芒果有什么区别
元字五行属什么 1959年属什么 一碗香是什么菜 女人喜欢什么礼物 彪马属于什么档次
唐氏筛查是检查什么hcv8jop7ns1r.cn 什么食物含锌最多inbungee.com 土字旁的字与什么有关hcv8jop4ns0r.cn 王妃是什么意思hcv9jop8ns0r.cn 糖类抗原125高是什么意思hcv9jop3ns6r.cn
双11是什么节日dajiketang.com 化疗和放疗什么区别fenrenren.com 堆肥是什么意思hcv8jop8ns7r.cn 唇炎涂什么药膏hcv8jop4ns3r.cn 母亲节送妈妈什么shenchushe.com
户名是什么意思cl108k.com 肝疼吃什么药好naasee.com 小米手机最新款是什么型号hcv8jop0ns1r.cn 喝什么茶可以降血脂hcv8jop8ns7r.cn 粒细胞低是什么原因hcv9jop7ns3r.cn
1952年属什么hcv9jop3ns7r.cn 什么是翘舌音hcv9jop8ns2r.cn 乙肝对身体有什么影响hcv9jop5ns6r.cn 饿了么什么时候成立的hcv9jop1ns2r.cn 重庆为什么叫雾都hcv8jop5ns4r.cn
百度