FFmpeg
Loading...
Searching...
No Matches
apngdec.c
Go to the documentation of this file.
1/*
2 * APNG demuxer
3 * Copyright (c) 2014 Benoit Fouet
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22/**
23 * @file
24 * APNG demuxer.
25 * @see https://wiki.mozilla.org/APNG_Specification
26 * @see http://www.w3.org/TR/PNG
27 */
28
29#include "avformat.h"
30#include "avio_internal.h"
31#include "demux.h"
32#include "internal.h"
33#include "libavutil/imgutils.h"
35#include "libavutil/mem.h"
36#include "libavutil/opt.h"
37#include "libavcodec/apng.h"
38#include "libavcodec/png.h"
40
41#define DEFAULT_APNG_FPS 15
42
43typedef struct APNGDemuxContext {
44 const AVClass *class;
45
48
50
52
53 /* fcTL and fdAT chunks share a single sequence number, which must start
54 * at 0 and increase by one for every chunk, with no gap or duplicate */
55 uint32_t expected_seq;
56
57 /*
58 * loop options
59 */
61 uint32_t num_frames;
62 uint32_t num_play;
63 uint32_t cur_loop;
65
66/*
67 * To be a valid APNG file, we mandate, in this order:
68 * PNGSIG
69 * IHDR
70 * ...
71 * acTL
72 * ...
73 * IDAT
74 */
75static int apng_probe(const AVProbeData *p)
76{
78 int state = 0;
79 uint32_t len, tag;
80
81 bytestream2_init(&gb, p->buf, p->buf_size);
82
83 if (bytestream2_get_be64(&gb) != PNGSIG)
84 return 0;
85
86 for (;;) {
87 len = bytestream2_get_be32(&gb);
88 if (len > 0x7fffffff)
89 return 0;
90
91 tag = bytestream2_get_le32(&gb);
92 /* we don't check IDAT size, as this is the last tag
93 * we check, and it may be larger than the probe buffer */
94 if (tag != MKTAG('I', 'D', 'A', 'T') &&
96 return 0;
97
98 switch (tag) {
99 case MKTAG('I', 'H', 'D', 'R'):
100 if (len != 13)
101 return 0;
102 if (av_image_check_size(bytestream2_get_be32(&gb), bytestream2_get_be32(&gb), 0, NULL))
103 return 0;
104 bytestream2_skip(&gb, 9);
105 state++;
106 break;
107 case MKTAG('a', 'c', 'T', 'L'):
108 if (state != 1 ||
109 len != 8 ||
110 bytestream2_get_be32(&gb) == 0) /* 0 is not a valid value for number of frames */
111 return 0;
112 bytestream2_skip(&gb, 8);
113 state++;
114 break;
115 case MKTAG('I', 'D', 'A', 'T'):
116 if (state != 2)
117 return 0;
118 goto end;
119 default:
120 /* skip other tags */
121 bytestream2_skip(&gb, len + 4);
122 break;
123 }
124 }
125
126end:
127 return AVPROBE_SCORE_MAX;
128}
129
131{
132 int previous_size = par->extradata_size;
133 int new_size, ret;
134 uint8_t *new_extradata;
135
136 if (len > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - previous_size)
137 return AVERROR_INVALIDDATA;
138
139 new_size = previous_size + len;
140 new_extradata = av_realloc(par->extradata, new_size + AV_INPUT_BUFFER_PADDING_SIZE);
141 if (!new_extradata)
142 return AVERROR(ENOMEM);
143 memset(new_extradata + new_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
144 par->extradata = new_extradata;
145 par->extradata_size = new_size;
146
147 if ((ret = ffio_read_size(pb, par->extradata + previous_size, len)) < 0)
148 return ret;
149
150 return previous_size;
151}
152
154{
155 APNGDemuxContext *ctx = s->priv_data;
156 AVIOContext *pb = s->pb;
157 uint32_t len, tag;
158 AVStream *st;
159 int acTL_found = 0;
160 int64_t ret;
161
162 /* verify PNGSIG */
163 if (avio_rb64(pb) != PNGSIG)
164 return AVERROR_INVALIDDATA;
165
166 /* parse IHDR (must be first chunk) */
167 len = avio_rb32(pb);
168 tag = avio_rl32(pb);
169 if (len != 13 || tag != MKTAG('I', 'H', 'D', 'R'))
170 return AVERROR_INVALIDDATA;
171
173 if (!st)
174 return AVERROR(ENOMEM);
175
176 /* set the timebase to something large enough (1/100,000 of second)
177 * to hopefully cope with all sane frame durations */
178 avpriv_set_pts_info(st, 64, 1, 100000);
181 st->codecpar->width = avio_rb32(pb);
182 st->codecpar->height = avio_rb32(pb);
183 if ((ret = av_image_check_size(st->codecpar->width, st->codecpar->height, 0, s)) < 0)
184 return ret;
185
186 /* extradata will contain every chunk up to the first fcTL (excluded) */
187 ret = ff_alloc_extradata(st->codecpar, len + 12);
188 if (ret < 0)
189 return ret;
191 AV_WL32(st->codecpar->extradata+4, tag);
194 if ((ret = ffio_read_size(pb, st->codecpar->extradata + 16, 9)) < 0)
195 return ret;
196
197 while (1) {
198 if (acTL_found && ctx->num_play != 1) {
199 int64_t size = avio_size(pb);
201 if (size < 0 || offset < 0 ||
202 (ret = ffio_ensure_seekback(pb, size - offset)) < 0) {
203 av_log(s, AV_LOG_WARNING, "Could not ensure seekback, will not loop\n");
204 ctx->num_play = 1;
205 }
206 }
207 if ((ctx->num_play == 1 || !acTL_found) &&
208 ((ret = ffio_ensure_seekback(pb, 4 /* len */ + 4 /* tag */)) < 0))
209 return ret;
210
211 len = avio_rb32(pb);
212 if (len > INT_MAX - 12)
213 return AVERROR_INVALIDDATA;
214
215 tag = avio_rl32(pb);
216 switch (tag) {
217 case MKTAG('a', 'c', 'T', 'L'):
218 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0 ||
219 (ret = append_extradata(st->codecpar, pb, len + 12)) < 0)
220 return ret;
221 acTL_found = 1;
222 ctx->num_frames = AV_RB32(st->codecpar->extradata + ret + 8);
223 ctx->num_play = AV_RB32(st->codecpar->extradata + ret + 12);
224 av_log(s, AV_LOG_DEBUG, "num_frames: %"PRIu32", num_play: %"PRIu32"\n",
225 ctx->num_frames, ctx->num_play);
226 break;
227 case MKTAG('f', 'c', 'T', 'L'):
228 if (!acTL_found || len != APNG_FCTL_CHUNK_SIZE) {
229 return AVERROR_INVALIDDATA;
230 }
231 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0)
232 return ret;
233 return 0;
234 default:
235 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0 ||
236 (ret = append_extradata(st->codecpar, pb, len + 12)) < 0)
237 return ret;
238 }
239 }
240}
241
242/* Out-of-order chunks are only reported: the sequence is resynchronized on the
243 * value actually read, so that every following chunk is not reported as well. */
245 const char *name, uint32_t sequence_number)
246{
247 /* A seek can resume at any frame, so resynchronize before checking. */
248 if (s->io_repositioned) {
249 ctx->expected_seq = sequence_number;
250 s->io_repositioned = 0;
251 }
252
253 if (sequence_number != ctx->expected_seq)
254 av_log(s, AV_LOG_WARNING, "Invalid %s sequence number %"PRIu32
255 ", expected %"PRIu32"\n", name, sequence_number, ctx->expected_seq);
256
257 ctx->expected_seq = sequence_number + 1;
258}
259
260/* check the sequence number of an fdAT chunk: it is the first field of the
261 * chunk, which the caller has just appended at the end of the packet */
263 AVPacket *pkt, uint32_t len)
264{
265 check_chunk_sequence(s, ctx, "fdAT", AV_RB32(pkt->data + pkt->size - len - 4));
266}
267
269{
270 uint32_t sequence_number, width, height, x_offset, y_offset;
271 uint16_t delay_num, delay_den;
272 uint8_t dispose_op, blend_op;
273
274 sequence_number = avio_rb32(s->pb);
275 width = avio_rb32(s->pb);
276 height = avio_rb32(s->pb);
277 x_offset = avio_rb32(s->pb);
278 y_offset = avio_rb32(s->pb);
279 delay_num = avio_rb16(s->pb);
280 delay_den = avio_rb16(s->pb);
281 dispose_op = avio_r8(s->pb);
282 blend_op = avio_r8(s->pb);
283 avio_skip(s->pb, 4); /* crc */
284
285 check_chunk_sequence(s, ctx, "fcTL", sequence_number);
286
287 /* default is hundredths of seconds */
288 if (!delay_den)
289 delay_den = 100;
290 if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
291 delay_num = 1;
292 delay_den = ctx->default_fps;
293 }
294 ctx->pkt_duration = av_rescale_q(delay_num,
295 (AVRational){ 1, delay_den },
296 s->streams[0]->time_base);
297
298 av_log(s, AV_LOG_DEBUG, "%s: "
299 "sequence_number: %"PRId32", "
300 "width: %"PRIu32", "
301 "height: %"PRIu32", "
302 "x_offset: %"PRIu32", "
303 "y_offset: %"PRIu32", "
304 "delay_num: %"PRIu16", "
305 "delay_den: %"PRIu16", "
306 "dispose_op: %d, "
307 "blend_op: %d\n",
308 __func__,
309 sequence_number,
310 width,
311 height,
312 x_offset,
313 y_offset,
314 delay_num,
315 delay_den,
316 dispose_op,
317 blend_op);
318
319 if (width != s->streams[0]->codecpar->width ||
320 height != s->streams[0]->codecpar->height ||
321 x_offset != 0 ||
322 y_offset != 0) {
323 if (sequence_number == 0 ||
324 x_offset >= s->streams[0]->codecpar->width ||
325 width > s->streams[0]->codecpar->width - x_offset ||
326 y_offset >= s->streams[0]->codecpar->height ||
327 height > s->streams[0]->codecpar->height - y_offset)
328 return AVERROR_INVALIDDATA;
329 ctx->is_key_frame = 0;
330 } else {
331 if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS)
332 dispose_op = APNG_DISPOSE_OP_BACKGROUND;
333 ctx->is_key_frame = dispose_op == APNG_DISPOSE_OP_BACKGROUND ||
334 blend_op == APNG_BLEND_OP_SOURCE;
335 }
336
337 return 0;
338}
339
341{
342 APNGDemuxContext *ctx = s->priv_data;
343 int64_t ret;
345 AVIOContext *pb = s->pb;
346 uint32_t len, tag;
347
348 /*
349 * fcTL chunk length, in bytes:
350 * 4 (length)
351 * 4 (tag)
352 * 26 (actual chunk)
353 * 4 (crc) bytes
354 * and needed next:
355 * 4 (length)
356 * 4 (tag (must be fdAT or IDAT))
357 */
358 /* if num_play is not 1, then the seekback is already guaranteed */
359 if (ctx->num_play == 1 && (ret = ffio_ensure_seekback(pb, 46)) < 0)
360 return ret;
361
362 len = avio_rb32(pb);
363 tag = avio_rl32(pb);
364
365 if (avio_feof(pb))
366 return AVERROR_EOF;
367
368 switch (tag) {
369 case MKTAG('f', 'c', 'T', 'L'):
371 return AVERROR_INVALIDDATA;
372
373 if ((ret = decode_fctl_chunk(s, ctx)) < 0)
374 return ret;
375
376 /* fcTL may be followed by other chunks before fdAT or IDAT */
377 len = avio_rb32(pb);
378 tag = avio_rl32(pb);
379 if (len > 0x7fffffff)
380 return AVERROR_INVALIDDATA;
381
382 /* check for empty frame */
383 if (tag == MKTAG('f', 'c', 'T', 'L') ||
384 tag == MKTAG('I', 'E', 'N', 'D'))
385 return AVERROR_INVALIDDATA;
386
387 size = 38 /* fcTL */ + 8 /* len, tag */ + len + 4 /* crc */;
388 if (size > INT_MAX)
389 return AVERROR(EINVAL);
390
391 if ((ret = avio_seek(pb, -46, SEEK_CUR)) < 0 ||
392 (ret = av_append_packet(pb, pkt, size)) < 0)
393 return ret;
394
395 if (tag == MKTAG('f', 'd', 'A', 'T')) {
396 if (len < 4 || ret != size)
397 return AVERROR_INVALIDDATA;
399 }
400
401 if (ctx->num_play == 1 && (ret = ffio_ensure_seekback(pb, 8)) < 0)
402 return ret;
403
404 len = avio_rb32(pb);
405 tag = avio_rl32(pb);
406 while (tag &&
407 tag != MKTAG('f', 'c', 'T', 'L') &&
408 tag != MKTAG('I', 'E', 'N', 'D')) {
409 if (len > 0x7fffffff)
410 return AVERROR_INVALIDDATA;
411 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0 ||
412 (ret = av_append_packet(pb, pkt, len + 12)) < 0)
413 return ret;
414
415 if (tag == MKTAG('f', 'd', 'A', 'T')) {
416 if (len < 4 || ret != len + 12)
417 return AVERROR_INVALIDDATA;
419 }
420
421 if (ctx->num_play == 1 && (ret = ffio_ensure_seekback(pb, 8)) < 0)
422 return ret;
423 len = avio_rb32(pb);
424 tag = avio_rl32(pb);
425 }
426 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0)
427 return ret;
428
429 if (ctx->is_key_frame)
430 pkt->flags |= AV_PKT_FLAG_KEY;
431 pkt->pts = pkt->dts = AV_NOPTS_VALUE;
432 pkt->duration = ctx->pkt_duration;
433 return ret;
434 case MKTAG('I', 'E', 'N', 'D'):
435 ctx->cur_loop++;
436 if (ctx->ignore_loop || ctx->num_play >= 1 && ctx->cur_loop == ctx->num_play) {
437 avio_seek(pb, -8, SEEK_CUR);
438 return AVERROR_EOF;
439 }
440 ctx->expected_seq = 0;
441 if ((ret = avio_seek(pb, s->streams[0]->codecpar->extradata_size + 8, SEEK_SET)) < 0)
442 return ret;
443 return 0;
444 default:
445 avpriv_request_sample(s, "In-stream tag=%s (0x%08"PRIX32") len=%"PRIu32,
447 avio_skip(pb, len + 4);
448 }
449
450 /* Handle the unsupported yet cases */
452}
453
454static const AVOption options[] = {
455 { "ignore_loop", "ignore loop setting" , offsetof(APNGDemuxContext, ignore_loop),
456 AV_OPT_TYPE_BOOL, { .i64 = 1 } , 0, 1 , AV_OPT_FLAG_DECODING_PARAM },
457 { "max_fps" , "maximum framerate (0 is no limit)" , offsetof(APNGDemuxContext, max_fps),
458 AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
459 { "default_fps", "default framerate (0 is as fast as possible)", offsetof(APNGDemuxContext, default_fps),
461 { NULL },
462};
463
464static const AVClass demuxer_class = {
465 .class_name = "APNG demuxer",
466 .item_name = av_default_item_name,
467 .option = options,
468 .version = LIBAVUTIL_VERSION_INT,
469 .category = AV_CLASS_CATEGORY_DEMUXER,
470};
471
473 .p.name = "apng",
474 .p.long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
475 .p.flags = AVFMT_GENERIC_INDEX,
476 .p.priv_class = &demuxer_class,
477 .priv_data_size = sizeof(APNGDemuxContext),
481};
const FFInputFormat ff_apng_demuxer
Definition apngdec.c:472
static AVFormatContext * ctx
APNG common header.
#define APNG_FCTL_CHUNK_SIZE
Definition apng.h:42
@ APNG_DISPOSE_OP_BACKGROUND
Definition apng.h:32
@ APNG_DISPOSE_OP_PREVIOUS
Definition apng.h:33
@ APNG_BLEND_OP_SOURCE
Definition apng.h:37
static int apng_read_header(AVFormatContext *s)
Definition apngdec.c:153
static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx)
Definition apngdec.c:268
static int apng_probe(const AVProbeData *p)
Definition apngdec.c:75
static const AVClass demuxer_class
Definition apngdec.c:464
static int append_extradata(AVCodecParameters *par, AVIOContext *pb, int len)
Definition apngdec.c:130
static void check_fdat_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket *pkt, uint32_t len)
Definition apngdec.c:262
static void check_chunk_sequence(AVFormatContext *s, APNGDemuxContext *ctx, const char *name, uint32_t sequence_number)
Definition apngdec.c:244
static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition apngdec.c:340
#define DEFAULT_APNG_FPS
Definition apngdec.c:41
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:865
Main libavformat public API header.
int av_append_packet(AVIOContext *s, AVPacket *pkt, int size)
Read data and append it to the current content of the AVPacket.
Definition utils.c:114
#define AVPROBE_SCORE_MAX
maximum score
Definition avformat.h:485
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition avformat.h:501
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition aviobuf.c:236
uint64_t avio_rb64(AVIOContext *s)
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition aviobuf.c:326
unsigned int avio_rb16(AVIOContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition aviobuf.c:349
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition avio.h:507
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition aviobuf.c:321
unsigned int avio_rl32(AVIOContext *s)
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
Definition aviobuf.c:611
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
Definition aviobuf.c:994
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition aviobuf.c:674
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
Definition bytestream.h:158
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition bytestream.h:137
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition bytestream.h:168
#define s(width, name)
Definition cbs_vp9.c:198
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static AVPacket * pkt
int ret
Definition ffplay.c:391
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition opt.h:355
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_CODEC_ID_APNG
Definition codec_id.h:260
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
Definition defs.h:40
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition packet.h:657
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition error.h:64
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:247
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define av_fourcc2str(fourcc)
Definition avutil.h:323
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
Definition imgutils.c:318
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition avutil.h:247
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
misc image utilities
#define AV_WB32(p, v)
#define AV_WL32(p, v)
#define AV_RB32(p)
unsigned offset
Definition libaomenc.c:763
int ff_alloc_extradata(AVCodecParameters *par, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0.
Definition utils.c:237
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:97
@ AV_CLASS_CATEGORY_DEMUXER
Definition log.h:33
#define MKTAG(a, b, c, d)
Definition macros.h:55
Memory handling functions.
uint32_t tag
Definition movenc.c:2128
#define av_realloc(p, s)
Definition ops_static.c:54
AVOptions.
#define PNGSIG
Definition png.h:49
const char * name
Definition qsvenc.c:142
uint32_t expected_seq
Definition apngdec.c:55
uint32_t num_frames
Definition apngdec.c:61
uint32_t num_play
Definition apngdec.c:62
uint32_t cur_loop
Definition apngdec.c:63
Describe the class of an AVClass context structure.
Definition log.h:76
This struct describes the properties of an encoded stream.
Definition codec_par.h:49
int extradata_size
Size of the extradata content in bytes.
Definition codec_par.h:75
int height
The height of the video frame in pixels.
Definition codec_par.h:150
int width
The width of the video frame in pixels.
Definition codec_par.h:143
enum AVMediaType codec_type
General type of the encoded data.
Definition codec_par.h:53
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition codec_par.h:71
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition codec_par.h:57
Format I/O context.
Definition avformat.h:1401
Bytestream IO Context.
Definition avio.h:160
AVOption.
Definition opt.h:428
This structure stores compressed data.
Definition packet.h:587
This structure contains the data a format has to probe a file.
Definition avformat.h:473
Rational number (pair of numerator and denominator).
Definition rational.h:58
Stream structure.
Definition avformat.h:768
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition avformat.h:791
#define avpriv_request_sample(...)
#define av_log(a,...)
#define height
Definition dsp.h:99
#define width
Definition dsp.h:99
static struct @232240247175332074307271266321204261331170211232 state
int size
int len