]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vb.c
mpegvideo: increase edge_emu_buffer size for VC1
[ffmpeg] / libavcodec / vb.c
index e7002a1def5562557d824fc3659c4aacbe5d85d7..1e241e7d5afb997d07e3f7b65daf105fb1645acb 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "internal.h"
 
 enum VBFlags{
     VB_HAS_GMC     = 0x01,
@@ -184,7 +185,8 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
     return 0;
 }
 
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
+static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+                        AVPacket *avpkt)
 {
     VBDecContext * const c = avctx->priv_data;
     uint8_t *outptr, *srcptr;
@@ -198,7 +200,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     if(c->pic.data[0])
         avctx->release_buffer(avctx, &c->pic);
     c->pic.reference = 1;
-    if(avctx->get_buffer(avctx, &c->pic) < 0){
+    if(ff_get_buffer(avctx, &c->pic) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return -1;
     }
@@ -234,7 +236,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
 
     FFSWAP(uint8_t*, c->frame, c->prev_frame);
 
-    *data_size = sizeof(AVFrame);
+    *got_frame = 1;
     *(AVFrame*)data = c->pic;
 
     /* always report that the buffer was completely consumed */
@@ -246,7 +248,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     VBDecContext * const c = avctx->priv_data;
 
     c->avctx = avctx;
-    avctx->pix_fmt = PIX_FMT_PAL8;
+    avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
     c->frame      = av_mallocz(avctx->width * avctx->height);
     c->prev_frame = av_mallocz(avctx->width * avctx->height);
@@ -269,10 +271,11 @@ static av_cold int decode_end(AVCodecContext *avctx)
 AVCodec ff_vb_decoder = {
     .name           = "vb",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_VB,
+    .id             = AV_CODEC_ID_VB,
     .priv_data_size = sizeof(VBDecContext),
     .init           = decode_init,
     .close          = decode_end,
     .decode         = decode_frame,
-    .long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
+    .long_name      = NULL_IF_CONFIG_SMALL("Beam Software VB"),
+    .capabilities   = CODEC_CAP_DR1,
 };