Merge commit '0ab76ddf313eeab70d06619ae0376fd7dd40761b' into release/0.10
* commit '0ab76ddf313eeab70d06619ae0376fd7dd40761b':
avcodec: Introduce ff_get_buffer
Conflicts:
libavcodec/8svx.c
libavcodec/dpcm.c
libavcodec/utils.c
libavcodec/vmdav.c
libavcodec/yop.c
See: 668494acd8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -614,7 +614,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);
|
||||
}
|
||||
|
||||
/* If internal buffer type return the same buffer */
|
||||
@@ -630,7 +630,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,
|
||||
@@ -1982,7 +1982,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)
|
||||
@@ -2036,3 +2036,16 @@ int avcodec_is_open(AVCodecContext *s)
|
||||
{
|
||||
return !!s->internal;
|
||||
}
|
||||
|
||||
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
|
||||
{
|
||||
switch (avctx->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
if (av_image_check_size(avctx->width, avctx->height, 0, avctx)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %dx%d\n",
|
||||
avctx->width, avctx->height);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
return avctx->get_buffer(avctx, frame);
|
||||
}
|
||||
|
Reference in New Issue
Block a user