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 /* Fewer than 8 bytes left means the next length and type are not
88 * both present. bytestream2_get_be32() then returns 0, so the type
89 * looks critical and a valid APNG is rejected. Ask for the header. */
90 if (bytestream2_get_bytes_left(&gb) < 8)
91 return AVERROR(EAGAIN);
92
93 len = bytestream2_get_be32(&gb);
94 if (len > 0x7fffffff)
95 return 0;
96
97 tag = bytestream2_get_le32(&gb);
98 /* we don't check IDAT size, as this is the last tag
99 * we check, and it may be larger than the probe buffer */
100 if (tag != MKTAG('I', 'D', 'A', 'T') &&
101 len + 4 > bytestream2_get_bytes_left(&gb)) {
102 /* Ancillary chunks (bit 5 of the first type byte set, i.e. a
103 * lowercase first letter) may be large, e.g. a C2PA manifest.
104 * A PLTE is critical but small, and it can still straddle the
105 * probe buffer. acTL/IDAT may follow either of them. Other
106 * critical chunks still reject the file. */
107 if ((tag & 0x20) || tag == MKTAG('P', 'L', 'T', 'E'))
108 return AVERROR(EAGAIN);
109 return 0;
110 }
111
112 switch (tag) {
113 case MKTAG('I', 'H', 'D', 'R'):
114 if (len != 13)
115 return 0;
116 if (av_image_check_size(bytestream2_get_be32(&gb), bytestream2_get_be32(&gb), 0, NULL))
117 return 0;
118 bytestream2_skip(&gb, 9);
119 state++;
120 break;
121 case MKTAG('a', 'c', 'T', 'L'):
122 if (state != 1 ||
123 len != 8 ||
124 bytestream2_get_be32(&gb) == 0) /* 0 is not a valid value for number of frames */
125 return 0;
126 bytestream2_skip(&gb, 8);
127 state++;
128 break;
129 case MKTAG('I', 'D', 'A', 'T'):
130 if (state != 2)
131 return 0;
132 goto end;
133 default:
134 /* skip other tags */
135 bytestream2_skip(&gb, len + 4);
136 break;
137 }
138 }
139
140end:
141 return AVPROBE_SCORE_MAX;
142}
143
145{
146 int previous_size = par->extradata_size;
147 int new_size, ret;
148 uint8_t *new_extradata;
149
150 if (len > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - previous_size)
151 return AVERROR_INVALIDDATA;
152
153 new_size = previous_size + len;
154 new_extradata = av_realloc(par->extradata, new_size + AV_INPUT_BUFFER_PADDING_SIZE);
155 if (!new_extradata)
156 return AVERROR(ENOMEM);
157 memset(new_extradata + new_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
158 par->extradata = new_extradata;
159 par->extradata_size = new_size;
160
161 if ((ret = ffio_read_size(pb, par->extradata + previous_size, len)) < 0)
162 return ret;
163
164 return previous_size;
165}
166
168{
169 APNGDemuxContext *ctx = s->priv_data;
170 AVIOContext *pb = s->pb;
171 uint32_t len, tag;
172 AVStream *st;
173 int acTL_found = 0;
174 int64_t ret;
175
176 /* verify PNGSIG */
177 if (avio_rb64(pb) != PNGSIG)
178 return AVERROR_INVALIDDATA;
179
180 /* parse IHDR (must be first chunk) */
181 len = avio_rb32(pb);
182 tag = avio_rl32(pb);
183 if (len != 13 || tag != MKTAG('I', 'H', 'D', 'R'))
184 return AVERROR_INVALIDDATA;
185
187 if (!st)
188 return AVERROR(ENOMEM);
189
190 /* set the timebase to something large enough (1/100,000 of second)
191 * to hopefully cope with all sane frame durations */
192 avpriv_set_pts_info(st, 64, 1, 100000);
195 st->codecpar->width = avio_rb32(pb);
196 st->codecpar->height = avio_rb32(pb);
197 if ((ret = av_image_check_size(st->codecpar->width, st->codecpar->height, 0, s)) < 0)
198 return ret;
199
200 /* extradata will contain every chunk up to the first fcTL (excluded) */
201 ret = ff_alloc_extradata(st->codecpar, len + 12);
202 if (ret < 0)
203 return ret;
205 AV_WL32(st->codecpar->extradata+4, tag);
208 if ((ret = ffio_read_size(pb, st->codecpar->extradata + 16, 9)) < 0)
209 return ret;
210
211 while (1) {
212 if (acTL_found && ctx->num_play != 1) {
213 int64_t size = avio_size(pb);
215 if (size < 0 || offset < 0 ||
216 (ret = ffio_ensure_seekback(pb, size - offset)) < 0) {
217 av_log(s, AV_LOG_WARNING, "Could not ensure seekback, will not loop\n");
218 ctx->num_play = 1;
219 }
220 }
221 if ((ctx->num_play == 1 || !acTL_found) &&
222 ((ret = ffio_ensure_seekback(pb, 4 /* len */ + 4 /* tag */)) < 0))
223 return ret;
224
225 len = avio_rb32(pb);
226 if (len > INT_MAX - 12)
227 return AVERROR_INVALIDDATA;
228
229 tag = avio_rl32(pb);
230 switch (tag) {
231 case MKTAG('a', 'c', 'T', 'L'):
232 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0 ||
233 (ret = append_extradata(st->codecpar, pb, len + 12)) < 0)
234 return ret;
235 acTL_found = 1;
236 ctx->num_frames = AV_RB32(st->codecpar->extradata + ret + 8);
237 ctx->num_play = AV_RB32(st->codecpar->extradata + ret + 12);
238 av_log(s, AV_LOG_DEBUG, "num_frames: %"PRIu32", num_play: %"PRIu32"\n",
239 ctx->num_frames, ctx->num_play);
240 break;
241 case MKTAG('f', 'c', 'T', 'L'):
242 if (!acTL_found || len != APNG_FCTL_CHUNK_SIZE) {
243 return AVERROR_INVALIDDATA;
244 }
245 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0)
246 return ret;
247 return 0;
248 default:
249 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0 ||
250 (ret = append_extradata(st->codecpar, pb, len + 12)) < 0)
251 return ret;
252 }
253 }
254}
255
256/* Out-of-order chunks are only reported: the sequence is resynchronized on the
257 * value actually read, so that every following chunk is not reported as well. */
259 const char *name, uint32_t sequence_number)
260{
261 /* A seek can resume at any frame, so resynchronize before checking. */
262 if (s->io_repositioned) {
263 ctx->expected_seq = sequence_number;
264 s->io_repositioned = 0;
265 }
266
267 if (sequence_number != ctx->expected_seq)
268 av_log(s, AV_LOG_WARNING, "Invalid %s sequence number %"PRIu32
269 ", expected %"PRIu32"\n", name, sequence_number, ctx->expected_seq);
270
271 ctx->expected_seq = sequence_number + 1;
272}
273
274/* check the sequence number of an fdAT chunk: it is the first field of the
275 * chunk, which the caller has just appended at the end of the packet */
277 AVPacket *pkt, uint32_t len)
278{
279 check_chunk_sequence(s, ctx, "fdAT", AV_RB32(pkt->data + pkt->size - len - 4));
280}
281
283{
284 uint32_t sequence_number, width, height, x_offset, y_offset;
285 uint16_t delay_num, delay_den;
286 uint8_t dispose_op, blend_op;
287
288 sequence_number = avio_rb32(s->pb);
289 width = avio_rb32(s->pb);
290 height = avio_rb32(s->pb);
291 x_offset = avio_rb32(s->pb);
292 y_offset = avio_rb32(s->pb);
293 delay_num = avio_rb16(s->pb);
294 delay_den = avio_rb16(s->pb);
295 dispose_op = avio_r8(s->pb);
296 blend_op = avio_r8(s->pb);
297 avio_skip(s->pb, 4); /* crc */
298
299 check_chunk_sequence(s, ctx, "fcTL", sequence_number);
300
301 /* default is hundredths of seconds */
302 if (!delay_den)
303 delay_den = 100;
304 if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
305 delay_num = 1;
306 delay_den = ctx->default_fps;
307 }
308 ctx->pkt_duration = av_rescale_q(delay_num,
309 (AVRational){ 1, delay_den },
310 s->streams[0]->time_base);
311
312 av_log(s, AV_LOG_DEBUG, "%s: "
313 "sequence_number: %"PRId32", "
314 "width: %"PRIu32", "
315 "height: %"PRIu32", "
316 "x_offset: %"PRIu32", "
317 "y_offset: %"PRIu32", "
318 "delay_num: %"PRIu16", "
319 "delay_den: %"PRIu16", "
320 "dispose_op: %d, "
321 "blend_op: %d\n",
322 __func__,
323 sequence_number,
324 width,
325 height,
326 x_offset,
327 y_offset,
328 delay_num,
329 delay_den,
330 dispose_op,
331 blend_op);
332
333 if (width != s->streams[0]->codecpar->width ||
334 height != s->streams[0]->codecpar->height ||
335 x_offset != 0 ||
336 y_offset != 0) {
337 if (sequence_number == 0 ||
338 x_offset >= s->streams[0]->codecpar->width ||
339 width > s->streams[0]->codecpar->width - x_offset ||
340 y_offset >= s->streams[0]->codecpar->height ||
341 height > s->streams[0]->codecpar->height - y_offset)
342 return AVERROR_INVALIDDATA;
343 ctx->is_key_frame = 0;
344 } else {
345 if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS)
346 dispose_op = APNG_DISPOSE_OP_BACKGROUND;
347 ctx->is_key_frame = dispose_op == APNG_DISPOSE_OP_BACKGROUND ||
348 blend_op == APNG_BLEND_OP_SOURCE;
349 }
350
351 return 0;
352}
353
355{
356 APNGDemuxContext *ctx = s->priv_data;
357 int64_t ret;
359 AVIOContext *pb = s->pb;
360 uint32_t len, tag;
361
362 /*
363 * fcTL chunk length, in bytes:
364 * 4 (length)
365 * 4 (tag)
366 * 26 (actual chunk)
367 * 4 (crc) bytes
368 * and needed next:
369 * 4 (length)
370 * 4 (tag (must be fdAT or IDAT))
371 */
372 /* if num_play is not 1, then the seekback is already guaranteed */
373 if (ctx->num_play == 1 && (ret = ffio_ensure_seekback(pb, 46)) < 0)
374 return ret;
375
376 len = avio_rb32(pb);
377 tag = avio_rl32(pb);
378
379 if (avio_feof(pb))
380 return AVERROR_EOF;
381
382 switch (tag) {
383 case MKTAG('f', 'c', 'T', 'L'):
385 return AVERROR_INVALIDDATA;
386
387 if ((ret = decode_fctl_chunk(s, ctx)) < 0)
388 return ret;
389
390 /* fcTL may be followed by other chunks before fdAT or IDAT */
391 len = avio_rb32(pb);
392 tag = avio_rl32(pb);
393 if (len > 0x7fffffff)
394 return AVERROR_INVALIDDATA;
395
396 /* check for empty frame */
397 if (tag == MKTAG('f', 'c', 'T', 'L') ||
398 tag == MKTAG('I', 'E', 'N', 'D'))
399 return AVERROR_INVALIDDATA;
400
401 size = 38 /* fcTL */ + 8 /* len, tag */ + len + 4 /* crc */;
402 if (size > INT_MAX)
403 return AVERROR(EINVAL);
404
405 if ((ret = avio_seek(pb, -46, SEEK_CUR)) < 0 ||
406 (ret = av_append_packet(pb, pkt, size)) < 0)
407 return ret;
408
409 if (tag == MKTAG('f', 'd', 'A', 'T')) {
410 if (len < 4 || ret != size)
411 return AVERROR_INVALIDDATA;
413 }
414
415 if (ctx->num_play == 1 && (ret = ffio_ensure_seekback(pb, 8)) < 0)
416 return ret;
417
418 len = avio_rb32(pb);
419 tag = avio_rl32(pb);
420 while (tag &&
421 tag != MKTAG('f', 'c', 'T', 'L') &&
422 tag != MKTAG('I', 'E', 'N', 'D')) {
423 if (len > 0x7fffffff)
424 return AVERROR_INVALIDDATA;
425 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0 ||
426 (ret = av_append_packet(pb, pkt, len + 12)) < 0)
427 return ret;
428
429 if (tag == MKTAG('f', 'd', 'A', 'T')) {
430 if (len < 4 || ret != len + 12)
431 return AVERROR_INVALIDDATA;
433 }
434
435 if (ctx->num_play == 1 && (ret = ffio_ensure_seekback(pb, 8)) < 0)
436 return ret;
437 len = avio_rb32(pb);
438 tag = avio_rl32(pb);
439 }
440 if ((ret = avio_seek(pb, -8, SEEK_CUR)) < 0)
441 return ret;
442
443 if (ctx->is_key_frame)
444 pkt->flags |= AV_PKT_FLAG_KEY;
445 pkt->pts = pkt->dts = AV_NOPTS_VALUE;
446 pkt->duration = ctx->pkt_duration;
447 return ret;
448 case MKTAG('I', 'E', 'N', 'D'):
449 ctx->cur_loop++;
450 if (ctx->ignore_loop || ctx->num_play >= 1 && ctx->cur_loop == ctx->num_play) {
451 avio_seek(pb, -8, SEEK_CUR);
452 return AVERROR_EOF;
453 }
454 ctx->expected_seq = 0;
455 if ((ret = avio_seek(pb, s->streams[0]->codecpar->extradata_size + 8, SEEK_SET)) < 0)
456 return ret;
457 return 0;
458 default:
459 avpriv_request_sample(s, "In-stream tag=%s (0x%08"PRIX32") len=%"PRIu32,
461 avio_skip(pb, len + 4);
462 }
463
464 /* Handle the unsupported yet cases */
466}
467
468static const AVOption options[] = {
469 { "ignore_loop", "ignore loop setting" , offsetof(APNGDemuxContext, ignore_loop),
470 AV_OPT_TYPE_BOOL, { .i64 = 1 } , 0, 1 , AV_OPT_FLAG_DECODING_PARAM },
471 { "max_fps" , "maximum framerate (0 is no limit)" , offsetof(APNGDemuxContext, max_fps),
472 AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
473 { "default_fps", "default framerate (0 is as fast as possible)", offsetof(APNGDemuxContext, default_fps),
475 { NULL },
476};
477
478static const AVClass demuxer_class = {
479 .class_name = "APNG demuxer",
480 .item_name = av_default_item_name,
481 .option = options,
482 .version = LIBAVUTIL_VERSION_INT,
483 .category = AV_CLASS_CATEGORY_DEMUXER,
484};
485
487 .p.name = "apng",
488 .p.long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"),
489 .p.flags = AVFMT_GENERIC_INDEX,
490 .p.priv_class = &demuxer_class,
491 .priv_data_size = sizeof(APNGDemuxContext),
495};
const FFInputFormat ff_apng_demuxer
Definition apngdec.c:486
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:167
static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx)
Definition apngdec.c:282
static int apng_probe(const AVProbeData *p)
Definition apngdec.c:75
static const AVClass demuxer_class
Definition apngdec.c:478
static int append_extradata(AVCodecParameters *par, AVIOContext *pb, int len)
Definition apngdec.c:144
static void check_fdat_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket *pkt, uint32_t len)
Definition apngdec.c:276
static void check_chunk_sequence(AVFormatContext *s, APNGDemuxContext *ctx, const char *name, uint32_t sequence_number)
Definition apngdec.c:258
static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition apngdec.c:354
#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:580
#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:812
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:2157
#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