]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/yop.c
lavc: add a wrapper for AVCodecContext.get_buffer().
[ffmpeg] / libavcodec / yop.c
index 57d100c26d715accf7137db5ccd0a6a4dafd4a4f..0240a8cc9fcdd74fcc1efe244b63a987471505c0 100644 (file)
@@ -1,33 +1,33 @@
-/**
- * @file
+/*
  * Psygnosis YOP decoder
  *
  * Copyright (C) 2010 Mohamed Naufal Basheer <naufal11@gmail.com>
  * derived from the code by
  * Copyright (C) 2009 Thomas P. Higdon <thomas.p.higdon@gmail.com>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "libavutil/intreadwrite.h"
-#include "libavcore/imgutils.h"
+#include "libavutil/imgutils.h"
 
 #include "avcodec.h"
 #include "get_bits.h"
+#include "internal.h"
 
 typedef struct YopDecContext {
     AVFrame frame;
@@ -90,7 +90,7 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
         return -1;
     }
 
-    avctx->pix_fmt = PIX_FMT_PAL8;
+    avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
     s->num_pal_colors = avctx->extradata[0];
     s->first_color[0] = avctx->extradata[1];
@@ -199,7 +199,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     if (s->frame.data[0])
         avctx->release_buffer(avctx, &s->frame);
 
-    ret = avctx->get_buffer(avctx, &s->frame);
+    ret = ff_get_buffer(avctx, &s->frame);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
@@ -248,14 +248,14 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     return avpkt->size;
 }
 
-AVCodec yop_decoder = {
-    "yop",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_YOP,
-    sizeof(YopDecContext),
-    yop_decode_init,
-    NULL,
-    yop_decode_close,
-    yop_decode_frame,
-    .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"),
+AVCodec ff_yop_decoder = {
+    .name           = "yop",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = AV_CODEC_ID_YOP,
+    .priv_data_size = sizeof(YopDecContext),
+    .init           = yop_decode_init,
+    .close          = yop_decode_close,
+    .decode         = yop_decode_frame,
+    .long_name      = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"),
+    .capabilities   = CODEC_CAP_DR1,
 };