Commit a6dc1eb8 authored by Eddie Hao's avatar Eddie Hao Committed by Michael Niedermayer

remove all uses of the deprecated avpicture_get_size() function

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 757248ea
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
extern "C" { extern "C" {
#include "avcodec.h" #include "avcodec.h"
#include "libavutil/imgutils.h"
} }
#include "libutvideo.h" #include "libutvideo.h"
...@@ -93,7 +94,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx) ...@@ -93,7 +94,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
} }
/* Only allocate the buffer once */ /* 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 #ifdef UTVF_UQY2
if (format == UTVF_v210) 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 utv->buf_size += avctx->height * ((avctx->width + 47) / 48) * 128; // the linesize used by the decoder, this does not seem to be exported
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
extern "C" { extern "C" {
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "avcodec.h" #include "avcodec.h"
#include "internal.h" #include "internal.h"
} }
...@@ -94,7 +95,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) ...@@ -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, * We use this buffer to hold the data that Ut Video returns,
* since we cannot decode planes separately with it. * 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) { if (ret < 0) {
av_free(info); av_free(info);
return ret; return ret;
......
...@@ -473,7 +473,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) ...@@ -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.den = ctx->bmd_tb_den;
st->codec->time_base.num = ctx->bmd_tb_num; 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) { if (cctx->v210) {
st->codec->codec_id = AV_CODEC_ID_V210; st->codec->codec_id = AV_CODEC_ID_V210;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "libavutil/bprint.h" #include "libavutil/bprint.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/file.h" #include "libavutil/file.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/log.h" #include "libavutil/log.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
...@@ -430,7 +431,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) ...@@ -430,7 +431,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
stream_idx = lavfi->sink_stream_map[min_pts_sink_idx]; stream_idx = lavfi->sink_stream_map[min_pts_sink_idx];
if (frame->width /* FIXME best way of testing a video */) { 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) if ((ret = av_new_packet(pkt, size)) < 0)
return ret; return ret;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
*/ */
#include "libavcodec/raw.h" #include "libavcodec/raw.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
...@@ -80,7 +81,7 @@ static int frm_read_packet(AVFormatContext *avctx, AVPacket *pkt) ...@@ -80,7 +81,7 @@ static int frm_read_packet(AVFormatContext *avctx, AVPacket *pkt)
if (s->count) if (s->count)
return AVERROR_EOF; 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) if (packet_size < 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment