[FFmpeg-cvslog] Replace all instances of avcodec_alloc_frame() with av_frame_alloc().
Anton Khirnov
git at videolan.org
Sun Nov 17 00:01:26 CET 2013
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Nov 9 10:05:22 2013 +0100| [5b9c3b4505206143d85398c1410949319fa1180f] | committer: Anton Khirnov
Replace all instances of avcodec_alloc_frame() with av_frame_alloc().
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b9c3b4505206143d85398c1410949319fa1180f
---
avconv.c | 4 ++--
avplay.c | 2 +-
libavcodec/alacenc.c | 2 +-
libavcodec/api-example.c | 8 ++++----
libavcodec/libopenjpegenc.c | 2 +-
libavcodec/libtheoraenc.c | 2 +-
libavcodec/libvpxenc.c | 2 +-
libavcodec/pcm.c | 2 +-
libavcodec/proresenc.c | 2 +-
libavcodec/svq1dec.c | 2 +-
libavcodec/utils.c | 2 +-
libavcodec/utvideoenc.c | 2 +-
libavcodec/v210enc.c | 2 +-
libavcodec/v410enc.c | 2 +-
libavcodec/xbmenc.c | 2 +-
libavcodec/xwdenc.c | 2 +-
libavformat/output-example.c | 4 ++--
libavformat/utils.c | 2 +-
18 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/avconv.c b/avconv.c
index 8d8c802..1e8c25e 100644
--- a/avconv.c
+++ b/avconv.c
@@ -637,7 +637,7 @@ static int poll_filter(OutputStream *ost)
AVFrame *filtered_frame = NULL;
int frame_size, ret;
- if (!ost->filtered_frame && !(ost->filtered_frame = avcodec_alloc_frame())) {
+ if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
return AVERROR(ENOMEM);
} else
avcodec_get_frame_defaults(ost->filtered_frame);
@@ -1056,7 +1056,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
AVCodecContext *avctx = ist->st->codec;
int i, ret, err = 0, resample_changed;
- if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))
+ if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
return AVERROR(ENOMEM);
if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
return AVERROR(ENOMEM);
diff --git a/avplay.c b/avplay.c
index bb8c689..d6c71e9 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1842,7 +1842,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
int resample_changed, audio_resample;
if (!is->frame) {
- if (!(is->frame = avcodec_alloc_frame()))
+ if (!(is->frame = av_frame_alloc()))
return AVERROR(ENOMEM);
} else
avcodec_get_frame_defaults(is->frame);
diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c
index 5fbcbfc..401f26f 100644
--- a/libavcodec/alacenc.c
+++ b/libavcodec/alacenc.c
@@ -579,7 +579,7 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
goto error;
}
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) {
ret = AVERROR(ENOMEM);
goto error;
diff --git a/libavcodec/api-example.c b/libavcodec/api-example.c
index 25b7cfe..54a1eca 100644
--- a/libavcodec/api-example.c
+++ b/libavcodec/api-example.c
@@ -155,7 +155,7 @@ static void audio_encode_example(const char *filename)
}
/* frame containing input raw audio */
- frame = avcodec_alloc_frame();
+ frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "could not allocate audio frame\n");
exit(1);
@@ -268,7 +268,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
int got_frame = 0;
if (!decoded_frame) {
- if (!(decoded_frame = avcodec_alloc_frame())) {
+ if (!(decoded_frame = av_frame_alloc())) {
fprintf(stderr, "out of memory\n");
exit(1);
}
@@ -334,7 +334,7 @@ static void video_encode_example(const char *filename)
}
c = avcodec_alloc_context3(codec);
- picture= avcodec_alloc_frame();
+ picture = av_frame_alloc();
/* put sample parameters */
c->bit_rate = 400000;
@@ -479,7 +479,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
}
c = avcodec_alloc_context3(codec);
- picture= avcodec_alloc_frame();
+ picture = av_frame_alloc();
if(codec->capabilities&CODEC_CAP_TRUNCATED)
c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index f2f98cd..b84e6a4 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -168,7 +168,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);
}
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) {
av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
goto fail;
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index b885664..9041a27 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -259,7 +259,7 @@ static av_cold int encode_init(AVCodecContext* avc_context)
th_comment_clear(&t_comment);
/* Set up the output AVFrame */
- avc_context->coded_frame= avcodec_alloc_frame();
+ avc_context->coded_frame = av_frame_alloc();
return 0;
}
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index d5c4fe1..9996afc 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -353,7 +353,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
(unsigned char*)1);
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) {
av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
vp8_free(avctx);
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 882c167..9fadcb7 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -48,7 +48,7 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
avctx->block_align = avctx->channels * avctx->bits_per_coded_sample / 8;
avctx->bit_rate = avctx->block_align * avctx->sample_rate * 8;
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c
index 758b8e3..7e9ce54 100644
--- a/libavcodec/proresenc.c
+++ b/libavcodec/proresenc.c
@@ -1075,7 +1075,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
int interlaced = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
avctx->bits_per_raw_sample = 10;
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 3b1a275..000487b 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -742,7 +742,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx)
int i;
int offset = 0;
- s->prev = avcodec_alloc_frame();
+ s->prev = av_frame_alloc();
if (!s->prev)
return AVERROR(ENOMEM);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 23165f4..da50e42 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1125,7 +1125,7 @@ static int pad_last_frame(AVCodecContext *s, AVFrame **dst, const AVFrame *src)
AVFrame *frame = NULL;
int ret;
- if (!(frame = avcodec_alloc_frame()))
+ if (!(frame = av_frame_alloc()))
return AVERROR(ENOMEM);
frame->format = src->format;
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 36ac335..dd8d07e 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -126,7 +126,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR_OPTION_NOT_FOUND;
}
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 7efbb96..ef0d6ab 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -36,7 +36,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_WARNING, "bits per raw sample: %d != 10-bit\n",
avctx->bits_per_raw_sample);
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index 91cd823..77b32d7 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -32,7 +32,7 @@ static av_cold int v410_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c
index 8616372..d6657dc 100644
--- a/libavcodec/xbmenc.c
+++ b/libavcodec/xbmenc.c
@@ -26,7 +26,7 @@
static av_cold int xbm_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c
index 87d6cff..54599a0 100644
--- a/libavcodec/xwdenc.c
+++ b/libavcodec/xwdenc.c
@@ -32,7 +32,7 @@
static av_cold int xwd_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
diff --git a/libavformat/output-example.c b/libavformat/output-example.c
index 496b7f8..eb8cb7d 100644
--- a/libavformat/output-example.c
+++ b/libavformat/output-example.c
@@ -138,7 +138,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
{
AVCodecContext *c;
AVPacket pkt = { 0 }; // data and size must be 0;
- AVFrame *frame = avcodec_alloc_frame();
+ AVFrame *frame = av_frame_alloc();
int got_packet;
av_init_packet(&pkt);
@@ -237,7 +237,7 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
uint8_t *picture_buf;
int size;
- picture = avcodec_alloc_frame();
+ picture = av_frame_alloc();
if (!picture)
return NULL;
size = avpicture_get_size(pix_fmt, width, height);
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 6193d32..377fdd9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1928,7 +1928,7 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option
{
const AVCodec *codec;
int got_picture = 1, ret = 0;
- AVFrame *frame = avcodec_alloc_frame();
+ AVFrame *frame = av_frame_alloc();
AVPacket pkt = *avpkt;
if (!frame)
More information about the ffmpeg-cvslog
mailing list