diff options
author | Eddie Hao <eddiehao1@gmail.com> | 2016-01-17 08:41:54 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-17 14:01:35 +0300 |
commit | a6dc1eb8376c59511845e8c2c92c5bd0a7e31b72 (patch) | |
tree | bc401c849c438b3bfb9413b00cf441e133c9a2eb | |
parent | 757248ea3cd917a7755cb15f817a9b1f15578718 (diff) |
remove all uses of the deprecated avpicture_get_size() function
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/libutvideodec.cpp | 3 | ||||
-rw-r--r-- | libavcodec/libutvideoenc.cpp | 3 | ||||
-rw-r--r-- | libavdevice/decklink_dec.cpp | 2 | ||||
-rw-r--r-- | libavdevice/lavfi.c | 3 | ||||
-rw-r--r-- | libavformat/frmdec.c | 3 |
5 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp index 47261a6c7f..7c60f4fb83 100644 --- a/libavcodec/libutvideodec.cpp +++ b/libavcodec/libutvideodec.cpp @@ -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 diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp index 87462470e2..96d8fe1030 100644 --- a/libavcodec/libutvideoenc.cpp +++ b/libavcodec/libutvideoenc.cpp @@ -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; diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 89f93de453..6c5bc5dbed 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -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; diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 3453b4d3e7..077879edc8 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -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; diff --git a/libavformat/frmdec.c b/libavformat/frmdec.c index a6f19afcd4..260afbc588 100644 --- a/libavformat/frmdec.c +++ b/libavformat/frmdec.c @@ -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; |