66 #define GIF_DEFAULT_DELAY 10
70 #define GIF_MIN_DELAY 2
88 for (
i = 0;
i < 6;
i++) {
100 int sb_size, ret = 0;
102 while (0x00 != (sb_size =
avio_r8(pb))) {
116 int64_t nb_frames = 0,
duration = 0;
118 if ((ret =
resync(pb)) < 0)
148 while ((block_size =
avio_r8(pb)) != 0) {
156 if (block_size == 4) {
161 if (delay < gdc->min_delay)
212 int sb_size, ext_label =
avio_r8(pb);
216 if ((sb_size =
avio_r8(pb)) < 4) {
232 if ((ret =
avio_skip(pb, sb_size - 3)) < 0 )
239 if (ret < 0 || !sb_size)
245 if (ret < 0 || !sb_size)
248 if (sb_size == 3 &&
data[0] == 1) {
267 int packed_fields, block_label, ct_size,
268 keyframe, frame_parsed = 0, ret;
270 unsigned char buf[6];
272 if ((ret =
avio_read(pb, buf, 6)) == 6) {
275 }
else if (ret < 0) {
294 if (packed_fields & 0x80) {
295 ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
317 if (packed_fields & 0x80) {
318 ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
362 if ((ret =
resync(pb)) < 0)
370 if ((ret >= 0 && !frame_parsed) || ret ==
AVERROR_EOF) {
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size)
Read contents of h into print buffer, up to max_size bytes, or up to EOF.
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define AV_BPRINT_SIZE_UNLIMITED
#define flags(name, subs,...)
static int read_header(FFV1Context *f)
#define GIF_IMAGE_SEPARATOR
static const uint8_t gif89a_sig[6]
#define GIF_APP_EXT_LABEL
#define GIF_EXTENSION_INTRODUCER
static const uint8_t gif87a_sig[6]
#define GIF_GCE_EXT_LABEL
#define GIF_COM_EXT_LABEL
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_CLASS_CATEGORY_DEMUXER
static void frame_end(MpegEncContext *s)
static int frame_start(MpegEncContext *s)
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
enum AVMediaType codec_type
General type of the encoded data.
AVRational sample_aspect_ratio
Video only.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
int min_delay
Minimum allowed delay between frames in hundredths of second.
int total_iter
loop options
int delay
Time span in hundredths of second before the next frame should be drawn on screen.