diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-05 15:18:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-05 15:18:12 +0100 |
commit | 874c5b02c4117d5261365d0de727c0b4dc9363f6 (patch) | |
tree | 6cab3de646de322069cc3b3ebda8a4425ea07040 /libavcodec | |
parent | 4727611d489387aed926469ac757b2f1dfea3e33 (diff) | |
parent | 594d4d5df3c70404168701dd5c90b7e6e5587793 (diff) | |
download | ffmpeg-874c5b02c4117d5261365d0de727c0b4dc9363f6.tar.gz |
Merge commit '594d4d5df3c70404168701dd5c90b7e6e5587793'
* commit '594d4d5df3c70404168701dd5c90b7e6e5587793':
lavc: add a wrapper for AVCodecContext.get_buffer().
Conflicts:
libavcodec/4xm.c
libavcodec/8svx.c
libavcodec/bmv.c
libavcodec/cljr.c
libavcodec/cscd.c
libavcodec/dnxhddec.c
libavcodec/dpcm.c
libavcodec/dpx.c
libavcodec/eacmv.c
libavcodec/eamad.c
libavcodec/frwu.c
libavcodec/g723_1.c
libavcodec/gifdec.c
libavcodec/idcinvideo.c
libavcodec/iff.c
libavcodec/indeo3.c
libavcodec/internal.h
libavcodec/interplayvideo.c
libavcodec/kmvc.c
libavcodec/mpc7.c
libavcodec/mpegaudiodec.c
libavcodec/pcx.c
libavcodec/pngdec.c
libavcodec/pnmdec.c
libavcodec/rl2.c
libavcodec/snow.c
libavcodec/targa.c
libavcodec/tscc.c
libavcodec/txd.c
libavcodec/utils.c
libavcodec/v210dec.c
libavcodec/vb.c
libavcodec/vmdav.c
libavcodec/vp56.c
libavcodec/vqavideo.c
libavcodec/wavpack.c
libavcodec/wnv1.c
libavcodec/xl.c
libavcodec/yop.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
168 files changed, 335 insertions, 178 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 85795f96ee..3ee41f3907 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -29,6 +29,7 @@ #include "bytestream.h" #include "dsputil.h" #include "get_bits.h" +#include "internal.h" #include "libavutil/avassert.h" @@ -896,7 +897,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 = 3; - 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; } diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index f895ed39a8..d450569bc6 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -38,6 +38,7 @@ #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "internal.h" static const enum AVPixelFormat pixfmt_rgb24[] = { @@ -82,7 +83,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; } diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 618ae872cc..4bbbeb139f 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -39,6 +39,7 @@ #include "libavutil/avassert.h" #include "avcodec.h" +#include "internal.h" #include "libavutil/common.h" /** decoder context */ @@ -135,7 +136,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ esc->frame.nb_samples = buf_size * 2; - 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; } diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 719426c8e4..d191e4132f 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -185,7 +185,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; } diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 7fb380ca87..66f8a4d5d9 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1379,7 +1379,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; } diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index fd308a9ab9..bf26186d33 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -23,6 +23,7 @@ #include "bytestream.h" #include "adpcm.h" #include "adpcm_data.h" +#include "internal.h" /** * @file @@ -639,7 +640,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; } diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 901d717cdf..0130628af7 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "adx.h" #include "get_bits.h" +#include "internal.h" /** * @file @@ -143,7 +144,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; } diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 49ccaac67f..23beb5d363 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -49,6 +49,7 @@ #include "avcodec.h" #include "get_bits.h" #include "bytestream.h" +#include "internal.h" #include "unary.h" #include "mathops.h" @@ -323,7 +324,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; } diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 69e66d6f7f..3428f2c89b 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -36,6 +36,7 @@ #include "bytestream.h" #include "bgmc.h" #include "dsputil.h" +#include "internal.h" #include "libavutil/samplefmt.h" #include "libavutil/crc.h" @@ -1462,7 +1463,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; } diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index 0057959361..40bc2530e6 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -55,6 +55,7 @@ #include "acelp_pitch_delay.h" #include "lsp.h" #include "amr.h" +#include "internal.h" #include "amrnbdata.h" @@ -965,7 +966,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; } diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index 468ffa0716..fa910466d4 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -36,6 +36,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" @@ -1113,7 +1114,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; } diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index d84b395301..961c57b5f2 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -29,6 +29,7 @@ #include "libavutil/xga_font_data.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) */ @@ -242,7 +243,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; diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index a85d355254..214679634c 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "dsputil.h" #include "bytestream.h" +#include "internal.h" /** * @file @@ -906,7 +907,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; } diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index b9686a2aeb..127d37a670 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "put_bits.h" #include "dsputil.h" +#include "internal.h" #include "mathops.h" #include "mpeg12data.h" @@ -191,7 +192,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; } diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index 1ba5593f02..e5b5b10771 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -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; } diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 052bef0e1c..56efa19466 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -43,6 +43,7 @@ #include "fft.h" #include "fmtconvert.h" #include "get_bits.h" +#include "internal.h" #include "atrac.h" #include "atrac3data.h" @@ -812,7 +813,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; } diff --git a/libavcodec/aura.c b/libavcodec/aura.c index 669ef480e0..39d5235190 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -24,6 +24,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "libavutil/internal.h" typedef struct AuraDecodeContext { @@ -73,7 +74,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; } diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index 2205a422e2..187dad5398 100644 --- a/libavcodec/avrndec.c +++ b/libavcodec/avrndec.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "mjpeg.h" #include "mjpegdec.h" #include "libavutil/imgutils.h" @@ -99,7 +100,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac return AVERROR_INVALIDDATA; } - 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; } diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index 52d8090109..7aa30ff8ff 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "libavutil/intreadwrite.h" static av_cold int avui_decode_init(AVCodecContext *avctx) @@ -79,7 +80,7 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index f7df68e527..33f9e41952 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -29,6 +29,7 @@ #include "libavutil/common.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" typedef struct BFIContext { AVCodecContext *avctx; @@ -63,7 +64,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, bfi->frame.reference = 3; - 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; } diff --git a/libavcodec/bink.c b/libavcodec/bink.c index bb202ca60a..6250e267ca 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -25,6 +25,7 @@ #include "dsputil.h" #include "binkdata.h" #include "binkdsp.h" +#include "internal.h" #include "mathops.h" #define BITSTREAM_READER_LE @@ -1180,7 +1181,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; } diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index a1a91ebfb0..6fe14df52f 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -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; } diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 9aee3756f1..3dec91d7cd 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -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){ @@ -208,7 +209,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; } diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c index fa44c6ceff..da9b8aaba6 100644 --- a/libavcodec/bmv.c +++ b/libavcodec/bmv.c @@ -19,10 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "avcodec.h" #include "bytestream.h" -#include "libavutil/avassert.h" +#include "internal.h" enum BMVFlags{ BMV_NOP = 0, @@ -244,7 +245,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; } @@ -342,7 +343,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; } diff --git a/libavcodec/brender_pix.c b/libavcodec/brender_pix.c index 886e8fbfe6..92bc8b4e1b 100644 --- a/libavcodec/brender_pix.c +++ b/libavcodec/brender_pix.c @@ -28,6 +28,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" typedef struct BRPixContext { AVFrame frame; @@ -151,7 +152,7 @@ static int brpix_decode_frame(AVCodecContext *avctx, if (hdr.width != avctx->width || hdr.height != avctx->height) avcodec_set_dimensions(avctx, hdr.width, hdr.height); - 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; } diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 02d0d81460..a8a4d6b649 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -30,6 +30,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, @@ -962,7 +963,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; diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index eb315321ce..d5ea6e765d 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" /** * @file @@ -337,7 +338,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; diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index 1708266393..3a41805d99 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #define BIT_PLANAR 0x00 #define CHUNKY 0x20 @@ -264,7 +265,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; } diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 87c8fc24fb..e240026536 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -74,7 +74,7 @@ static int decode_frame(AVCodecContext *avctx, } 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; } diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index b58833134d..d14de6080c 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -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; diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c index 9b6dfef08e..d2b1257af9 100644 --- a/libavcodec/cngdec.c +++ b/libavcodec/cngdec.c @@ -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; } diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 63f6be29b8..4117cee1f9 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -49,6 +49,7 @@ #include "dsputil.h" #include "bytestream.h" #include "fft.h" +#include "internal.h" #include "sinewin.h" #include "cookdata.h" @@ -969,7 +970,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; } diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index bf846d31dd..d18243c128 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -85,6 +85,7 @@ #include "avcodec.h" #include "h264.h" +#include "internal.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" @@ -642,7 +643,7 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, priv->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; if (!priv->pic.data[0]) { - if (avctx->get_buffer(avctx, &priv->pic) < 0) { + if (ff_get_buffer(avctx, &priv->pic) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return RET_ERROR; } diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 8ba5de3326..12dc1e3a09 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -22,6 +22,7 @@ #include <stdlib.h> #include "avcodec.h" +#include "internal.h" #include "libavutil/common.h" #if CONFIG_ZLIB diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index 74c10777c1..5d49e45f39 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -34,6 +34,7 @@ #include "avcodec.h" #include "dsputil.h" +#include "internal.h" #include "libavutil/internal.h" @@ -110,7 +111,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; } diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index acbabd64cc..59c1e6e3ea 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -45,6 +45,7 @@ #include "synth_filter.h" #include "dcadsp.h" #include "fmtconvert.h" +#include "internal.h" #if ARCH_ARM # include "arm/dca.h" @@ -2352,7 +2353,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; } diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 548a649fa1..133d7639fb 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -23,6 +23,7 @@ #include "libavutil/avassert.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "libavutil/imgutils.h" #include "libavutil/mem.h" @@ -327,7 +328,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; } diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 6e814913d5..571989aa64 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -30,6 +30,7 @@ #include "dsputil.h" #include "get_bits.h" #include "bytestream.h" +#include "internal.h" #include "golomb.h" #include "dirac_arith.h" #include "mpeg12data.h" @@ -1668,7 +1669,7 @@ static int dirac_decode_picture_header(DiracContext *s) for (j = 0; j < MAX_FRAMES; j++) if (!s->all_frames[j].avframe.data[0]) { s->ref_pics[i] = &s->all_frames[j]; - s->avctx->get_buffer(s->avctx, &s->ref_pics[i]->avframe); + ff_get_buffer(s->avctx, &s->ref_pics[i]->avframe); break; } } @@ -1806,7 +1807,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int pic->avframe.key_frame = s->num_refs == 0; /* [DIRAC_STD] is_intra() */ pic->avframe.pict_type = s->num_refs + 1; /* Definition of AVPictureType in avutil.h */ - if (avctx->get_buffer(avctx, &pic->avframe) < 0) { + if (ff_get_buffer(avctx, &pic->avframe) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 4f3968aaa7..50aa303a17 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -30,6 +30,7 @@ #include "get_bits.h" #include "dnxhddata.h" #include "dsputil.h" +#include "internal.h" #include "thread.h" typedef struct DNXHDContext { diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index c9c45c61b8..5fa9778ff6 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -40,6 +40,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "mathops.h" typedef struct DPCMContext { @@ -213,7 +214,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = (out + avctx->channels - 1) / 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; } diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 4d09efe543..c2b307670c 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -23,6 +23,7 @@ #include "libavutil/imgutils.h" #include "bytestream.h" #include "avcodec.h" +#include "internal.h" typedef struct DPXContext { AVFrame picture; @@ -187,7 +188,7 @@ static int decode_frame(AVCodecContext *avctx, if (s->picture.data[0]) avctx->release_buffer(avctx, &s->picture); - 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; } diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index 0290f5ab11..dd475896eb 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -27,6 +27,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "mathops.h" @@ -365,7 +366,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; } diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index d3a12347b3..ac820bd51f 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -39,6 +39,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" @@ -336,7 +337,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; } diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index cf8ce0c46f..d57398b8fb 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -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; } diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index da43c47003..4ee364bab1 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -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; diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index d3de7cac29..c537e95be0 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -32,6 +32,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "avcodec.h" +#include "internal.h" typedef struct CmvContext { AVCodecContext *avctx; @@ -183,7 +184,7 @@ static int cmv_decode_frame(AVCodecContext *avctx, s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE | FF_BUFFER_HINTS_PRESERVE; - 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; } diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 0dad58b54a..25316172a1 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -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" @@ -269,7 +270,7 @@ static int decode_frame(AVCodecContext *avctx, s->frame.reference = 3; if (!s->frame.data[0]) { - 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; } diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index f8d90101b7..fa2ec0f903 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -35,6 +35,7 @@ #include "dsputil.h" #include "aandcttab.h" #include "eaidct.h" +#include "internal.h" typedef struct TgqContext { AVCodecContext *avctx; @@ -222,7 +223,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; } diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 62833d549e..fcf652b70a 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -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; } diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index 94eadce521..9198a3414b 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "internal.h" #define BITSTREAM_READER_LE #include "get_bits.h" @@ -268,7 +269,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; } diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index 97547bb102..b56bb4463d 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -23,6 +23,8 @@ #define BITSTREAM_READER_LE #include "get_bits.h" +#include "internal.h" + typedef struct Escape130Context { AVFrame frame; @@ -129,7 +131,7 @@ static int escape130_decode_frame(AVCodecContext *avctx, skip_bits_long(&gb, 128); 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; } diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index da44b94ba3..7c9bb9cf95 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -764,7 +764,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } 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; } diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c index c63b90ff29..eb3b4551c0 100644 --- a/libavcodec/ffwavesynth.c +++ b/libavcodec/ffwavesynth.c @@ -22,6 +22,8 @@ #include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "avcodec.h" +#include "internal.h" + #define SIN_BITS 14 #define WS_MAX_CHANNELS 32 @@ -442,7 +444,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame, if (duration <= 0) return AVERROR(EINVAL); ws->frame.nb_samples = duration; - r = avc->get_buffer(avc, &ws->frame); + r = ff_get_buffer(avc, &ws->frame); if (r < 0) return r; pcm = (int16_t *)ws->frame.data[0]; diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 317d7fa838..d555ddfc2e 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -529,7 +529,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; } diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index ab095dc98e..0ac018b35e 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -226,7 +226,7 @@ int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVF if(!new) return AVERROR(ENOMEM); pthread_mutex_lock(&c->buffer_mutex); - ret = c->parent_avctx->get_buffer(c->parent_avctx, new); + ret = ff_get_buffer(c->parent_avctx, new); pthread_mutex_unlock(&c->buffer_mutex); if(ret<0) return ret; diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index a0484d3cbf..78c6dbd948 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -22,6 +22,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "libavutil/opt.h" typedef struct { @@ -66,7 +67,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; } diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c index f28c86b3f9..965c790744 100644 --- a/libavcodec/g722dec.c +++ b/libavcodec/g722dec.c @@ -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; } diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c index fd6b558ef3..c2e86d96d3 100644 --- a/libavcodec/g723_1.c +++ b/libavcodec/g723_1.c @@ -36,6 +36,7 @@ #include "celp_filters.h" #include "celp_math.h" #include "g723_1_data.h" +#include "internal.h" #define CNG_RANDOM_SEED 12345 @@ -1187,7 +1188,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; } diff --git a/libavcodec/g726.c b/libavcodec/g726.c index e505d5dfb9..ba4f01ba93 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -452,7 +452,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; } diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index 036614d606..b44120fd85 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -26,6 +26,8 @@ #include "libavutil/avutil.h" #include "get_bits.h" #include "dsputil.h" +#include "internal.h" + #include "g729.h" #include "lsp.h" @@ -418,7 +420,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, int is_periodic = 0; // whether one of the subframes is declared as periodic or not ctx->frame.nb_samples = SUBFRAME_SIZE<<1; - 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; } diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 3e3c9a5394..acd9b29146 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -27,6 +27,7 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "lzw.h" #include "gif.h" @@ -487,7 +488,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_picture, if (s->picture.data[0]) avctx->release_buffer(avctx, &s->picture); - if ((ret = avctx->get_buffer(avctx, &s->picture)) < 0) { + if ((ret = ff_get_buffer(avctx, &s->picture)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c index f6f99bdd8e..71127c71a1 100644 --- a/libavcodec/gsmdec.c +++ b/libavcodec/gsmdec.c @@ -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" @@ -74,7 +75,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; } diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index a517d9da5e..6e7bcb2484 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -49,6 +49,7 @@ #include <string.h> #include "avcodec.h" +#include "internal.h" #include "libavutil/internal.h" #define HUFFMAN_TABLE_SIZE 64 * 1024 @@ -227,7 +228,7 @@ static int idcin_decode_frame(AVCodecContext *avctx, if (s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); - if ((ret = avctx->get_buffer(avctx, &s->frame))) { + if ((ret = ff_get_buffer(avctx, &s->frame))) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 278119550c..1f07492c22 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -29,6 +29,7 @@ #include "bytestream.h" #include "avcodec.h" #include "get_bits.h" +#include "internal.h" // TODO: masking bits typedef enum { @@ -606,7 +607,7 @@ static int decode_frame(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_PAL8) { diff --git a/libavcodec/imc.c b/libavcodec/imc.c index feca07c603..1295c8ec6c 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -41,6 +41,7 @@ #include "get_bits.h" #include "dsputil.h" #include "fft.h" +#include "internal.h" #include "sinewin.h" #include "imcdata.h" @@ -947,7 +948,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; } diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 013d6107cf..c15463ddbb 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -35,6 +35,7 @@ #include "dsputil.h" #include "bytestream.h" #include "get_bits.h" +#include "internal.h" #include "indeo3data.h" @@ -1088,7 +1089,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; } diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 17ca8bb8c2..30a8e4c40d 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -169,6 +169,13 @@ 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); + int ff_thread_can_start_frame(AVCodecContext *avctx); int ff_get_logical_cpus(AVCodecContext *avctx); diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 6892936c3d..82bcf85065 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -43,6 +43,7 @@ #include "dsputil.h" #define BITSTREAM_READER_LE #include "get_bits.h" +#include "internal.h" #define PALETTE_COUNT 256 @@ -976,7 +977,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, "get_buffer() failed\n"); return -1; } diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index c20ce77b3b..c2815da82e 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -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" @@ -844,7 +845,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; } diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c index de94f51197..a9b4ccf3d6 100644 --- a/libavcodec/j2kdec.c +++ b/libavcodec/j2kdec.c @@ -29,6 +29,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "j2k.h" #include "libavutil/common.h" @@ -283,7 +284,7 @@ static int get_siz(J2kDecoderContext *s) if (s->picture.data[0]) s->avctx->release_buffer(s->avctx, &s->picture); - if ((ret = s->avctx->get_buffer(s->avctx, &s->picture)) < 0) + if ((ret = ff_get_buffer(s->avctx, &s->picture)) < 0) return ret; s->picture.pict_type = AV_PICTURE_TYPE_I; diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 6c1daa90b7..66829bfae6 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -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]) { diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 2046d28f2e..ebaaa84d94 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -29,6 +29,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #define KMVC_KEYFRAME 0x80 #define KMVC_PALETTE 0x40 @@ -274,7 +275,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa ctx->pic.reference = 3; ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID; - 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; } diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 66db7c7f1c..24274a7930 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -44,6 +44,7 @@ #include "libavutil/mem.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "lcl.h" #if CONFIG_ZLIB_DECODER @@ -186,7 +187,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; } diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c index 18b7a5e92c..03330324ec 100644 --- a/libavcodec/libcelt_dec.c +++ b/libavcodec/libcelt_dec.c @@ -112,7 +112,7 @@ static int libcelt_dec_decode(AVCodecContext *c, void *frame, int16_t *pcm; celt->frame.nb_samples = c->frame_size; - err = c->get_buffer(c, &celt->frame); + err = ff_get_buffer(c, &celt->frame); if (err < 0) { av_log(c, AV_LOG_ERROR, "get_buffer() failed\n"); return err; diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 8915ef57ba..f3cfb91f17 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -205,7 +205,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; } diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index bcc01eddda..f9e286c7ed 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -95,7 +95,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; } diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index f0207aed8d..550ef94491 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -150,7 +150,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; } @@ -346,7 +346,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; } diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c index f3cad25f76..f603bdf186 100644 --- a/libavcodec/libopusdec.c +++ b/libavcodec/libopusdec.c @@ -133,7 +133,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; diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index 4e523dcdf6..c98b4991ae 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -34,6 +34,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" #include "avcodec.h" +#include "internal.h" #include "libschroedinger.h" #include <schroedinger/schro.h> @@ -309,7 +310,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); } diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 935bebb1ce..7ed2636538 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -26,6 +26,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "avcodec.h" +#include "internal.h" typedef struct { AVFrame frame; @@ -120,7 +121,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; } diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp index f741df94f8..f65b489bf5 100644 --- a/libavcodec/libstagefright.cpp +++ b/libavcodec/libstagefright.cpp @@ -185,7 +185,7 @@ void* decode_thread(void *arg) buffer->release(); goto push_frame; } - ret = avctx->get_buffer(avctx, frame->vframe); + ret = ff_get_buffer(avctx, frame->vframe); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); frame->status = ret; diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c index 93c65b88b7..8f5f9d85f9 100644 --- a/libavcodec/libvorbisdec.c +++ b/libavcodec/libvorbisdec.c @@ -22,6 +22,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" typedef struct OggVorbisDecContext { AVFrame frame; @@ -141,7 +142,7 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data, } context->frame.nb_samples = 8192*4; - if ((ret = avccontext->get_buffer(avccontext, &context->frame)) < 0) { + if ((ret = ff_get_buffer(avccontext, &context->frame)) < 0) { av_log(avccontext, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 53bdb58b48..2aac453cb3 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -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, @@ -173,7 +174,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; } diff --git a/libavcodec/mace.c b/libavcodec/mace.c index c76f486063..d2a04114f4 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -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; } diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index c47093b01d..e1ff53ba72 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -35,6 +35,7 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "dsputil.h" +#include "internal.h" #include "mjpeg.h" #include "mjpegdec.h" #include "jpeglsdec.h" @@ -435,7 +436,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; } diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index d587982e8c..753fff11ea 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -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" @@ -981,7 +982,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; } diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index bacb78e8e6..2326a9bd8b 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "get_bits.h" #include "dsputil.h" +#include "internal.h" #include "mpegaudiodsp.h" #include "mpc.h" @@ -225,7 +226,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data, /* get output buffer */ c->frame.nb_samples = 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; } diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 1af417ac08..a6bb5801c5 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "get_bits.h" #include "dsputil.h" +#include "internal.h" #include "mpegaudiodsp.h" #include "mpc.h" @@ -255,7 +256,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; } diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index e33c643b17..8f748f48a9 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -29,6 +29,7 @@ #include "libavutil/libm.h" #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "mathops.h" #include "mpegaudiodsp.h" #include "dsputil.h" @@ -1629,7 +1630,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; } @@ -1934,7 +1935,7 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame->nb_samples = s->frames * 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; } diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index caeb800c61..c3c4b35ab2 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -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; } diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c index c1e151211f..1e7b59397f 100644 --- a/libavcodec/mxpegdec.c +++ b/libavcodec/mxpegdec.c @@ -25,6 +25,7 @@ * MxPEG decoder */ +#include "internal.h" #include "mjpeg.h" #include "mjpegdec.h" @@ -250,7 +251,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); } @@ -269,7 +270,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); } diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index b4823a895d..8fa52de9d5 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -38,6 +38,7 @@ #include "dsputil.h" #include "fft.h" #include "fmtconvert.h" +#include "internal.h" #include "nellymoser.h" #include "sinewin.h" @@ -171,7 +172,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; } diff --git a/libavcodec/paf.c b/libavcodec/paf.c index 877b17066f..39d6509542 100644 --- a/libavcodec/paf.c +++ b/libavcodec/paf.c @@ -24,6 +24,8 @@ #include "libavcodec/paf.h" #include "bytestream.h" #include "avcodec.h" +#include "internal.h" + static const uint8_t block_sequences[16][8] = { @@ -410,7 +412,7 @@ static int paf_aud_decode(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; c->frame.nb_samples = PAF_SOUND_SAMPLES * frames; - if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) + if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) return ret; output_samples = (int16_t *)c->frame.data[0]; diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c index 01a61c8696..fe7c4a71d2 100644 --- a/libavcodec/pcm-mpeg.c +++ b/libavcodec/pcm-mpeg.c @@ -27,6 +27,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" /* * Channel Mapping according to @@ -166,7 +167,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; } diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index d769fb1e38..ea6fabd47b 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -359,7 +359,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; } diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index 722e89ff96..7f24756047 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "bytestream.h" #include "get_bits.h" +#include "internal.h" typedef struct PCXContext { AVFrame picture; @@ -150,7 +151,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, return AVERROR_INVALIDDATA; if (w != avctx->width || h != avctx->height) avcodec_set_dimensions(avctx, w, h); - 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; } diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 748d9b3bcb..64dd8159c9 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -28,6 +28,7 @@ #include "avcodec.h" #include "bytestream.h" #include "cga_data.h" +#include "internal.h" typedef struct PicContext { AVFrame frame; @@ -154,7 +155,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; } diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index c1b8b08215..06fd133c61 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "png.h" #include "pngdsp.h" @@ -648,7 +649,7 @@ static int decode_frame(AVCodecContext *avctx, avctx->release_buffer(avctx, p); p->reference= 3; - 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; } diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 66fc9df726..0c0973899c 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "put_bits.h" #include "pnm.h" @@ -47,7 +48,7 @@ static int pnm_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; } diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index e643c87ade..7064fb48d8 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "simple_idct.h" #include "proresdec.h" @@ -550,7 +551,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, if (frame->data[0]) avctx->release_buffer(avctx, frame); - if (avctx->get_buffer(avctx, frame) < 0) + if (ff_get_buffer(avctx, frame) < 0) return -1; decode_picture: diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index d33864922e..ce2396960d 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -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++) { diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 9a52924d3d..ed6f0e1171 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -587,7 +587,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); } @@ -962,7 +962,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 && @@ -985,7 +985,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 { pthread_mutex_lock(&p->progress_mutex); p->requested_frame = f; diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index c9adb6d3fa..edb5936fe2 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -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; } diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index e406049171..aff872563c 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -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; } diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 1dfb8d5715..c8727c6b1c 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -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" @@ -1973,7 +1974,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; } diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index ab4c6c154c..227ae1536c 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -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; } diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 0a7c788077..565f6ad6c3 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" typedef struct QpegContext{ AVCodecContext *avctx; @@ -272,7 +273,7 @@ static int decode_frame(AVCodecContext *avctx, FFSWAP(AVFrame, *ref, *p); p->reference= 3; - 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; } diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index 4c78b5341c..902f92fbf3 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "libavutil/bswap.h" #include "libavutil/common.h" @@ -55,7 +56,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; diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c index ad9e00836f..b0e2498f40 100644 --- a/libavcodec/ra144dec.c +++ b/libavcodec/ra144dec.c @@ -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; } diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index cefc99c685..7f0e2f71a8 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -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" @@ -200,7 +201,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; } diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c index c9c8080dd9..580def3183 100644 --- a/libavcodec/ralf.c +++ b/libavcodec/ralf.c @@ -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; } diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index c51fbd5873..2e2d946fa2 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -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 @@ -185,7 +186,7 @@ static int rl2_decode_frame(AVCodecContext *avctx, /** get buffer */ s->frame.reference= 0; - if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) { + if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index b38ecab561..02f1a452ae 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -1031,8 +1031,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; } diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 5058ba0fbc..a06192c488 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -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 @@ -109,7 +110,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; } diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 766ac68e71..7432fa273f 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -24,6 +24,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "libavutil/bswap.h" #include "libavcodec/dsputil.h" #include "sanm_data.h" @@ -1122,7 +1123,7 @@ static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr) int ret, dstpitch, height = ctx->height; int srcpitch = ctx->pitch * (hdr ? sizeof(ctx->frm0[0]) : 1); - if ((ret = ctx->avctx->get_buffer(ctx->avctx, ctx->output)) < 0) { + if ((ret = ff_get_buffer(ctx->avctx, ctx->output)) < 0) { av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index bf6e5723f6..7ea9b6d69a 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -23,6 +23,7 @@ #include "libavutil/avassert.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "sgi.h" typedef struct SgiState { @@ -210,7 +211,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; } diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index da5a2b499f..cbfa23a4e5 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -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 @@ -583,7 +584,7 @@ static int shorten_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; } diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index d8bfdd28c9..06b22c0c31 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -31,6 +31,7 @@ #define BITSTREAM_READER_LE #include "get_bits.h" #include "dsputil.h" +#include "internal.h" #include "lsp.h" #include "acelp_vectors.h" @@ -543,7 +544,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ ctx->frame.nb_samples = mode_par->frames_per_packet * subframe_size * mode_par->subframe_count; - 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; } diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index e1e67da3ac..939bac49c0 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -33,6 +33,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" +#include "internal.h" #include "mathops.h" #define BITSTREAM_READER_LE @@ -643,7 +644,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = unp_size / (avctx->channels * (bits + 1)); - 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; } diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 2f3ddbee18..7874c1d2cf 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -24,6 +24,7 @@ #include "avcodec.h" #include "dsputil.h" #include "dwt.h" +#include "internal.h" #include "snow.h" #include "snowdata.h" @@ -468,7 +469,7 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) { int ret, emu_buf_size; if(!s->scratchbuf) { - if ((ret = s->avctx->get_buffer(s->avctx, &s->mconly_picture)) < 0) { + if ((ret = ff_get_buffer(s->avctx, &s->mconly_picture)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } @@ -632,7 +633,7 @@ int ff_snow_frame_start(SnowContext *s){ } s->current_picture.reference= 3; - if(s->avctx->get_buffer(s->avctx, &s->current_picture) < 0){ + if(ff_get_buffer(s->avctx, &s->current_picture) < 0){ av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index f377409678..abb6a82f21 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -24,6 +24,7 @@ #include "avcodec.h" #include "dsputil.h" #include "dwt.h" +#include "internal.h" #include "snow.h" #include "rangecoder.h" diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 23d8d81bf7..701a56d284 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -238,7 +238,7 @@ static av_cold int encode_init(AVCodecContext *avctx) ff_set_cmp(&s->dsp, s->dsp.me_cmp, s->avctx->me_cmp); ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, s->avctx->me_sub_cmp); - s->avctx->get_buffer(s->avctx, &s->input_picture); + ff_get_buffer(s->avctx, &s->input_picture); if(s->avctx->me_method == ME_ITER){ int i; diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index b7caf4810e..0bc8428a1e 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -877,7 +877,7 @@ static int sonic_decode_frame(AVCodecContext *avctx, if (buf_size == 0) return 0; 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; } diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index eb245dab1a..f85bb96844 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -23,6 +23,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "avcodec.h" +#include "internal.h" #include "sunrast.h" typedef struct SUNRASTContext { @@ -118,7 +119,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, if (w != avctx->width || h != avctx->height) avcodec_set_dimensions(avctx, w, h); - 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; } diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 08777957cf..216fa3b062 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -547,8 +547,8 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } if (!s->current_picture.data[0]) { - avctx->get_buffer(avctx, &s->current_picture); - avctx->get_buffer(avctx, &s->last_picture); + ff_get_buffer(avctx, &s->current_picture); + ff_get_buffer(avctx, &s->last_picture); s->scratchbuf = av_malloc(s->current_picture.linesize[0] * 16 * 2); } diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 11202967d2..66b136a56f 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -27,6 +27,7 @@ #include "tak.h" #include "avcodec.h" +#include "internal.h" #include "unary.h" #include "dsputil.h" @@ -798,7 +799,7 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data, s->ti.frame_samples; s->frame.nb_samples = s->nb_samples; - if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) + if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) return ret; if (avctx->bits_per_raw_sample <= 16) { diff --git a/libavcodec/targa.c b/libavcodec/targa.c index d761078cfe..5c0efb3f40 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -23,6 +23,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "targa.h" typedef struct TargaContext { @@ -181,7 +182,7 @@ static int decode_frame(AVCodecContext *avctx, return ret; if (w != avctx->width || h != avctx->height) avcodec_set_dimensions(avctx, w, h); - 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; } diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c index bac5aeeddf..0e999dbcfa 100644 --- a/libavcodec/targa_y216dec.c +++ b/libavcodec/targa_y216dec.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "internal.h" static av_cold int y216_decode_init(AVCodecContext *avctx) { @@ -54,7 +55,7 @@ static int y216_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/thread.h b/libavcodec/thread.h index 6de28a5bd1..e83803073f 100644 --- a/libavcodec/thread.h +++ b/libavcodec/thread.h @@ -89,7 +89,7 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field); /** * Wrapper around get_buffer() for frame-multithreaded codecs. - * Call this function instead of avctx->get_buffer(f). + * Call this function instead of ff_get_buffer(f). * Cannot be called after the codec has called ff_thread_finish_setup(). * * @param avctx The current context. diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 34fb10999d..f7a1e75209 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -34,6 +34,7 @@ #include "tiff.h" #include "tiff_data.h" #include "faxcompr.h" +#include "internal.h" #include "mathops.h" #include "libavutil/attributes.h" #include "libavutil/intreadwrite.h" @@ -597,7 +598,7 @@ static int init_image(TiffContext *s) } if (s->picture.data[0]) s->avctx->release_buffer(s->avctx, &s->picture); - if ((ret = s->avctx->get_buffer(s->avctx, &s->picture)) < 0) { + if ((ret = ff_get_buffer(s->avctx, &s->picture)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index a0b3f36d92..63ec830f6d 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -29,6 +29,7 @@ #include <string.h> #include "avcodec.h" +#include "internal.h" #include "libavutil/internal.h" #include "libavutil/xga_font_data.h" @@ -51,7 +52,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, if (tmv->pic.data[0]) avctx->release_buffer(avctx, &tmv->pic); - if (avctx->get_buffer(avctx, &tmv->pic) < 0) { + if (ff_get_buffer(avctx, &tmv->pic) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index d523bdd792..e8a88cfb74 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -24,6 +24,7 @@ #include "avcodec.h" #include "dsputil.h" #include "get_bits.h" +#include "internal.h" #include "truespeech_data.h" /** @@ -327,7 +328,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ c->frame.nb_samples = iterations * 240; - 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; } diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index 1ba3bb97c6..aaf2127c11 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -39,6 +39,7 @@ #include <stdlib.h> #include "avcodec.h" +#include "internal.h" #include "msrledec.h" #include <zlib.h> diff --git a/libavcodec/tta.c b/libavcodec/tta.c index b0e538fe5d..27efceba03 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -32,6 +32,7 @@ #include <limits.h> #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "libavutil/crc.h" #define FORMAT_SIMPLE 1 @@ -315,7 +316,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = framelen; - 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; } diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index d7a372648a..b34f159485 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -25,6 +25,7 @@ #include "get_bits.h" #include "dsputil.h" #include "fft.h" +#include "internal.h" #include "lsp.h" #include "sinewin.h" @@ -834,7 +835,7 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data, /* get output buffer */ if (tctx->discarded_packets >= 2) { tctx->frame.nb_samples = mtab->size; - if ((ret = avctx->get_buffer(avctx, &tctx->frame)) < 0) { + if ((ret = ff_get_buffer(avctx, &tctx->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/txd.c b/libavcodec/txd.c index a526035da8..29de782cce 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "bytestream.h" #include "avcodec.h" +#include "internal.h" #include "s3tc.h" typedef struct TXDContext { @@ -83,7 +84,7 @@ static int txd_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; } diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 48ef679106..be6b3a9e23 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -585,6 +585,11 @@ int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame) } } +int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame) +{ + return avctx->get_buffer(avctx, frame); +} + void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic) { int i; @@ -639,7 +644,7 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic) if (pic->data[0] == NULL) { /* We will copy from buffer, so must be readable */ pic->buffer_hints |= FF_BUFFER_HINTS_READABLE; - return s->get_buffer(s, pic); + return ff_get_buffer(s, pic); } assert(s->pix_fmt == pic->format); @@ -657,7 +662,7 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic) pic->data[i] = pic->base[i] = NULL; pic->opaque = NULL; /* Allocate new frame */ - if ((ret = s->get_buffer(s, pic))) + if ((ret = ff_get_buffer(s, pic))) return ret; /* Copy image data from old buffer to new buffer */ av_picture_copy((AVPicture *)pic, (AVPicture *)&temp_pic, s->pix_fmt, s->width, @@ -2679,7 +2684,7 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f) ff_init_buffer_info(avctx, f); - return avctx->get_buffer(avctx, f); + return ff_get_buffer(avctx, f); } void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f) diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index d508ce8ea0..b0754767a9 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -22,6 +22,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "v210dec.h" #include "libavutil/bswap.h" #include "libavutil/internal.h" @@ -111,7 +112,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, avctx->release_buffer(avctx, pic); pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) + if (ff_get_buffer(avctx, pic) < 0) return -1; y = (uint16_t*)pic->data[0]; diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index 376588c736..900281a0c4 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -19,6 +19,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "libavutil/bswap.h" #include "libavutil/internal.h" #include "libavutil/mem.h" @@ -60,7 +61,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } pic->reference= 0; - if(avctx->get_buffer(avctx, pic) < 0) + if(ff_get_buffer(avctx, pic) < 0) return -1; ydst= (uint16_t *)pic->data[0]; diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c index fd742cab85..e8eaeb4e19 100644 --- a/libavcodec/v308dec.c +++ b/libavcodec/v308dec.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "internal.h" static av_cold int v308_decode_init(AVCodecContext *avctx) { @@ -56,7 +57,7 @@ static int v308_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c index 8820fc4cbf..37f1d6ee87 100644 --- a/libavcodec/v408dec.c +++ b/libavcodec/v408dec.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "internal.h" static av_cold int v408_decode_init(AVCodecContext *avctx) { @@ -53,7 +54,7 @@ static int v408_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 4d4d625d16..52cdf3218d 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -23,6 +23,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "internal.h" static av_cold int v410_decode_init(AVCodecContext *avctx) { @@ -67,7 +68,7 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 512945810e..79f3cae64a 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -29,6 +29,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" enum VBFlags{ VB_HAS_GMC = 0x01, @@ -198,7 +199,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 = 3; - 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; } diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 2c681782bd..22e92a45bb 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -29,6 +29,7 @@ #include "avcodec.h" #include "dsputil.h" #include "get_bits.h" +#include "internal.h" #include "mathops.h" typedef struct { @@ -133,7 +134,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } /* Allocate buffer */ - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 9e0e098aab..0946db5334 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5040,7 +5040,7 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb) v->sprite_output_frame.buffer_hints = FF_BUFFER_HINTS_VALID; v->sprite_output_frame.reference = 0; - if (avctx->get_buffer(avctx, &v->sprite_output_frame) < 0) { + if (ff_get_buffer(avctx, &v->sprite_output_frame) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index acac925870..6486e63a0d 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "dsputil.h" +#include "internal.h" #include "libavutil/internal.h" typedef struct VCR1Context { @@ -87,7 +88,7 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data, } 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; } diff --git a/libavcodec/vima.c b/libavcodec/vima.c index 35e2a3cdd5..f823cb37e7 100644 --- a/libavcodec/vima.c +++ b/libavcodec/vima.c @@ -22,6 +22,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "adpcm_data.h" typedef struct { @@ -170,7 +171,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, } vima->frame.nb_samples = samples; - if ((ret = avctx->get_buffer(avctx, &vima->frame)) < 0) { + if ((ret = ff_get_buffer(avctx, &vima->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 6e92e18b00..3278c6fdcc 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -47,6 +47,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "internal.h" #define VMD_HEADER_SIZE 0x330 #define PALETTE_COUNT 256 @@ -425,7 +426,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, return buf_size; s->frame.reference = 3; - 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; } @@ -601,7 +602,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = ((silent_chunks + audio_chunks) * avctx->block_align) / 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; } diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 0e018f1f1e..415012f4e4 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -37,6 +37,7 @@ #include "dsputil.h" #include "fft.h" #include "fmtconvert.h" +#include "internal.h" #include "vorbis.h" #include "xiph.h" @@ -1652,7 +1653,7 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, void *data, /* get output buffer */ vc->frame.nb_samples = vc->blocksize[1] / 2; - if ((ret = avccontext->get_buffer(avccontext, &vc->frame)) < 0) { + if ((ret = ff_get_buffer(avccontext, &vc->frame)) < 0) { av_log(avccontext, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index ae7a1172e1..1a7c36ef13 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -25,6 +25,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "vp56.h" #include "vp56data.h" @@ -534,7 +535,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } p->reference = 3; - 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; } diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index 2980f948b3..e1afca3c2d 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -71,6 +71,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #define PALETTE_COUNT 256 #define VQA_HEADER_SIZE 0x2A @@ -591,7 +592,7 @@ static int vqa_decode_frame(AVCodecContext *avctx, if (s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); - if ((res = avctx->get_buffer(avctx, &s->frame))) { + if ((res = ff_get_buffer(avctx, &s->frame))) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return res; } diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index bc038a9534..6b67f30b21 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -24,6 +24,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "unary.h" /** @@ -1218,7 +1219,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = s->samples + 1; - 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; } diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index f3ce474f41..48d52fdc05 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -34,6 +34,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "wma.h" #undef NDEBUG @@ -834,7 +835,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = nb_frames * 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; } diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 749e41f915..066b572fc2 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -1015,7 +1015,7 @@ static int decode_frame(WmallDecodeCtx *s) int more_frames = 0, len = 0, i, ret; s->frame.nb_samples = s->samples_per_frame; - if ((ret = s->avctx->get_buffer(s->avctx, &s->frame)) < 0) { + if ((ret = ff_get_buffer(s->avctx, &s->frame)) < 0) { /* return an error if no frame could be decoded at all */ av_log(s->avctx, AV_LOG_ERROR, "not enough space for the output samples\n"); diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 235425ea58..4989cab162 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1380,7 +1380,7 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr) /* get output buffer */ s->frame.nb_samples = s->samples_per_frame; - 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"); s->packet_loss = 1; return 0; diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index c156be830a..0ae3748911 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -33,6 +33,7 @@ #include "libavutil/mem.h" #include "dsputil.h" #include "avcodec.h" +#include "internal.h" #include "get_bits.h" #include "put_bits.h" #include "wmavoice_data.h" @@ -1801,7 +1802,7 @@ static int synth_superframe(AVCodecContext *ctx, int *got_frame_ptr) /* get output buffer */ s->frame.nb_samples = 480; - if ((res = ctx->get_buffer(ctx, &s->frame)) < 0) { + if ((res = ff_get_buffer(ctx, &s->frame)) < 0) { av_log(ctx, AV_LOG_ERROR, "get_buffer() failed\n"); return res; } diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 494dc98a77..a99796632d 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "mathops.h" @@ -85,7 +86,7 @@ static int decode_frame(AVCodecContext *avctx, 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"); av_free(rbuf); return ret; diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index 7cc0678466..1c347e85a2 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -25,6 +25,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "internal.h" /** * @file @@ -89,7 +90,7 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ s->frame.nb_samples = out_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; } diff --git a/libavcodec/xan.c b/libavcodec/xan.c index bccbe24d85..da6627c065 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -38,6 +38,7 @@ #include "bytestream.h" #define BITSTREAM_READER_LE #include "get_bits.h" +#include "internal.h" #define RUNTIME_GAMMA 0 @@ -582,7 +583,7 @@ static int xan_decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - if ((ret = avctx->get_buffer(avctx, &s->current_frame))) { + if ((ret = ff_get_buffer(avctx, &s->current_frame))) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index 4b8704aadd..39ed50392f 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -81,7 +81,7 @@ static int xbm_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) return ret; // goto start of image data diff --git a/libavcodec/xfacedec.c b/libavcodec/xfacedec.c index 7cccfa5c94..cc7f7b22f0 100644 --- a/libavcodec/xfacedec.c +++ b/libavcodec/xfacedec.c @@ -27,6 +27,7 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "xface.h" static int pop_integer(BigInt *b, const ProbRange *pranges) @@ -136,7 +137,7 @@ static int xface_decode_frame(AVCodecContext *avctx, if (xface->frame.data[0]) avctx->release_buffer(avctx, &xface->frame); xface->frame.data[0] = NULL; - if ((ret = avctx->get_buffer(avctx, &xface->frame)) < 0) + if ((ret = ff_get_buffer(avctx, &xface->frame)) < 0) return ret; xface->frame.reference = 0; diff --git a/libavcodec/xl.c b/libavcodec/xl.c index 8c5ccd387a..3103ff463b 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -27,6 +27,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "internal.h" typedef struct VideoXLContext{ AVCodecContext *avctx; @@ -68,7 +69,7 @@ static int decode_frame(AVCodecContext *avctx, 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; } diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index ef99a6bbf8..2f8453734e 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -23,6 +23,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "xwd.h" static av_cold int xwd_decode_init(AVCodecContext *avctx) @@ -211,7 +212,7 @@ static int xwd_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; } diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c index e283690f00..45c994d98a 100644 --- a/libavcodec/y41pdec.c +++ b/libavcodec/y41pdec.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "internal.h" static av_cold int y41p_decode_init(AVCodecContext *avctx) { @@ -58,7 +59,7 @@ static int y41p_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 255ed32ca7..856d6f4e26 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -27,6 +27,7 @@ #include "avcodec.h" #include "get_bits.h" +#include "internal.h" typedef struct YopDecContext { AVFrame frame; @@ -207,7 +208,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, return AVERROR_INVALIDDATA; } - 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; diff --git a/libavcodec/yuv4dec.c b/libavcodec/yuv4dec.c index ce44f1330f..6454fbfff8 100644 --- a/libavcodec/yuv4dec.c +++ b/libavcodec/yuv4dec.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "internal.h" static av_cold int yuv4_decode_init(AVCodecContext *avctx) { @@ -54,7 +55,7 @@ static int yuv4_decode_frame(AVCodecContext *avctx, void *data, pic->reference = 0; - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index c6a9ba94a2..e5edb5f0ed 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -19,6 +19,7 @@ #include <zlib.h> #include "avcodec.h" +#include "internal.h" #include "libavutil/common.h" typedef struct { @@ -58,7 +59,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if (avctx->get_buffer(avctx, pic) < 0) { + if (ff_get_buffer(avctx, pic) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n"); return AVERROR(ENOMEM); } diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 1b9435150f..6d25056c85 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -30,6 +30,7 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "internal.h" #include <zlib.h> @@ -411,7 +412,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac c->pic.reference = 3; c->pic.buffer_hints = FF_BUFFER_HINTS_VALID; - 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; } |