]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/gifdec.c
ac3enc: use dsputil functions in apply_window()
[ffmpeg] / libavcodec / gifdec.c
index ee805a8d5ae3a7ad6fff7226ca6a01ae2bd02e60..4cc80017e894958c9978995c76011782a0b49cc5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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.
  *
@@ -22,6 +22,7 @@
 
 //#define DEBUG
 
+#include "libavcore/imgutils.h"
 #include "avcodec.h"
 #include "bytestream.h"
 #include "lzw.h"
@@ -282,8 +283,10 @@ static av_cold int gif_decode_init(AVCodecContext *avctx)
     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;
@@ -294,7 +297,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, c
         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);
 
@@ -326,12 +329,13 @@ static av_cold int gif_decode_close(AVCodecContext *avctx)
 
 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,
+    CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
 };