28 #include "libavutil/intreadwrite.h"
29 #include "libavutil/opt.h"
61 #define GIF_DEFAULT_DELAY 10
65 #define GIF_MIN_DELAY 2
83 for (i = 0; i < 6; i++) {
100 if ((ret =
resync(pb)) < 0)
107 if (width == 0 || height == 0)
131 int sb_size,
ret = 0;
133 while (0x00 != (sb_size =
avio_r8(pb))) {
145 int sb_size, ext_label =
avio_r8(pb);
149 if ((sb_size =
avio_r8(pb)) < 4) {
164 if ((ret =
avio_skip(pb, sb_size - 3)) < 0 )
171 if (ret < 0 || !sb_size)
177 if (ret < 0 || !sb_size)
180 if (sb_size == 3 && data[0] == 1) {
199 int packed_fields, block_label, ct_size,
200 keyframe, frame_parsed = 0,
ret;
201 int64_t frame_start =
avio_tell(pb), frame_end;
202 unsigned char buf[6];
207 }
else if (
ret < 0) {
226 if (packed_fields & 0x80) {
227 ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
249 if (packed_fields & 0x80) {
250 ct_size = 3 * (1 << ((packed_fields & 0x07) + 1));
267 if (
avio_seek(pb, frame_start, SEEK_SET) != frame_start)
333 .priv_class = &demuxer_class,
#define LIBAVUTIL_VERSION_INT
AVCodecContext * codec
Codec context associated with this stream.
static const uint8_t gif87a_sig[6]
#define GIF_GCE_EXT_LABEL
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
const char * av_default_item_name(void *ctx)
Return the context 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...
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
const OptionDef options[]
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int flags
A combination of AV_PKT_FLAG values.
#define GIF_IMAGE_SEPARATOR
int min_delay
Minimum allowed delay between frames in hundredths of second.
int width
picture width / height.
#define GIF_APP_EXT_LABEL
#define GIF_EXTENSION_INTRODUCER
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
int total_iter
loop options
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
BYTE int const BYTE int int int height
Describe the class of an AVClass context structure.
int delay
Time span in hundredths of second before the next frame should be drawn on screen.
This structure contains the data a format has to probe a file.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
static const uint8_t gif89a_sig[6]
#define AVERROR_INVALIDDATA
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
This structure stores compressed data.