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 */
25
28
35
36 /**
37 * @file
38 * Options definition for AVFormatContext.
39 */
40
44
46 {
48 if(
fc->iformat)
return fc->iformat->name;
49 else if(
fc->oformat)
return fc->oformat->name;
50 else return fc->av_class->class_name;
51 }
52
54 {
56 if (!prev &&
s->priv_data &&
57 ((
s->iformat &&
s->iformat->priv_class) ||
58 s->oformat &&
s->oformat->priv_class))
60 if (
s->pb &&
s->pb->av_class && prev !=
s->pb)
63 }
64
65 enum {
70
71 };
72
73 #define ITER_STATE_SHIFT 16
74
76 {
77 // we use the low 16 bits of iter as the value to be passed to
78 // av_(de)muxer_iterate()
82
87 }
88
91
96 }
97
100 }
101
104
109 }
112 }
113
115 // make sure none av_(de)muxer_iterate does not set the high bits of val
119 }
120
122 {
126 }
127
137 };
138
141 {
142 int loglevel;
143
144 if (!strcmp(url,
s->url) ||
145 s->iformat && !strcmp(
s->iformat->name,
"image2") ||
146 s->oformat && !strcmp(
s->oformat->name,
"image2")
147 ) {
149 } else
151
153
155 }
156
158 {
160 }
161
163 {
167
169 if (!fci)
171
177
179
185 }
186
188 }
189
191 {
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
230 };
231
237 };
238
240 {
242 }
243
245 {
249
250 if (
s->nb_streams >=
s->max_streams) {
252 " (%d), see the documentation if you wish to increase it\n",
255 }
257 if (!streams)
259 s->streams = streams;
260
262 if (!sti)
265
270
272
277
281
282 #if FF_API_R_FRAME_RATE
284 #endif
287
288 /* default pts setting is MPEG-like */
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 */
295 } else {
297 }
298
299 st->
index =
s->nb_streams;
306
311
313 #if FF_API_INTERNAL_TIMING
314 sti->transferred_mux_tb = (
AVRational) { 0, 1 };;
315 #endif
316
318
319 s->streams[
s->nb_streams++] = st;
320 return st;
324 }
325
326 #define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
327 #define OFFSET(x) offsetof(AVStreamGroupTileGrid, x)
329 {
"grid_size",
"size of the output canvas",
OFFSET(coded_width),
331 {
"output_size",
"size of valid pixels in output image meant for presentation",
OFFSET(
width),
333 { "background_color", "set a background color for unused pixels",
338 };
339 #undef OFFSET
340
345 };
346
347 #define OFFSET(x) offsetof(AVStreamGroupLCEVC, x)
349 {
"video_size",
"size of video after LCEVC enhancement has been applied",
OFFSET(
width),
352 };
353 #undef OFFSET
354
359 };
360
362 {
364 if (!prev) {
374 default:
375 break;
376 }
377 }
379 }
380
381 #undef FLAGS
382
384 {
385 uintptr_t
i = (uintptr_t)*opaque;
387
391 // fall-through
394 break;
397 break;
400 break;
403 break;
404 default:
405 break;
406 }
407
409 *opaque = (
void*)(
i + 1);
411 }
412
417 };
418
426 };
427
429 {
431 }
432
436 {
440
442 sizeof(*stream_groups));
443 if (!stream_groups)
445 s->stream_groups = stream_groups;
446
448 if (!stgi)
451
460 break;
465 break;
472 break;
479 break;
480 default:
482 }
483
487 }
488
490 stg->
index =
s->nb_stream_groups;
491
492 s->stream_groups[
s->nb_stream_groups++] = stg;
493
494 return stg;
498 }
499
501 {
504 if (!streams)
506
509
510 return 0;
511 }
512
514 {
517
520
524
526 }
527
529 {
531 opt->
unit && !strcmp(opt->
unit,
"disposition");
532 }
533
535 {
538 return opt->default_val.i64;
540 }
541
543 {
545
546 if (disposition <= 0)
548
552 return opt->name;
553
555 }