#include "dsputil.h"
#include "get_bits.h"
#include "avcodec.h"
+#include "internal.h"
typedef struct CLLCContext {
DSPContext dsp;
int *got_picture_ptr, AVPacket *avpkt)
{
CLLCContext *ctx = avctx->priv_data;
- AVFrame *pic = avctx->coded_frame;
+ AVFrame *pic = data;
uint8_t *src = avpkt->data;
uint32_t info_tag, info_offset;
int data_size;
GetBitContext gb;
int coding_type, ret;
- if (pic->data[0])
- avctx->release_buffer(avctx, pic);
-
- pic->reference = 0;
-
/* Skip the INFO header if present */
info_offset = 0;
info_tag = AV_RL32(src);
avctx->pix_fmt = AV_PIX_FMT_RGB24;
avctx->bits_per_raw_sample = 8;
- ret = avctx->get_buffer(avctx, pic);
+ ret = ff_get_buffer(avctx, pic, 0);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
return ret;
avctx->pix_fmt = AV_PIX_FMT_ARGB;
avctx->bits_per_raw_sample = 8;
- ret = avctx->get_buffer(avctx, pic);
+ ret = ff_get_buffer(avctx, pic, 0);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
return ret;
pic->pict_type = AV_PICTURE_TYPE_I;
*got_picture_ptr = 1;
- *(AVFrame *)data = *pic;
return avpkt->size;
}
{
CLLCContext *ctx = avctx->priv_data;
- if (avctx->coded_frame->data[0])
- avctx->release_buffer(avctx, avctx->coded_frame);
-
- av_freep(&avctx->coded_frame);
av_freep(&ctx->swapped_buf);
return 0;
ff_dsputil_init(&ctx->dsp, avctx);
- avctx->coded_frame = avcodec_alloc_frame();
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
return 0;
}