1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc: add a wrapper for AVCodecContext.get_buffer().

It will be useful in the upcoming transition to refcounted AVFrames.
This commit is contained in:
Anton Khirnov 2012-11-10 13:22:56 +01:00
parent cb45553f57
commit 594d4d5df3
141 changed files with 286 additions and 154 deletions

View File

@ -29,6 +29,7 @@
#include "bytestream.h"
#include "dsputil.h"
#include "get_bits.h"
#include "internal.h"
//#undef NDEBUG
//#include <assert.h>
@ -833,7 +834,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
avctx->release_buffer(avctx, p);
p->reference = 1;
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
@ -849,7 +850,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
} else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
if (!f->last_picture.data[0]) {
f->last_picture.reference = 1;
if (avctx->get_buffer(avctx, &f->last_picture) < 0) {
if (ff_get_buffer(avctx, &f->last_picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -38,6 +38,7 @@
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.h"
static const enum AVPixelFormat pixfmt_rgb24[] = {
@ -83,7 +84,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
c->pic.reference = 0;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
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;
}

View File

@ -29,6 +29,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/common.h"
/** decoder context */
@ -136,7 +137,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
esc->frame.nb_samples = buf_size * (is_compr + 1);
if ((ret = avctx->get_buffer(avctx, &esc->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &esc->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -181,7 +181,7 @@ static int frame_configure_elements(AVCodecContext *avctx)
/* get output buffer */
ac->frame.nb_samples = 2048;
if ((ret = avctx->get_buffer(avctx, &ac->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -1371,7 +1371,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */
avctx->channels = s->out_channels;
s->frame.nb_samples = s->num_blocks * 256;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -23,6 +23,7 @@
#include "bytestream.h"
#include "adpcm.h"
#include "adpcm_data.h"
#include "internal.h"
/**
* @file
@ -611,7 +612,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
c->frame.nb_samples = nb_samples;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -23,6 +23,7 @@
#include "avcodec.h"
#include "adx.h"
#include "get_bits.h"
#include "internal.h"
/**
* @file
@ -142,7 +143,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
c->frame.nb_samples = num_blocks * BLOCK_SAMPLES;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -49,6 +49,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "internal.h"
#include "unary.h"
#include "mathops.h"
@ -317,7 +318,7 @@ static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
if (!alac->nb_samples) {
/* get output buffer */
alac->frame.nb_samples = output_samples;
if ((ret = avctx->get_buffer(avctx, &alac->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &alac->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -36,6 +36,7 @@
#include "bytestream.h"
#include "bgmc.h"
#include "dsputil.h"
#include "internal.h"
#include "libavutil/samplefmt.h"
#include "libavutil/crc.h"
@ -1461,7 +1462,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
/* get output buffer */
ctx->frame.nb_samples = ctx->cur_frame_length;
if ((ret = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &ctx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -53,6 +53,7 @@
#include "acelp_pitch_delay.h"
#include "lsp.h"
#include "amr.h"
#include "internal.h"
#include "amrnbdata.h"
@ -947,7 +948,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
p->avframe.nb_samples = AMR_BLOCK_SIZE;
if ((ret = avctx->get_buffer(avctx, &p->avframe)) < 0) {
if ((ret = ff_get_buffer(avctx, &p->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -35,6 +35,7 @@
#include "acelp_filters.h"
#include "acelp_vectors.h"
#include "acelp_pitch_delay.h"
#include "internal.h"
#define AMR_USE_16BIT_TABLES
#include "amr.h"
@ -1093,7 +1094,7 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
ctx->avframe.nb_samples = 4 * AMRWB_SFR_SIZE_16k;
if ((ret = avctx->get_buffer(avctx, &ctx->avframe)) < 0) {
if ((ret = ff_get_buffer(avctx, &ctx->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -28,6 +28,7 @@
#include "libavutil/lfg.h"
#include "avcodec.h"
#include "cga_data.h"
#include "internal.h"
#define ATTR_BOLD 0x01 /**< Bold/Bright-foreground (mode 1) */
#define ATTR_FAINT 0x02 /**< Faint (mode 2) */
@ -222,7 +223,7 @@ static int execute_code(AVCodecContext * avctx, int c)
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
avcodec_set_dimensions(avctx, width, height);
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;

View File

@ -26,6 +26,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "bytestream.h"
#include "internal.h"
/**
* @file
@ -909,7 +910,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = blockstodecode;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -30,6 +30,7 @@
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "mathops.h"
#include "mpeg12data.h"
@ -194,7 +195,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, p);
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
if(ff_get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -36,6 +36,7 @@
#include "get_bits.h"
#include "dsputil.h"
#include "fft.h"
#include "internal.h"
#include "sinewin.h"
#include "atrac.h"
@ -286,7 +287,7 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
q->frame.nb_samples = AT1_SU_SAMPLES;
if ((ret = avctx->get_buffer(avctx, &q->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -42,6 +42,7 @@
#include "fft.h"
#include "fmtconvert.h"
#include "get_bits.h"
#include "internal.h"
#include "atrac.h"
#include "atrac3data.h"
@ -811,7 +812,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
q->frame.nb_samples = SAMPLES_PER_FRAME;
if ((ret = avctx->get_buffer(avctx, &q->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -24,6 +24,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/internal.h"
typedef struct AuraDecodeContext {
@ -72,7 +73,7 @@ static int aura_decode_frame(AVCodecContext *avctx,
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
s->frame.reference = 0;
if(avctx->get_buffer(avctx, &s->frame) < 0) {
if(ff_get_buffer(avctx, &s->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -29,6 +29,7 @@
#include "libavutil/common.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
typedef struct BFIContext {
AVCodecContext *avctx;
@ -61,7 +62,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
bfi->frame.reference = 1;
if (avctx->get_buffer(avctx, &bfi->frame) < 0) {
if (ff_get_buffer(avctx, &bfi->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -25,6 +25,7 @@
#include "dsputil.h"
#include "binkdata.h"
#include "binkdsp.h"
#include "internal.h"
#include "mathops.h"
#define BITSTREAM_READER_LE
@ -1171,7 +1172,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
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;
}

View File

@ -36,6 +36,7 @@
#include "dct.h"
#include "rdft.h"
#include "fmtconvert.h"
#include "internal.h"
#include "libavutil/intfloat.h"
extern const uint16_t ff_wma_critical_freqs[25];
@ -321,7 +322,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = s->frame_len;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -22,6 +22,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "bmp.h"
#include "internal.h"
#include "msrledec.h"
static av_cold int bmp_decode_init(AVCodecContext *avctx){
@ -205,7 +206,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, p);
p->reference = 0;
if(avctx->get_buffer(avctx, p) < 0){
if(ff_get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -22,6 +22,7 @@
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
enum BMVFlags{
BMV_NOP = 0,
@ -242,7 +243,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
avctx->release_buffer(avctx, &c->pic);
c->pic.reference = 3;
if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->pic)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@ -335,7 +336,7 @@ static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
c->frame.nb_samples = total_blocks * 32;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -29,6 +29,7 @@
#include "get_bits.h"
#include "golomb.h"
#include "cavs.h"
#include "internal.h"
static const uint8_t mv_scan[4] = {
MV_FWD_X0,MV_FWD_X1,
@ -950,7 +951,7 @@ static int decode_pic(AVSContext *h) {
if(h->picture.f.data[0])
s->avctx->release_buffer(s->avctx, &h->picture.f);
s->avctx->get_buffer(s->avctx, &h->picture.f);
ff_get_buffer(s->avctx, &h->picture.f);
ff_cavs_init_pic(h);
h->picture.poc = get_bits(&s->gb,8)*2;

View File

@ -21,6 +21,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
/**
* @file
@ -333,7 +334,7 @@ static int cdg_decode_frame(AVCodecContext *avctx,
}
cdg_init_frame(&new_frame);
ret = avctx->get_buffer(avctx, &new_frame);
ret = ff_get_buffer(avctx, &new_frame);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;

View File

@ -23,6 +23,7 @@
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#define BIT_PLANAR 0x00
#define BYTE_PLANAR 0x20
@ -262,7 +263,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
avctx->release_buffer(avctx, p);
p->reference = 0;
if ((ret = avctx->get_buffer(avctx, p)) < 0) {
if ((ret = ff_get_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -70,7 +70,7 @@ static int decode_frame(AVCodecContext *avctx,
}
p->reference = 0;
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -24,6 +24,7 @@
#include "dsputil.h"
#include "get_bits.h"
#include "avcodec.h"
#include "internal.h"
typedef struct CLLCContext {
DSPContext dsp;
@ -333,7 +334,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
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);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
return ret;
@ -348,7 +349,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
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);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
return ret;

View File

@ -24,6 +24,7 @@
#include "libavutil/common.h"
#include "avcodec.h"
#include "celp_filters.h"
#include "internal.h"
#include "libavutil/lfg.h"
typedef struct CNGContext {
@ -144,7 +145,7 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
p->excitation, avctx->frame_size, p->order);
p->avframe.nb_samples = avctx->frame_size;
if ((ret = avctx->get_buffer(avctx, &p->avframe)) < 0) {
if ((ret = ff_get_buffer(avctx, &p->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -49,6 +49,7 @@
#include "dsputil.h"
#include "bytestream.h"
#include "fft.h"
#include "internal.h"
#include "sinewin.h"
#include "cookdata.h"
@ -957,7 +958,7 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
if (q->discarded_packets >= 2) {
q->frame.nb_samples = q->samples_per_channel;
if ((ret = avctx->get_buffer(avctx, &q->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -22,6 +22,7 @@
#include <stdlib.h>
#include "avcodec.h"
#include "internal.h"
#include "libavutil/common.h"
#if CONFIG_ZLIB
@ -153,7 +154,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
c->pic.reference = 1;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE |
FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
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;
}

View File

@ -34,6 +34,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "libavutil/internal.h"
@ -105,7 +106,7 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
s->frame.reference = 0;
if (avctx->get_buffer(avctx, &s->frame) < 0) {
if (ff_get_buffer(avctx, &s->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -45,6 +45,7 @@
#include "synth_filter.h"
#include "dcadsp.h"
#include "fmtconvert.h"
#include "internal.h"
#if ARCH_ARM
# include "arm/dca.h"
@ -1835,7 +1836,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = 256 * (s->sample_blocks / 8);
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -22,6 +22,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
@ -321,7 +322,7 @@ static int dfa_decode_frame(AVCodecContext *avctx,
if (s->pic.data[0])
avctx->release_buffer(avctx, &s->pic);
if ((ret = avctx->get_buffer(avctx, &s->pic))) {
if ((ret = ff_get_buffer(avctx, &s->pic))) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -30,6 +30,7 @@
#include "get_bits.h"
#include "dnxhddata.h"
#include "dsputil.h"
#include "internal.h"
typedef struct DNXHDContext {
AVCodecContext *avctx;
@ -357,7 +358,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if (first_field) {
if (ctx->picture.data[0])
avctx->release_buffer(avctx, &ctx->picture);
if (avctx->get_buffer(avctx, &ctx->picture) < 0) {
if (ff_get_buffer(avctx, &ctx->picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -40,6 +40,7 @@
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "mathops.h"
typedef struct DPCMContext {
@ -210,7 +211,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = out / avctx->channels;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -23,6 +23,7 @@
#include "libavutil/imgutils.h"
#include "bytestream.h"
#include "avcodec.h"
#include "internal.h"
typedef struct DPXContext {
AVFrame picture;
@ -159,7 +160,7 @@ static int decode_frame(AVCodecContext *avctx,
return -1;
if (w != avctx->width || h != avctx->height)
avcodec_set_dimensions(avctx, w, h);
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -27,6 +27,7 @@
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "mathops.h"
@ -343,7 +344,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
cin->frame.nb_samples = avpkt->size - cin->initial_decode_frame;
if ((ret = avctx->get_buffer(avctx, &cin->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &cin->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -38,6 +38,7 @@
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "get_bits.h"
#include "put_bits.h"
#include "simple_idct.h"
@ -334,7 +335,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = s->sys->pix_fmt;
avctx->time_base = s->sys->time_base;
avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);
if (avctx->get_buffer(avctx, &s->picture) < 0) {
if (ff_get_buffer(avctx, &s->picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -30,6 +30,7 @@
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.h"
#include <zlib.h>
@ -215,7 +216,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
buf_size -= 768+4;
}
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;
}

View File

@ -21,6 +21,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
@ -52,7 +53,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
pic->reference = 0;
if ((ret = avctx->get_buffer(avctx, pic)) < 0)
if ((ret = ff_get_buffer(avctx, pic)) < 0)
return ret;
pic->pict_type = AV_PICTURE_TYPE_I;

View File

@ -32,6 +32,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
typedef struct CmvContext {
AVCodecContext *avctx;
@ -173,7 +174,7 @@ static int cmv_decode_frame(AVCodecContext *avctx,
s->frame.reference = 1;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
if (avctx->get_buffer(avctx, &s->frame)<0) {
if (ff_get_buffer(avctx, &s->frame)<0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -33,6 +33,7 @@
#include "dsputil.h"
#include "aandcttab.h"
#include "eaidct.h"
#include "internal.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "libavutil/imgutils.h"
@ -257,7 +258,7 @@ static int decode_frame(AVCodecContext *avctx,
s->frame.reference = 1;
if (!s->frame.data[0]) {
if (avctx->get_buffer(avctx, &s->frame) < 0) {
if (ff_get_buffer(avctx, &s->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -35,6 +35,7 @@
#include "dsputil.h"
#include "aandcttab.h"
#include "eaidct.h"
#include "internal.h"
typedef struct TgqContext {
AVCodecContext *avctx;
@ -216,7 +217,7 @@ static int tgq_decode_frame(AVCodecContext *avctx,
s->frame.key_frame = 1;
s->frame.pict_type = AV_PICTURE_TYPE_I;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
if (avctx->get_buffer(avctx, &s->frame)) {
if (ff_get_buffer(avctx, &s->frame)) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -31,6 +31,7 @@
#include "dsputil.h"
#include "aandcttab.h"
#include "eaidct.h"
#include "internal.h"
#include "mpeg12.h"
#include "mpegvideo.h"
@ -116,7 +117,7 @@ static int tqi_decode_frame(AVCodecContext *avctx,
if (s->avctx->width!=s->width || s->avctx->height!=s->height)
avcodec_set_dimensions(s->avctx, s->width, s->height);
if(avctx->get_buffer(avctx, &t->frame) < 0) {
if(ff_get_buffer(avctx, &t->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -20,6 +20,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#define BITSTREAM_READER_LE
#include "get_bits.h"
@ -266,7 +267,7 @@ static int escape124_decode_frame(AVCodecContext *avctx,
}
new_frame.reference = 3;
if (avctx->get_buffer(avctx, &new_frame)) {
if (ff_get_buffer(avctx, &new_frame)) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -31,6 +31,7 @@
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "put_bits.h"
#include "dsputil.h"
@ -830,7 +831,7 @@ static int ffv1_decode_frame(AVCodecContext *avctx, void *data,
}
p->reference = 3; //for error concealment
if ((ret = avctx->get_buffer(avctx, p)) < 0) {
if ((ret = ff_get_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -531,7 +531,7 @@ static int flac_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = s->blocksize;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -22,6 +22,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
static av_cold int decode_init(AVCodecContext *avctx)
{
@ -59,7 +60,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
pic->reference = 0;
if ((ret = avctx->get_buffer(avctx, pic)) < 0) {
if ((ret = ff_get_buffer(avctx, pic)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -39,6 +39,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "g722.h"
#include "internal.h"
#define OFFSET(x) offsetof(G722Context, x)
#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
@ -95,7 +96,7 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
c->frame.nb_samples = avpkt->size * 2;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -34,6 +34,7 @@
#include "acelp_vectors.h"
#include "celp_filters.h"
#include "g723_1_data.h"
#include "internal.h"
#define CNG_RANDOM_SEED 12345
@ -1220,7 +1221,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
}
p->frame.nb_samples = FRAME_LEN;
if ((ret = avctx->get_buffer(avctx, &p->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &p->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -454,7 +454,7 @@ static int g726_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
c->frame.nb_samples = out_samples;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -25,6 +25,7 @@
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "lzw.h"
#define GCE_DISPOSAL_NONE 0
@ -301,7 +302,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, A
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
if (avctx->get_buffer(avctx, &s->picture) < 0) {
if (ff_get_buffer(avctx, &s->picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -27,6 +27,7 @@
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "msgsmdec.h"
#include "gsmdec_template.c"
@ -73,7 +74,7 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = avctx->frame_size;
if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((res = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
}

View File

@ -49,6 +49,7 @@
#include <string.h>
#include "avcodec.h"
#include "internal.h"
#include "libavutil/internal.h"
#define HUFFMAN_TABLE_SIZE 64 * 1024
@ -223,7 +224,7 @@ static int idcin_decode_frame(AVCodecContext *avctx,
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
if (avctx->get_buffer(avctx, &s->frame)) {
if (ff_get_buffer(avctx, &s->frame)) {
av_log(avctx, AV_LOG_ERROR, " id CIN Video: get_buffer() failed\n");
return -1;
}

View File

@ -29,6 +29,7 @@
#include "bytestream.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
typedef struct {
AVFrame frame;
@ -260,7 +261,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return res;
}
} else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
} else if ((res = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
} else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
@ -317,7 +318,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return res;
}
} else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
} else if ((res = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
} else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != AV_PIX_FMT_GRAY8) {

View File

@ -40,6 +40,7 @@
#include "get_bits.h"
#include "dsputil.h"
#include "fft.h"
#include "internal.h"
#include "sinewin.h"
#include "imcdata.h"
@ -939,7 +940,7 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
q->frame.nb_samples = COEFFS;
if ((ret = avctx->get_buffer(avctx, &q->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -35,6 +35,7 @@
#include "dsputil.h"
#include "bytestream.h"
#include "get_bits.h"
#include "internal.h"
#include "indeo3data.h"
@ -1070,7 +1071,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
avctx->release_buffer(avctx, &ctx->frame);
ctx->frame.reference = 0;
if ((res = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
if ((res = ff_get_buffer(avctx, &ctx->frame)) < 0) {
av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
}

View File

@ -141,4 +141,11 @@ static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
avctx->time_base);
}
/**
* Get a buffer for a frame. This is a wrapper around
* AVCodecContext.get_buffer() and should be used instead calling get_buffer()
* directly.
*/
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame);
#endif /* AVCODEC_INTERNAL_H */

View File

@ -43,6 +43,7 @@
#include "dsputil.h"
#define BITSTREAM_READER_LE
#include "get_bits.h"
#include "internal.h"
#define PALETTE_COUNT 256
@ -972,7 +973,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
buf_size - s->decoding_map_size);
s->current_frame.reference = 3;
if (avctx->get_buffer(avctx, &s->current_frame)) {
if (ff_get_buffer(avctx, &s->current_frame)) {
av_log(avctx, AV_LOG_ERROR, " Interplay Video: get_buffer() failed\n");
return -1;
}

View File

@ -30,6 +30,7 @@
#include "libavutil/attributes.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
#include "ivi_common.h"
#include "ivi_dsp.h"
@ -802,7 +803,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
ctx->frame.reference = 0;
avcodec_set_dimensions(avctx, ctx->planes[0].width, ctx->planes[0].height);
if ((result = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
if ((result = ff_get_buffer(avctx, &ctx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return result;
}

View File

@ -28,6 +28,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
typedef struct {
AVCodecContext *avctx;
@ -71,7 +72,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
maxcnt = w * h;
c->cur.reference = 3;
if ((res = avctx->get_buffer(avctx, &c->cur)) < 0)
if ((res = ff_get_buffer(avctx, &c->cur)) < 0)
return res;
out = (uint16_t *) c->cur.data[0];
if (c->prev.data[0]) {

View File

@ -29,6 +29,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#define KMVC_KEYFRAME 0x80
#define KMVC_PALETTE 0x40
@ -257,7 +258,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
ctx->pic.reference = 1;
ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
if (avctx->get_buffer(avctx, &ctx->pic) < 0) {
if (ff_get_buffer(avctx, &ctx->pic) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -44,6 +44,7 @@
#include "libavutil/mem.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "lcl.h"
#if CONFIG_ZLIB_DECODER
@ -180,7 +181,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
c->pic.reference = 0;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
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;
}

View File

@ -200,7 +200,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = avctx->frame_size;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -92,7 +92,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
}
s->frame.nb_samples = s->decoder.blockl;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -149,7 +149,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = 160;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@ -347,7 +347,7 @@ static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = 320;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -25,6 +25,7 @@
#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.h"
#include "vorbis.h"
#include "mathops.h"
#include "libopus.h"
@ -116,7 +117,7 @@ static int libopus_decode(AVCodecContext *avc, void *frame,
int ret, nb_samples;
opus->frame.nb_samples = MAX_FRAME_SIZE;
ret = avc->get_buffer(avc, &opus->frame);
ret = ff_get_buffer(avc, &opus->frame);
if (ret < 0) {
av_log(avc, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;

View File

@ -34,6 +34,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "internal.h"
#include "libschroedinger.h"
#undef NDEBUG
@ -313,7 +314,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext,
if (framewithpts && framewithpts->frame) {
if (p_schro_params->dec_frame.data[0])
avccontext->release_buffer(avccontext, &p_schro_params->dec_frame);
if (avccontext->get_buffer(avccontext, &p_schro_params->dec_frame) < 0) {
if (ff_get_buffer(avccontext, &p_schro_params->dec_frame) < 0) {
av_log(avccontext, AV_LOG_ERROR, "Unable to allocate buffer\n");
return AVERROR(ENOMEM);
}

View File

@ -26,6 +26,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "avcodec.h"
#include "internal.h"
typedef struct {
AVFrame frame;
@ -118,7 +119,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = s->frame_size;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -27,6 +27,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "golomb.h"
#include "internal.h"
#include "mathops.h"
enum LOCO_MODE {LOCO_UNKN=0, LOCO_CYUY2=-1, LOCO_CRGB=-2, LOCO_CRGBA=-3, LOCO_CYV12=-4,
@ -170,7 +171,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, p);
p->reference = 0;
if(avctx->get_buffer(avctx, p) < 0){
if(ff_get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -25,6 +25,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/common.h"
/*
@ -250,7 +251,7 @@ static int mace_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
ctx->frame.nb_samples = 3 * (buf_size << (1 - is_mace3)) / avctx->channels;
if ((ret = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &ctx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -37,6 +37,7 @@
#include "libavutil/opt.h"
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "mjpeg.h"
#include "mjpegdec.h"
#include "jpeglsdec.h"
@ -353,7 +354,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (s->picture_ptr->data[0])
s->avctx->release_buffer(s->avctx, s->picture_ptr);
if (s->avctx->get_buffer(s->avctx, s->picture_ptr) < 0) {
if (ff_get_buffer(s->avctx, s->picture_ptr) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -29,6 +29,7 @@
#include "avcodec.h"
#include "libavutil/intreadwrite.h"
#include "get_bits.h"
#include "internal.h"
#include "libavutil/crc.h"
#include "parser.h"
#include "mlp_parser.h"
@ -920,7 +921,7 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
/* get output buffer */
m->frame.nb_samples = s->blockpos;
if ((ret = avctx->get_buffer(avctx, &m->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &m->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -30,6 +30,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "mpegaudiodsp.h"
#include "mpc.h"
@ -229,7 +230,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */
c->frame.nb_samples = last_frame ? c->lastframelen : MPC_FRAME_SIZE;
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -30,6 +30,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "mpegaudiodsp.h"
#include "mpc.h"
@ -250,7 +251,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */
c->frame.nb_samples = MPC_FRAME_SIZE;
if ((res = avctx->get_buffer(avctx, &c->frame)) < 0) {
if ((res = ff_get_buffer(avctx, &c->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
}

View File

@ -27,6 +27,7 @@
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
#include "mpegaudiodsp.h"
#include "dsputil.h"
@ -1611,7 +1612,7 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples,
/* get output buffer */
if (!samples) {
s->frame.nb_samples = s->avctx->frame_size;
if ((ret = s->avctx->get_buffer(s->avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(s->avctx, &s->frame)) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
@ -1905,7 +1906,7 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame->nb_samples = MPA_FRAME_SIZE;
if ((ret = avctx->get_buffer(avctx, s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -24,6 +24,7 @@
*/
#include "libavutil/avassert.h"
#include "internal.h"
#include "msmpeg4data.h"
#include "vc1.h"
#include "mss12.h"
@ -605,7 +606,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
FF_BUFFER_HINTS_PRESERVE |
FF_BUFFER_HINTS_REUSABLE;
if ((ret = avctx->get_buffer(avctx, &ctx->pic)) < 0) {
if ((ret = ff_get_buffer(avctx, &ctx->pic)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -25,6 +25,7 @@
* MxPEG decoder
*/
#include "internal.h"
#include "mjpeg.h"
#include "mjpegdec.h"
@ -249,7 +250,7 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
/* use stored SOF data to allocate current picture */
if (jpg->picture_ptr->data[0])
avctx->release_buffer(avctx, jpg->picture_ptr);
if (avctx->get_buffer(avctx, jpg->picture_ptr) < 0) {
if (ff_get_buffer(avctx, jpg->picture_ptr) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return AVERROR(ENOMEM);
}
@ -268,7 +269,7 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
/* allocate dummy reference picture if needed */
if (!reference_ptr->data[0] &&
avctx->get_buffer(avctx, reference_ptr) < 0) {
ff_get_buffer(avctx, reference_ptr) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return AVERROR(ENOMEM);
}

View File

@ -38,6 +38,7 @@
#include "dsputil.h"
#include "fft.h"
#include "fmtconvert.h"
#include "internal.h"
#include "nellymoser.h"
#include "sinewin.h"
@ -166,7 +167,7 @@ static int decode_tag(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = NELLY_SAMPLES * blocks;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -27,6 +27,7 @@
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
/*
* Channel Mapping according to
@ -165,7 +166,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = samples;
if ((retval = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((retval = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return retval;
}

View File

@ -302,7 +302,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = n * samples_per_block / avctx->channels;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -26,6 +26,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "internal.h"
typedef struct PCXContext {
AVFrame picture;
@ -147,7 +148,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return -1;
if (w != avctx->width || h != avctx->height)
avcodec_set_dimensions(avctx, w, h);
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -28,6 +28,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "cga_data.h"
#include "internal.h"
typedef struct PicContext {
AVFrame frame;
@ -146,7 +147,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, &s->frame);
}
if (avctx->get_buffer(avctx, &s->frame) < 0){
if (ff_get_buffer(avctx, &s->frame) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -21,6 +21,7 @@
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "png.h"
#include "pngdsp.h"
@ -492,7 +493,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, p);
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
if(ff_get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto fail;
}

View File

@ -21,6 +21,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "put_bits.h"
#include "pnm.h"
@ -48,7 +49,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
avctx->release_buffer(avctx, p);
p->reference = 0;
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -34,6 +34,7 @@
#include "libavutil/intmath.h"
#include "avcodec.h"
#include "internal.h"
#include "proresdata.h"
#include "proresdsp.h"
#include "get_bits.h"
@ -626,7 +627,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
avctx->release_buffer(avctx, picture);
picture->reference = 0;
if (avctx->get_buffer(avctx, picture) < 0)
if (ff_get_buffer(avctx, picture) < 0)
return -1;
for (pic_num = 0; ctx->picture.interlaced_frame - pic_num + 1; pic_num++) {

View File

@ -570,7 +570,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
if (p->state == STATE_GET_BUFFER) {
p->result = p->avctx->get_buffer(p->avctx, p->requested_frame);
p->result = ff_get_buffer(p->avctx, p->requested_frame);
p->state = STATE_SETTING_UP;
pthread_cond_signal(&p->progress_cond);
}
@ -921,7 +921,7 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
if (!(avctx->active_thread_type&FF_THREAD_FRAME)) {
f->thread_opaque = NULL;
return avctx->get_buffer(avctx, f);
return ff_get_buffer(avctx, f);
}
if (p->state != STATE_SETTING_UP &&
@ -943,7 +943,7 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
if (avctx->thread_safe_callbacks ||
avctx->get_buffer == avcodec_default_get_buffer) {
err = avctx->get_buffer(avctx, f);
err = ff_get_buffer(avctx, f);
} else {
p->requested_frame = f;
p->state = STATE_GET_BUFFER;

View File

@ -23,6 +23,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
typedef struct PTXContext {
AVFrame picture;
@ -75,7 +76,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return -1;
if (w != avctx->width || h != avctx->height)
avcodec_set_dimensions(avctx, w, h);
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -699,7 +699,7 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
q->avframe.nb_samples = 160;
if ((ret = avctx->get_buffer(avctx, &q->avframe)) < 0) {
if ((ret = ff_get_buffer(avctx, &q->avframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -40,6 +40,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
#include "internal.h"
#include "rdft.h"
#include "mpegaudiodsp.h"
#include "mpegaudio.h"
@ -1933,7 +1934,7 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
s->frame.nb_samples = 16 * s->frame_size;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -27,6 +27,7 @@
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.h"
typedef struct QdrawContext{
AVCodecContext *avctx;
@ -52,7 +53,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, p);
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
if(ff_get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -21,6 +21,7 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/bswap.h"
#include "libavutil/common.h"
@ -52,7 +53,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
pic->reference = 0;
if (avctx->get_buffer(avctx, pic) < 0)
if (ff_get_buffer(avctx, pic) < 0)
return -1;
pic->pict_type = AV_PICTURE_TYPE_I;

View File

@ -26,6 +26,7 @@
#include "libavutil/intmath.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "ra144.h"
@ -80,7 +81,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */
ractx->frame.nb_samples = NBLOCKS * BLOCKSIZE;
if ((ret = avctx->get_buffer(avctx, &ractx->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &ractx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -22,6 +22,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "internal.h"
#define BITSTREAM_READER_LE
#include "get_bits.h"
#include "ra288.h"
@ -193,7 +194,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */
ractx->frame.nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
if ((ret = avctx->get_buffer(avctx, &ractx->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &ractx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -30,6 +30,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "golomb.h"
#include "internal.h"
#include "unary.h"
#include "ralfdata.h"
@ -463,7 +464,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
}
ctx->frame.nb_samples = ctx->max_frame_size;
if ((ret = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &ctx->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "Me fail get_buffer()? That's unpossible!\n");
return ret;
}

View File

@ -34,6 +34,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "internal.h"
#define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr count, palette
@ -183,7 +184,7 @@ static int rl2_decode_frame(AVCodecContext *avctx,
/** get buffer */
s->frame.reference= 0;
if(avctx->get_buffer(avctx, &s->frame)) {
if(ff_get_buffer(avctx, &s->frame)) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}

View File

@ -1033,8 +1033,8 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (enc->first_frame) {
/* Alloc memory for the reconstruction data (we must know the stride
for that) */
if (avctx->get_buffer(avctx, enc->current_frame) ||
avctx->get_buffer(avctx, enc->last_frame)) {
if (ff_get_buffer(avctx, enc->current_frame) ||
ff_get_buffer(avctx, enc->last_frame)) {
av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
return -1;
}

View File

@ -23,6 +23,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "avcodec.h"
#include "internal.h"
#include "mathops.h"
#define AES3_HEADER_LEN 4
@ -96,7 +97,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
block_size = (avctx->bits_per_coded_sample + 4) / 4;
s->frame.nb_samples = 2 * (buf_size / block_size) / avctx->channels;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

View File

@ -22,6 +22,7 @@
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "sgi.h"
typedef struct SgiState {
@ -209,7 +210,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->release_buffer(avctx, p);
p->reference = 0;
if (avctx->get_buffer(avctx, p) < 0) {
if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
return -1;
}

View File

@ -31,6 +31,7 @@
#include "bytestream.h"
#include "get_bits.h"
#include "golomb.h"
#include "internal.h"
#define MAX_CHANNELS 8
#define MAX_BLOCKSIZE 65535
@ -581,7 +582,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
if (s->cur_chan == s->channels) {
/* get output buffer */
s->frame.nb_samples = s->blocksize;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}

Some files were not shown because too many files have changed in this diff Show More