]> git.sesse.net Git - ffmpeg/commitdiff
Replace all instances of avcodec_alloc_frame() with av_frame_alloc().
authorAnton Khirnov <anton@khirnov.net>
Sat, 9 Nov 2013 09:05:22 +0000 (10:05 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sat, 16 Nov 2013 11:44:20 +0000 (12:44 +0100)
18 files changed:
avconv.c
avplay.c
libavcodec/alacenc.c
libavcodec/api-example.c
libavcodec/libopenjpegenc.c
libavcodec/libtheoraenc.c
libavcodec/libvpxenc.c
libavcodec/pcm.c
libavcodec/proresenc.c
libavcodec/svq1dec.c
libavcodec/utils.c
libavcodec/utvideoenc.c
libavcodec/v210enc.c
libavcodec/v410enc.c
libavcodec/xbmenc.c
libavcodec/xwdenc.c
libavformat/output-example.c
libavformat/utils.c

index 8d8c802f56f1f1c244c8f8b7422a2e80b01fbfb8..1e8c25eef210bf5849b29a0ebb63c18ca5024db6 100644 (file)
--- 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);
index bb8c6897fc8fd65b485264efeeb46b0d7d9b5004..d6c71e95e43705a73fbff282a7ca1dbba8bd486c 100644 (file)
--- 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);
index 5fbcbfcd14f4ae4e67e201722f1919312beb12fc..401f26f66c34c40244a902a7d5fd1c6d73115706 100644 (file)
@@ -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;
index 25b7cfe2a6ead9f61a2f3969f332f23b5bee20b7..54a1ecaa3c88099abc7ebee7d7143daa25093a38 100644 (file)
@@ -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 */
index f2f98cd2c291d654e40e328f75d8332a5cbef0a0..b84e6a4e310cabe6a6476029516f892ed4611f87 100644 (file)
@@ -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;
index b88566466e3636d6543caf76a63c9986fb11b935..9041a27df0ae36039d61b5e911ac7aef0b17b4ed 100644 (file)
@@ -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;
 }
index d5c4fe15ce195b8622b608bfea4b007804d6e030..9996afc74ce7fb6a84a922d592de860ac2dccc68 100644 (file)
@@ -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);
index 882c167614f9fc345cc33d6704c4fb25bbd5327a..9fadcb7b86151e73e714159d24e1eabd221e2514 100644 (file)
@@ -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);
 
index 758b8e3a54c89746b0e775c726af6f6dfb24047c..7e9ce541b68941b4b3d4884472fb5528ae818f84 100644 (file)
@@ -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);
 
index 3b1a275bf4d761990c9b28ebaaee159e1f7bc75f..000487b197d712844e1d133917919c37cbf56079 100644 (file)
@@ -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);
 
index 23165f4f43533efe487f34f4a834077274852c75..da50e4268ce775a1587fe411106481c5587c4092 100644 (file)
@@ -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;
index 36ac335e198969bc797435c9e3d8a1e82d745723..dd8d07ebf8467c218374a1e37e8f75a366da6198 100644 (file)
@@ -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");
index 7efbb9607cf29007a3209073adefe73eaaf99d15..ef0d6ab2a47adb1fe21fb77942bc29ab74c584b3 100644 (file)
@@ -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);
 
index 91cd823bb82c62e91d967bef53747f4c0c8b57dc..77b32d7ab6568378356146123644158aa543d259 100644 (file)
@@ -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");
index 8616372aa97f9efd15474e8b70db1b97173499d3..d6657dcd0862baaec8669fcec6ef954c1c3af29f 100644 (file)
@@ -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;
index 87d6cff11bd9ea873a47df96b4772350059b3b6f..54599a08a15cba66942ede95b28f0c24eedabeae 100644 (file)
@@ -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);
 
index 496b7f82126489cfdfba6e8a462345b0f180243c..eb8cb7d8e32818337061f3c37be8894f022d7772 100644 (file)
@@ -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);
index 6193d32f037b285901f22c125f7c9e99bab15927..377fdd99a0e15fe290aeeafbf4040468956b31cd 100644 (file)
@@ -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)