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 */
24
27
34
35 /**
36 * @file
37 * Options definition for AVFormatContext.
38 */
39
43
45 {
47 if(
fc->iformat)
return fc->iformat->name;
48 else if(
fc->oformat)
return fc->oformat->name;
49 else return fc->av_class->class_name;
50 }
51
53 {
55 if (!prev &&
s->priv_data &&
56 ((
s->iformat &&
s->iformat->priv_class) ||
57 s->oformat &&
s->oformat->priv_class))
59 if (
s->pb &&
s->pb->av_class && prev !=
s->pb)
62 }
63
64 enum {
69
70 };
71
72 #define ITER_STATE_SHIFT 16
73
75 {
76 // we use the low 16 bits of iter as the value to be passed to
77 // av_(de)muxer_iterate()
81
86 }
87
90
95 }
96
99 }
100
103
108 }
111 }
112
114 // make sure none av_(de)muxer_iterate does not set the high bits of val
118 }
119
121 {
125 }
126
136 };
137
140 {
141 int loglevel;
142
143 if (!strcmp(url,
s->url) ||
144 s->iformat && !strcmp(
s->iformat->name,
"image2") ||
145 s->oformat && !strcmp(
s->oformat->name,
"image2")
146 ) {
148 } else
150
152
154 }
155
157 {
159 }
160
162 {
165
166 if (!si)
168
173
175
181 }
182
183 #if FF_API_LAVF_SHORTEST
185 #endif
186
188 }
189
190 #if FF_API_GET_DUR_ESTIMATE_METHOD
192 {
194 }
195 #endif
196
198 {
200 }
201
202 #define DISPOSITION_OPT(ctx) \
203 { "disposition", NULL, offsetof(ctx, disposition), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, \
204 .flags = AV_OPT_FLAG_ENCODING_PARAM, .unit = "disposition" }, \
205 { "default", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEFAULT }, .unit = "disposition" }, \
206 { "dub", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DUB }, .unit = "disposition" }, \
207 { "original", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ORIGINAL }, .unit = "disposition" }, \
208 { "comment", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_COMMENT }, .unit = "disposition" }, \
209 { "lyrics", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_LYRICS }, .unit = "disposition" }, \
210 { "karaoke", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_KARAOKE }, .unit = "disposition" }, \
211 { "forced", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_FORCED }, .unit = "disposition" }, \
212 { "hearing_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_HEARING_IMPAIRED }, .unit = "disposition" }, \
213 { "visual_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_VISUAL_IMPAIRED }, .unit = "disposition" }, \
214 { "clean_effects", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS }, .unit = "disposition" }, \
215 { "attached_pic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ATTACHED_PIC }, .unit = "disposition" }, \
216 { "timed_thumbnails", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_TIMED_THUMBNAILS }, .unit = "disposition" }, \
217 { "non_diegetic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_NON_DIEGETIC }, .unit = "disposition" }, \
218 { "captions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, .unit = "disposition" }, \
219 { "descriptions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, .unit = "disposition" }, \
220 { "metadata", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, .unit = "disposition" }, \
221 { "dependent", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEPENDENT }, .unit = "disposition" }, \
222 { "still_image", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_STILL_IMAGE }, .unit = "disposition" }, \
223 { "multilayer", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_MULTILAYER }, .unit = "disposition" }
224
237 };
238
244 };
245
247 {
249 }
250
252 {
257
258 if (
s->nb_streams >=
s->max_streams) {
260 " (%d), see the documentation if you wish to increase it\n",
263 }
265 if (!streams)
267 s->streams = streams;
268
270 if (!sti)
273
278
280
285
289
290 #if FF_API_R_FRAME_RATE
292 #endif
295
296 /* default pts setting is MPEG-like */
298 /* we set the current DTS to 0 so that formats without any timestamps
299 * but durations get some timestamps, formats with some unknown
300 * timestamps have their first few packets buffered and the
301 * timestamps corrected before they are returned to the user */
303 } else {
305 }
306
307 st->
index =
s->nb_streams;
314
319
321 #if FF_API_INTERNAL_TIMING
322 sti->transferred_mux_tb = (
AVRational) { 0, 1 };;
323 #endif
324
325 #if FF_API_AVSTREAM_SIDE_DATA
326 sti->inject_global_side_data = si->inject_global_side_data;
327 #endif
328
330
331 s->streams[
s->nb_streams++] = st;
332 return st;
336 }
337
338 #define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
339 #define OFFSET(x) offsetof(AVStreamGroupTileGrid, x)
341 {
"grid_size",
"size of the output canvas",
OFFSET(coded_width),
343 {
"output_size",
"size of valid pixels in output image meant for presentation",
OFFSET(
width),
345 { "background_color", "set a background color for unused pixels",
350 };
351 #undef OFFSET
352
357 };
358
359 #define OFFSET(x) offsetof(AVStreamGroupLCEVC, x)
361 {
"video_size",
"size of video after LCEVC enhancement has been applied",
OFFSET(
width),
364 };
365 #undef OFFSET
366
371 };
372
374 {
376 if (!prev) {
386 default:
387 break;
388 }
389 }
391 }
392
393 #undef FLAGS
394
396 {
397 uintptr_t
i = (uintptr_t)*opaque;
399
403 // fall-through
406 break;
409 break;
412 break;
415 break;
416 default:
417 break;
418 }
419
421 *opaque = (
void*)(
i + 1);
423 }
424
429 };
430
438 };
439
441 {
443 }
444
448 {
452
454 sizeof(*stream_groups));
455 if (!stream_groups)
457 s->stream_groups = stream_groups;
458
460 if (!stgi)
463
472 break;
477 break;
484 break;
491 break;
492 default:
494 }
495
499 }
500
502 stg->
index =
s->nb_stream_groups;
503
504 s->stream_groups[
s->nb_stream_groups++] = stg;
505
506 return stg;
510 }
511
513 {
516 if (!streams)
518
521
522 return 0;
523 }
524
526 {
529
532
536
538 }
539
541 {
543 opt->
unit && !strcmp(opt->
unit,
"disposition");
544 }
545
547 {
550 return opt->default_val.i64;
552 }
553
555 {
557
558 if (disposition <= 0)
560
564 return opt->name;
565
567 }