FFmpeg
options.c
Go to the documentation of this file.
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 "avio_internal.h"
22 #include "demux.h"
23 #include "internal.h"
24 
25 #include "libavcodec/avcodec.h"
26 #include "libavcodec/codec_par.h"
27 
28 #include "libavutil/avassert.h"
29 #include "libavutil/internal.h"
30 #include "libavutil/intmath.h"
31 #include "libavutil/opt.h"
32 
33 /**
34  * @file
35  * Options definition for AVFormatContext.
36  */
37 
39 #include "options_table.h"
41 
42 static const char* format_to_name(void* ptr)
43 {
45  if(fc->iformat) return fc->iformat->name;
46  else if(fc->oformat) return fc->oformat->name;
47  else return "NULL";
48 }
49 
50 static void *format_child_next(void *obj, void *prev)
51 {
52  AVFormatContext *s = obj;
53  if (!prev && s->priv_data &&
54  ((s->iformat && s->iformat->priv_class) ||
55  s->oformat && s->oformat->priv_class))
56  return s->priv_data;
57  if (s->pb && s->pb->av_class && prev != s->pb)
58  return s->pb;
59  return NULL;
60 }
61 
62 enum {
67 
68 };
69 
70 #define ITER_STATE_SHIFT 16
71 
72 static const AVClass *format_child_class_iterate(void **iter)
73 {
74  // we use the low 16 bits of iter as the value to be passed to
75  // av_(de)muxer_iterate()
76  void *val = (void*)(((uintptr_t)*iter) & ((1 << ITER_STATE_SHIFT) - 1));
77  unsigned int state = ((uintptr_t)*iter) >> ITER_STATE_SHIFT;
78  const AVClass *ret = NULL;
79 
81  ret = &ff_avio_class;
82  state++;
83  goto finish;
84  }
85 
86  if (state == CHILD_CLASS_ITER_MUX) {
87  const AVOutputFormat *ofmt;
88 
89  while ((ofmt = av_muxer_iterate(&val))) {
90  ret = ofmt->priv_class;
91  if (ret)
92  goto finish;
93  }
94 
95  val = NULL;
96  state++;
97  }
98 
100  const AVInputFormat *ifmt;
101 
102  while ((ifmt = av_demuxer_iterate(&val))) {
103  ret = ifmt->priv_class;
104  if (ret)
105  goto finish;
106  }
107  val = NULL;
108  state++;
109  }
110 
111 finish:
112  // make sure none av_(de)muxer_iterate does not set the high bits of val
113  av_assert0(!((uintptr_t)val >> ITER_STATE_SHIFT));
114  *iter = (void*)((uintptr_t)val | (state << ITER_STATE_SHIFT));
115  return ret;
116 }
117 
118 static AVClassCategory get_category(void *ptr)
119 {
120  AVFormatContext* s = ptr;
121  if(s->iformat) return AV_CLASS_CATEGORY_DEMUXER;
122  else return AV_CLASS_CATEGORY_MUXER;
123 }
124 
126  .class_name = "AVFormatContext",
127  .item_name = format_to_name,
128  .option = avformat_options,
129  .version = LIBAVUTIL_VERSION_INT,
130  .child_next = format_child_next,
131  .child_class_iterate = format_child_class_iterate,
133  .get_category = get_category,
134 };
135 
137  const char *url, int flags, AVDictionary **options)
138 {
139  int loglevel;
140 
141  if (!strcmp(url, s->url) ||
142  s->iformat && !strcmp(s->iformat->name, "image2") ||
143  s->oformat && !strcmp(s->oformat->name, "image2")
144  ) {
145  loglevel = AV_LOG_DEBUG;
146  } else
147  loglevel = AV_LOG_INFO;
148 
149  av_log(s, loglevel, "Opening \'%s\' for %s\n", url, flags & AVIO_FLAG_WRITE ? "writing" : "reading");
150 
151  return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist);
152 }
153 
154 #if FF_API_AVFORMAT_IO_CLOSE
156 {
157  avio_close(pb);
158 }
159 #endif
160 
162 {
163  return avio_close(pb);
164 }
165 
167 {
168  FFFormatContext *const si = av_mallocz(sizeof(*si));
170 
171  if (!si)
172  return NULL;
173 
174  s = &si->pub;
175  s->av_class = &av_format_context_class;
176  s->io_open = io_open_default;
177 #if FF_API_AVFORMAT_IO_CLOSE
179  s->io_close = ff_format_io_close_default;
181 #endif
182  s->io_close2= io_close2_default;
183 
185 
186  si->pkt = av_packet_alloc();
187  si->parse_pkt = av_packet_alloc();
188  if (!si->pkt || !si->parse_pkt) {
190  return NULL;
191  }
192 
194 
195  return s;
196 }
197 
199 {
201 }
202 
204 {
205  return &av_format_context_class;
206 }
207 
208 static const AVOption stream_options[] = {
209  { "disposition", NULL, offsetof(AVStream, disposition), AV_OPT_TYPE_FLAGS, { .i64 = 0 },
210  .flags = AV_OPT_FLAG_ENCODING_PARAM, .unit = "disposition" },
211  { "default", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEFAULT }, .unit = "disposition" },
212  { "dub", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DUB }, .unit = "disposition" },
213  { "original", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ORIGINAL }, .unit = "disposition" },
214  { "comment", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_COMMENT }, .unit = "disposition" },
215  { "lyrics", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_LYRICS }, .unit = "disposition" },
216  { "karaoke", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_KARAOKE }, .unit = "disposition" },
217  { "forced", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_FORCED }, .unit = "disposition" },
218  { "hearing_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_HEARING_IMPAIRED }, .unit = "disposition" },
219  { "visual_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_VISUAL_IMPAIRED }, .unit = "disposition" },
220  { "clean_effects", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS }, .unit = "disposition" },
221  { "attached_pic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ATTACHED_PIC }, .unit = "disposition" },
222  { "timed_thumbnails", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_TIMED_THUMBNAILS }, .unit = "disposition" },
223  { "captions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, .unit = "disposition" },
224  { "descriptions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, .unit = "disposition" },
225  { "metadata", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, .unit = "disposition" },
226  { "dependent", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEPENDENT }, .unit = "disposition" },
227  { "still_image", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_STILL_IMAGE }, .unit = "disposition" },
228  { NULL }
229 };
230 
231 static const AVClass stream_class = {
232  .class_name = "AVStream",
233  .item_name = av_default_item_name,
234  .version = LIBAVUTIL_VERSION_INT,
235  .option = stream_options,
236 };
237 
239 {
240  return &stream_class;
241 }
242 
244 {
245  FFFormatContext *const si = ffformatcontext(s);
246  FFStream *sti;
247  AVStream *st;
248  AVStream **streams;
249 
250  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  streams = av_realloc_array(s->streams, s->nb_streams + 1, sizeof(*streams));
257  if (!streams)
258  return NULL;
259  s->streams = streams;
260 
261  sti = av_mallocz(sizeof(*sti));
262  if (!sti)
263  return NULL;
264  st = &sti->pub;
265 
266  st->av_class = &stream_class;
268  if (!st->codecpar)
269  goto fail;
270 
272  if (!sti->avctx)
273  goto fail;
274 
275  if (s->iformat) {
276  sti->info = av_mallocz(sizeof(*sti->info));
277  if (!sti->info)
278  goto fail;
279 
280 #if FF_API_R_FRAME_RATE
281  sti->info->last_dts = AV_NOPTS_VALUE;
282 #endif
285 
286  /* default pts setting is MPEG-like */
287  avpriv_set_pts_info(st, 33, 1, 90000);
288  /* we set the current DTS to 0 so that formats without any timestamps
289  * but durations get some timestamps, formats with some unknown
290  * timestamps have their first few packets buffered and the
291  * timestamps corrected before they are returned to the user */
292  sti->cur_dts = RELATIVE_TS_BASE;
293  } else {
294  sti->cur_dts = AV_NOPTS_VALUE;
295  }
296 
297  st->index = s->nb_streams;
299  st->duration = AV_NOPTS_VALUE;
300  sti->first_dts = AV_NOPTS_VALUE;
301  sti->probe_packets = s->max_probe_packets;
304 
307  for (int i = 0; i < MAX_REORDER_DELAY + 1; i++)
308  sti->pts_buffer[i] = AV_NOPTS_VALUE;
309 
310  st->sample_aspect_ratio = (AVRational) { 0, 1 };
311 
313 
314  sti->need_context_update = 1;
315 
316  s->streams[s->nb_streams++] = st;
317  return st;
318 fail:
319  ff_free_stream(&st);
320  return NULL;
321 }
322 
323 static int option_is_disposition(const AVOption *opt)
324 {
325  return opt->type == AV_OPT_TYPE_CONST &&
326  opt->unit && !strcmp(opt->unit, "disposition");
327 }
328 
329 int av_disposition_from_string(const char *disp)
330 {
331  for (const AVOption *opt = stream_options; opt->name; opt++)
332  if (option_is_disposition(opt) && !strcmp(disp, opt->name))
333  return opt->default_val.i64;
334  return AVERROR(EINVAL);
335 }
336 
337 const char *av_disposition_to_string(int disposition)
338 {
339  int val;
340 
341  if (disposition <= 0)
342  return NULL;
343 
344  val = 1 << ff_ctz(disposition);
345  for (const AVOption *opt = stream_options; opt->name; opt++)
346  if (option_is_disposition(opt) && opt->default_val.i64 == val)
347  return opt->name;
348 
349  return NULL;
350 }
FFStreamInfo::fps_last_dts
int64_t fps_last_dts
Definition: demux.h:54
AVCodec
AVCodec.
Definition: codec.h:184
FF_ENABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:82
FFStream::inject_global_side_data
int inject_global_side_data
Internal data to inject global side data.
Definition: internal.h:361
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: options.c:243
av_opt_set_defaults
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
Definition: opt.c:1459
ITER_STATE_SHIFT
#define ITER_STATE_SHIFT
Definition: options.c:70
avio_close
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
Definition: aviobuf.c:1247
FFStream::first_dts
int64_t first_dts
Timestamp corresponding to the last dts sync point.
Definition: internal.h:409
ff_ctz
#define ff_ctz
Definition: intmath.h:107
FFStream::last_IP_pts
int64_t last_IP_pts
Definition: internal.h:377
ffformatcontext
static av_always_inline FFFormatContext * ffformatcontext(AVFormatContext *s)
Definition: internal.h:191
AV_DISPOSITION_ATTACHED_PIC
#define AV_DISPOSITION_ATTACHED_PIC
The stream is stored in the file as an attached picture/"cover art" (e.g.
Definition: avformat.h:769
format_child_class_iterate
static const AVClass * format_child_class_iterate(void **iter)
Definition: options.c:72
avformat_get_class
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
Definition: options.c:203
AV_DISPOSITION_DEFAULT
#define AV_DISPOSITION_DEFAULT
The stream should be chosen by default among other streams of the same type, unless the user has expl...
Definition: avformat.h:716
AVOption
AVOption.
Definition: opt.h:251
AVFormatContext::duration_estimation_method
enum AVDurationEstimationMethod duration_estimation_method
The duration field can be estimated through various ways, and this field can be used to know how the ...
Definition: avformat.h:1490
ffio_open_whitelist
int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist)
Definition: aviobuf.c:1220
fc
#define fc(width, name, range_min, range_max)
Definition: cbs_av1.c:551
ff_avio_class
const AVClass ff_avio_class
Definition: aviobuf.c:67
AVDictionary
Definition: dict.c:32
FFStream::last_dts_for_order_check
int64_t last_dts_for_order_check
Internal data to analyze DTS and detect faulty mpeg streams.
Definition: internal.h:354
av_disposition_to_string
const char * av_disposition_to_string(int disposition)
Definition: options.c:337
FFFormatContext::shortest_end
int64_t shortest_end
Timestamp of the end of the shortest stream.
Definition: internal.h:158
avpriv_set_pts_info
void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: avformat.c:771
finish
static void finish(void)
Definition: movenc.c:342
fail
#define fail()
Definition: checkasm.h:134
FFStreamInfo::fps_first_dts
int64_t fps_first_dts
Those are used for average framerate estimation.
Definition: demux.h:52
AV_DISPOSITION_STILL_IMAGE
#define AV_DISPOSITION_STILL_IMAGE
The video stream contains still images.
Definition: avformat.h:808
FFStream::avctx
struct AVCodecContext * avctx
The codec context used by avformat_find_stream_info, the parser, etc.
Definition: internal.h:223
AV_DISPOSITION_FORCED
#define AV_DISPOSITION_FORCED
Track should be used during playback by default.
Definition: avformat.h:749
val
static double val(void *priv, double ch)
Definition: aeval.c:77
CHILD_CLASS_ITER_DONE
@ CHILD_CLASS_ITER_DONE
Definition: options.c:66
AV_DISPOSITION_TIMED_THUMBNAILS
#define AV_DISPOSITION_TIMED_THUMBNAILS
The stream is sparse, and contains thumbnail images, often corresponding to chapter markers.
Definition: avformat.h:774
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:897
AV_PTS_WRAP_IGNORE
#define AV_PTS_WRAP_IGNORE
Options for behavior on timestamp wrap detection.
Definition: avformat.h:827
AV_DISPOSITION_CLEAN_EFFECTS
#define AV_DISPOSITION_CLEAN_EFFECTS
The audio stream contains music and sound effects without voice.
Definition: avformat.h:761
avassert.h
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AVInputFormat
Definition: avformat.h:546
avcodec_alloc_context3
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
Definition: options.c:153
s
#define s(width, name)
Definition: cbs_vp9.c:256
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:281
FFStreamInfo::last_dts
int64_t last_dts
Definition: demux.h:31
av_realloc_array
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Definition: mem.c:215
RELATIVE_TS_BASE
#define RELATIVE_TS_BASE
Definition: demux.h:64
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
AVIO_FLAG_WRITE
#define AVIO_FLAG_WRITE
write-only
Definition: avio.h:624
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
ctx
AVFormatContext * ctx
Definition: movenc.c:48
AV_CLASS_CATEGORY_DEMUXER
@ AV_CLASS_CATEGORY_DEMUXER
Definition: log.h:33
FFFormatContext
Definition: internal.h:71
AVFormatContext
Format I/O context.
Definition: avformat.h:1104
FFStream::pub
AVStream pub
The public context.
Definition: internal.h:200
CHILD_CLASS_ITER_DEMUX
@ CHILD_CLASS_ITER_DEMUX
Definition: options.c:65
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:861
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
CHILD_CLASS_ITER_MUX
@ CHILD_CLASS_ITER_MUX
Definition: options.c:64
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
avformat_options
static const AVOption avformat_options[]
Definition: options_table.h:36
AV_DISPOSITION_COMMENT
#define AV_DISPOSITION_COMMENT
The stream is a commentary track.
Definition: avformat.h:734
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AVDurationEstimationMethod
AVDurationEstimationMethod
The duration of a video can be estimated through various ways, and this enum can be used to know how ...
Definition: avformat.h:1084
AV_DISPOSITION_METADATA
#define AV_DISPOSITION_METADATA
The subtitle stream contains time-aligned metadata that is not intended to be directly presented to t...
Definition: avformat.h:798
AV_DISPOSITION_ORIGINAL
#define AV_DISPOSITION_ORIGINAL
The stream is in original language.
Definition: avformat.h:730
AVOutputFormat::priv_class
const AVClass * priv_class
AVClass for the private context.
Definition: avformat.h:536
FFFormatContext::inject_global_side_data
int inject_global_side_data
Definition: internal.h:151
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
format_to_name
FF_DISABLE_DEPRECATION_WARNINGS static const FF_ENABLE_DEPRECATION_WARNINGS char * format_to_name(void *ptr)
Definition: options.c:42
av_disposition_from_string
int av_disposition_from_string(const char *disp)
Definition: options.c:329
options
const OptionDef options[]
AV_DISPOSITION_CAPTIONS
#define AV_DISPOSITION_CAPTIONS
The subtitle stream contains captions, providing a transcription and possibly a translation of audio.
Definition: avformat.h:787
AVIOContext
Bytestream IO Context.
Definition: avio.h:166
FFFormatContext::parse_pkt
AVPacket * parse_pkt
The generic code uses this as a temporary packet to parse packets or for muxing, especially flushing.
Definition: internal.h:134
avformat_alloc_context
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
Definition: options.c:166
FFStream
Definition: internal.h:196
ff_free_stream
void ff_free_stream(AVStream **pst)
Frees a stream without modifying the corresponding AVFormatContext.
Definition: avformat.c:41
AVClass::category
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Definition: log.h:114
CHILD_CLASS_ITER_AVIO
@ CHILD_CLASS_ITER_AVIO
Definition: options.c:63
ff_format_io_close_default
void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb)
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
AV_DISPOSITION_DUB
#define AV_DISPOSITION_DUB
The stream is not in original language.
Definition: avformat.h:724
av_demuxer_iterate
const AVInputFormat * av_demuxer_iterate(void **opaque)
Iterate over all registered demuxers.
Definition: allformats.c:587
AVOption::name
const char * name
Definition: opt.h:252
AVStream::sample_aspect_ratio
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
Definition: avformat.h:916
AV_DISPOSITION_HEARING_IMPAIRED
#define AV_DISPOSITION_HEARING_IMPAIRED
The stream is intended for hearing impaired audiences.
Definition: avformat.h:753
FFStream::pts_wrap_behavior
int pts_wrap_behavior
Options for behavior, when a wrap is detected.
Definition: internal.h:334
av_packet_alloc
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
Definition: avpacket.c:62
FFStream::probe_packets
int probe_packets
Number of packets to buffer for codec probing.
Definition: internal.h:383
av_fmt_ctx_get_duration_estimation_method
enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext *ctx)
Returns the method used to set ctx->duration.
Definition: options.c:198
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:191
avcodec_parameters_alloc
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
Definition: codec_par.c:53
get_category
static AVClassCategory get_category(void *ptr)
Definition: options.c:118
AVClassCategory
AVClassCategory
Definition: log.h:28
AVOutputFormat
Definition: avformat.h:507
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
avio_internal.h
internal.h
io_close2_default
static int io_close2_default(AVFormatContext *s, AVIOContext *pb)
Definition: options.c:161
AVStream::av_class
const AVClass * av_class
A class for AVOptions.
Definition: avformat.h:842
AV_DISPOSITION_KARAOKE
#define AV_DISPOSITION_KARAOKE
The stream contains karaoke audio.
Definition: avformat.h:742
stream_class
static const AVClass stream_class
Definition: options.c:231
FFStream::pts_buffer
int64_t pts_buffer[MAX_REORDER_DELAY+1]
Definition: internal.h:349
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:254
demux.h
AV_DISPOSITION_DEPENDENT
#define AV_DISPOSITION_DEPENDENT
The audio stream is intended to be mixed with another stream before presentation.
Definition: avformat.h:804
avcodec.h
MAX_REORDER_DELAY
@ MAX_REORDER_DELAY
Definition: vaapi_encode.h:45
AV_DISPOSITION_VISUAL_IMPAIRED
#define AV_DISPOSITION_VISUAL_IMPAIRED
The stream is intended for visually impaired audiences.
Definition: avformat.h:757
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:838
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
avformat.h
AVOption::type
enum AVOptionType type
Definition: opt.h:265
AV_DISPOSITION_DESCRIPTIONS
#define AV_DISPOSITION_DESCRIPTIONS
The subtitle stream contains a textual description of the video content.
Definition: avformat.h:793
format_child_next
static void * format_child_next(void *obj, void *prev)
Definition: options.c:50
AVStream::index
int index
stream index in AVFormatContext
Definition: avformat.h:844
av_muxer_iterate
const AVOutputFormat * av_muxer_iterate(void **opaque)
Iterate over all registered muxers.
Definition: allformats.c:566
AV_CLASS_CATEGORY_MUXER
@ AV_CLASS_CATEGORY_MUXER
Definition: log.h:32
avformat_free_context
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
Definition: avformat.c:96
stream_options
static const AVOption stream_options[]
Definition: options.c:208
FFStream::info
struct FFStreamInfo * info
Stream information used internally by avformat_find_stream_info()
Definition: internal.h:249
io_open_default
static int io_open_default(AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
Definition: options.c:136
FF_DISABLE_DEPRECATION_WARNINGS
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:81
AVOption::unit
const char * unit
The logical unit to which the option belongs.
Definition: opt.h:307
FFFormatContext::pkt
AVPacket * pkt
Used to hold temporary packets for the generic demuxing code.
Definition: internal.h:141
codec_par.h
FFStream::cur_dts
int64_t cur_dts
Definition: internal.h:410
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:224
FFStream::need_context_update
int need_context_update
Whether the internal avctx needs to be updated from codecpar (after a late change to codecpar)
Definition: internal.h:240
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
options_table.h
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVStream::start_time
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
Definition: avformat.h:887
state
static struct @345 state
av_stream_get_class
const AVClass * av_stream_get_class(void)
Get the AVClass for AVStream.
Definition: options.c:238
FFFormatContext::pub
AVFormatContext pub
The public context.
Definition: internal.h:75
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
option_is_disposition
static int option_is_disposition(const AVOption *opt)
Definition: options.c:323
FFStream::pts_wrap_reference
int64_t pts_wrap_reference
Internal data to check for wrapping of the time stamp.
Definition: internal.h:322
AVInputFormat::priv_class
const AVClass * priv_class
AVClass for the private context.
Definition: avformat.h:576
AV_DISPOSITION_LYRICS
#define AV_DISPOSITION_LYRICS
The stream contains song lyrics.
Definition: avformat.h:738
av_format_context_class
static const AVClass av_format_context_class
Definition: options.c:125
intmath.h