/*
* GIF decoder
- * Copyright (c) 2003 Fabrice Bellard.
- * Copyright (c) 2006 Baptiste Coudurier.
+ * Copyright (c) 2003 Fabrice Bellard
+ * Copyright (c) 2006 Baptiste Coudurier
*
* This file is part of FFmpeg.
*
//#define DEBUG
+#include "libavcore/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "lzw.h"
return 0;
}
-static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
GifState *s = avctx->priv_data;
AVFrame *picture = data;
int ret;
return -1;
avctx->pix_fmt = PIX_FMT_PAL8;
- if (avcodec_check_dimensions(avctx, s->screen_width, s->screen_height))
+ if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx))
return -1;
avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);
AVCodec gif_decoder = {
"gif",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_GIF,
sizeof(GifState),
gif_decode_init,
NULL,
gif_decode_close,
gif_decode_frame,
- .long_name = "GIF (Graphics Interchange Format)",
+ CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
};