remove all uses of the deprecated avpicture_get_size() function

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Eddie Hao 2016-01-16 21:41:54 -08:00 committed by Michael Niedermayer
parent 757248ea3c
commit a6dc1eb837
5 changed files with 9 additions and 5 deletions

View File

@ -27,6 +27,7 @@
extern "C" {
#include "avcodec.h"
#include "libavutil/imgutils.h"
}
#include "libutvideo.h"
@ -93,7 +94,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
}
/* Only allocate the buffer once */
utv->buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
utv->buf_size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1);
#ifdef UTVF_UQY2
if (format == UTVF_v210)
utv->buf_size += avctx->height * ((avctx->width + 47) / 48) * 128; // the linesize used by the decoder, this does not seem to be exported

View File

@ -27,6 +27,7 @@
extern "C" {
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
}
@ -94,7 +95,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
* We use this buffer to hold the data that Ut Video returns,
* since we cannot decode planes separately with it.
*/
ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
ret = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1);
if (ret < 0) {
av_free(info);
return ret;

View File

@ -473,7 +473,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
st->codec->time_base.den = ctx->bmd_tb_den;
st->codec->time_base.num = ctx->bmd_tb_num;
st->codec->bit_rate = avpicture_get_size(st->codec->pix_fmt, ctx->bmd_width, ctx->bmd_height) * 1/av_q2d(st->codec->time_base) * 8;
st->codec->bit_rate = av_image_get_buffer_size(st->codec->pix_fmt, ctx->bmd_width, ctx->bmd_height, 1) * 1/av_q2d(st->codec->time_base) * 8;
if (cctx->v210) {
st->codec->codec_id = AV_CODEC_ID_V210;

View File

@ -30,6 +30,7 @@
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/file.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
@ -430,7 +431,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
stream_idx = lavfi->sink_stream_map[min_pts_sink_idx];
if (frame->width /* FIXME best way of testing a video */) {
size = avpicture_get_size(frame->format, frame->width, frame->height);
size = av_image_get_buffer_size(frame->format, frame->width, frame->height, 1);
if ((ret = av_new_packet(pkt, size)) < 0)
return ret;

View File

@ -25,6 +25,7 @@
*/
#include "libavcodec/raw.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
@ -80,7 +81,7 @@ static int frm_read_packet(AVFormatContext *avctx, AVPacket *pkt)
if (s->count)
return AVERROR_EOF;
packet_size = avpicture_get_size(stc->pix_fmt, stc->width, stc->height);
packet_size = av_image_get_buffer_size(stc->pix_fmt, stc->width, stc->height, 1);
if (packet_size < 0)
return AVERROR_INVALIDDATA;