*/
/**
- * @file libavcodec/vqavideo.c
+ * @file
* VQA Video Decoder by Mike Melanson (melanson@pcisys.net)
* For more information about the VQA format, visit:
* http://wiki.multimedia.cx/index.php?title=VQA
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "libavutil/intreadwrite.h"
+#include "libavutil/imgutils.h"
#include "avcodec.h"
#define PALETTE_COUNT 256
s->vqa_version = vqa_header[0];
s->width = AV_RL16(&vqa_header[6]);
s->height = AV_RL16(&vqa_header[8]);
- if(avcodec_check_dimensions(avctx, s->width, s->height)){
+ if(av_image_check_size(s->width, s->height, 0, avctx)){
s->width= s->height= 0;
return -1;
}
switch (s->vqa_version) {
case 1:
-/* still need sample media for this case (only one game, "Legend of
- * Kyrandia III : Malcolm's Revenge", is known to use this version) */
lobyte = s->decode_buffer[lobytes * 2];
hibyte = s->decode_buffer[(lobytes * 2) + 1];
vector_index = ((hibyte << 8) | lobyte) >> 3;
static int vqa_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VqaContext *s = avctx->priv_data;
s->buf = buf;
return 0;
}
-AVCodec vqa_decoder = {
+AVCodec ff_vqa_decoder = {
"vqavideo",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_WS_VQA,
sizeof(VqaContext),
vqa_decode_init,