diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-10 13:22:56 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-12-04 21:41:59 +0100 |
commit | 594d4d5df3c70404168701dd5c90b7e6e5587793 (patch) | |
tree | bfed1b2d0f2a7cd1a3c1b147c5e33995642c9183 /libavcodec/utils.c | |
parent | cb45553f577f8e0ebfe05d3287e1b6fa5859b967 (diff) | |
download | ffmpeg-594d4d5df3c70404168701dd5c90b7e6e5587793.tar.gz |
lavc: add a wrapper for AVCodecContext.get_buffer().
It will be useful in the upcoming transition to refcounted AVFrames.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 06f4fc94e4..4909fc4862 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -526,6 +526,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; @@ -572,7 +577,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); @@ -595,7 +600,7 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic) pic->data[i] = pic->base[i] = NULL; pic->opaque = NULL; /* Allocate new frame */ - if (s->get_buffer(s, pic)) + if (ff_get_buffer(s, pic)) return -1; /* Copy image data from old buffer to new buffer */ av_picture_copy((AVPicture *)pic, (AVPicture *)&temp_pic, s->pix_fmt, s->width, @@ -2152,7 +2157,7 @@ unsigned int avpriv_toupper4(unsigned int x) int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f) { f->owner = avctx; - return avctx->get_buffer(avctx, f); + return ff_get_buffer(avctx, f); } void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f) |