History

Merge commit '5b9c3b4505206143d85398c1410949319fa1180f'

* commit '5b9c3b4505206143d85398c1410949319fa1180f': Replace all instances of avcodec_alloc_frame() with av_frame_alloc(). Conflicts: doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c libavcodec/alacenc.c libavcodec/libopenjpegenc.c libavcodec/libvpxenc.c libavcodec/pcm.c libavcodec/xbmenc.c libavcodec/xwdenc.c libavformat/utils.c

Michael Niedermayer committed 13 years ago

Commit 0ee905e2 parents 571a99d 5b9c3b427 files · +33 −33Browse files

Unified · Split

27 files
  1. doc/examples/decoding_encoding.c +4 −4
  2. doc/examples/muxing.c +2 −2
  3. ffmpeg.c +2 −2
  4. ffplay.c +1 −1
  5. libavcodec/avuienc.c +1 −1
  6. libavcodec/ffv1.c +1 −1
  7. libavcodec/libopenjpegenc.c +1 −1
  8. libavcodec/libtheoraenc.c +1 −1
  9. libavcodec/libutvideodec.cpp +1 −1
  10. libavcodec/libutvideoenc.cpp +1 −1
  11. libavcodec/libvpxenc.c +1 −1
  12. libavcodec/proresenc_anatoliy.c +1 −1
  13. libavcodec/proresenc_kostya.c +1 −1
  14. libavcodec/r210enc.c +1 −1
  15. libavcodec/svq1dec.c +1 −1
  16. libavcodec/utils.c +1 −1
  17. libavcodec/utvideoenc.c +1 −1
  18. libavcodec/v210enc.c +1 −1
  19. libavcodec/v308enc.c +1 −1
  20. libavcodec/v408enc.c +1 −1
  21. libavcodec/v410enc.c +1 −1
  22. libavcodec/xfaceenc.c +1 −1
  23. libavcodec/y41penc.c +1 −1
  24. libavcodec/yuv4enc.c +1 −1
  25. libavfilter/lavfutils.c +1 −1
  26. libavfilter/libmpcodecs/vf_uspp.c +2 −2
  27. libavformat/utils.c +1 −1
doc/examples/decoding_encoding.c+4−4
@@ -156,7 +156,7 @@ static void audio_encode_example(const char *filename) · 155 unmodified lines
156156 }
157157
158158 /* frame containing input raw audio */
159− frame = avcodec_alloc_frame();
159+ frame = av_frame_alloc();
160160 if (!frame) {
161161 fprintf(stderr, "Could not allocate audio frame\n");
162162 exit(1);
@@ -287,7 +287,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 124 unmodified lines
287287 int got_frame = 0;
288288
289289 if (!decoded_frame) {
290− if (!(decoded_frame = avcodec_alloc_frame())) {
290+ if (!(decoded_frame = av_frame_alloc())) {
291291 fprintf(stderr, "Could not allocate audio frame\n");
292292 exit(1);
293293 }
@@ -386,7 +386,7 @@ static void video_encode_example(const char *filename, int codec_id) · 92 unmodified lines
386386 exit(1);
387387 }
388388
389− frame = avcodec_alloc_frame();
389+ frame = av_frame_alloc();
390390 if (!frame) {
391391 fprintf(stderr, "Could not allocate video frame\n");
392392 exit(1);
@@ -565,7 +565,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 172 unmodified lines
565565 exit(1);
566566 }
567567
568− frame = avcodec_alloc_frame();
568+ frame = av_frame_alloc();
569569 if (!frame) {
570570 fprintf(stderr, "Could not allocate video frame\n");
571571 exit(1);
doc/examples/muxing.c+2−2
@@ -221,7 +221,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) · 220 unmodified lines
221221 {
222222 AVCodecContext *c;
223223 AVPacket pkt = { 0 }; // data and size must be 0;
224− AVFrame *frame = avcodec_alloc_frame();
224+ AVFrame *frame = av_frame_alloc();
225225 int got_packet, ret, dst_nb_samples;
226226
227227 av_init_packet(&pkt);
@@ -310,7 +310,7 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st) · 82 unmodified lines
310310 }
311311
312312 /* allocate and init a re-usable frame */
313− frame = avcodec_alloc_frame();
313+ frame = av_frame_alloc();
314314 if (!frame) {
315315 fprintf(stderr, "Could not allocate video frame\n");
316316 exit(1);
ffmpeg.c+2−2
@@ -1071,7 +1071,7 @@ static int reap_filters(void) · 1070 unmodified lines
10711071 if (!ost->filter)
10721072 continue;
10731073
1074− if (!ost->filtered_frame && !(ost->filtered_frame = avcodec_alloc_frame())) {
1074+ if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
10751075 return AVERROR(ENOMEM);
10761076 } else
10771077 avcodec_get_frame_defaults(ost->filtered_frame);
@@ -1536,7 +1536,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) · 458 unmodified lines
15361536 int i, ret, err = 0, resample_changed;
15371537 AVRational decoded_frame_tb;
15381538
1539− if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))
1539+ if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
15401540 return AVERROR(ENOMEM);
15411541 if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
15421542 return AVERROR(ENOMEM);
ffplay.c+1−1
@@ -2163,7 +2163,7 @@ static int audio_decode_frame(VideoState *is) · 2162 unmodified lines
21632163 /* NOTE: the audio packet can contain several frames */
21642164 while (pkt_temp->stream_index != -1 || is->audio_buf_frames_pending) {
21652165 if (!is->frame) {
2166− if (!(is->frame = avcodec_alloc_frame()))
2166+ if (!(is->frame = av_frame_alloc()))
21672167 return AVERROR(ENOMEM);
21682168 } else {
21692169 av_frame_unref(is->frame);
libavcodec/avuienc.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 static av_cold int avui_encode_init(AVCodecContext *avctx)
2727 {
28− avctx->coded_frame = avcodec_alloc_frame();
28+ avctx->coded_frame = av_frame_alloc();
2929
3030 if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) {
3131 av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n");
libavcodec/ffv1.c+1−1
@@ -49,7 +49,7 @@ av_cold int ffv1_common_init(AVCodecContext *avctx) · 48 unmodified lines
4949 s->avctx = avctx;
5050 s->flags = avctx->flags;
5151
52− s->picture.f = avcodec_alloc_frame();
52+ s->picture.f = av_frame_alloc();
5353 s->last_picture.f = av_frame_alloc();
5454 if (!s->picture.f || !s->last_picture.f)
5555 return AVERROR(ENOMEM);
libavcodec/libopenjpegenc.c+1−1
@@ -242,7 +242,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) · 241 unmodified lines
242242 goto fail;
243243 }
244244
245− avctx->coded_frame = avcodec_alloc_frame();
245+ avctx->coded_frame = av_frame_alloc();
246246 if (!avctx->coded_frame) {
247247 av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
248248 goto fail;
libavcodec/libtheoraenc.c+1−1
@@ -264,7 +264,7 @@ static av_cold int encode_init(AVCodecContext* avc_context) · 263 unmodified lines
264264 th_comment_clear(&t_comment);
265265
266266 /* Set up the output AVFrame */
267− avc_context->coded_frame= avcodec_alloc_frame();
267+ avc_context->coded_frame = av_frame_alloc();
268268
269269 return 0;
270270 }
libavcodec/libutvideodec.cpp+1−1
@@ -96,7 +96,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx) · 95 unmodified lines
9696 }
9797
9898 /* Allocate the output frame */
99− avctx->coded_frame = avcodec_alloc_frame();
99+ avctx->coded_frame = av_frame_alloc();
100100
101101 /* Ut Video only supports 8-bit */
102102 avctx->bits_per_raw_sample = 8;
libavcodec/libutvideoenc.cpp+1−1
@@ -74,7 +74,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) · 73 unmodified lines
7474 flags = ((avctx->prediction_method + 1) << 8) | (avctx->thread_count - 1);
7575
7676 avctx->priv_data = utv;
77− avctx->coded_frame = avcodec_alloc_frame();
77+ avctx->coded_frame = av_frame_alloc();
7878
7979 /* Alloc extradata buffer */
8080 info = (UtVideoExtra *)av_malloc(sizeof(*info));
libavcodec/libvpxenc.c+1−1
@@ -456,7 +456,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, · 455 unmodified lines
456456 vpx_img_wrap(&ctx->rawimg_alpha, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
457457 (unsigned char*)1);
458458
459− avctx->coded_frame = avcodec_alloc_frame();
459+ avctx->coded_frame = av_frame_alloc();
460460 if (!avctx->coded_frame) {
461461 av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
462462 vp8_free(avctx);
libavcodec/proresenc_anatoliy.c+1−1
@@ -581,7 +581,7 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) · 580 unmodified lines
581581 scale_mat(QMAT_CHROMA[avctx->profile], ctx->qmat_chroma[i - 1], i);
582582 }
583583
584− avctx->coded_frame = avcodec_alloc_frame();
584+ avctx->coded_frame = av_frame_alloc();
585585 avctx->coded_frame->key_frame = 1;
586586 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
587587
libavcodec/proresenc_kostya.c+1−1
@@ -1073,7 +1073,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1072 unmodified lines
10731073 int interlaced = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
10741074
10751075 avctx->bits_per_raw_sample = 10;
1076− avctx->coded_frame = avcodec_alloc_frame();
1076+ avctx->coded_frame = av_frame_alloc();
10771077 if (!avctx->coded_frame)
10781078 return AVERROR(ENOMEM);
10791079
libavcodec/r210enc.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626
2727 static av_cold int encode_init(AVCodecContext *avctx)
2828 {
29− avctx->coded_frame = avcodec_alloc_frame();
29+ avctx->coded_frame = av_frame_alloc();
3030
3131 if (!avctx->coded_frame)
3232 return AVERROR(ENOMEM);
libavcodec/svq1dec.c+1−1
@@ -742,7 +742,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) · 741 unmodified lines
742742 int i;
743743 int offset = 0;
744744
745− s->prev = avcodec_alloc_frame();
745+ s->prev = av_frame_alloc();
746746 if (!s->prev)
747747 return AVERROR(ENOMEM);
748748
libavcodec/utils.c+1−1
@@ -1559,7 +1559,7 @@ static int pad_last_frame(AVCodecContext *s, AVFrame **dst, const AVFrame *src) · 1558 unmodified lines
15591559 AVFrame *frame = NULL;
15601560 int ret;
15611561
1562− if (!(frame = avcodec_alloc_frame()))
1562+ if (!(frame = av_frame_alloc()))
15631563 return AVERROR(ENOMEM);
15641564
15651565 frame->format = src->format;
libavcodec/utvideoenc.c+1−1
@@ -126,7 +126,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) · 125 unmodified lines
126126 return AVERROR_OPTION_NOT_FOUND;
127127 }
128128
129− avctx->coded_frame = avcodec_alloc_frame();
129+ avctx->coded_frame = av_frame_alloc();
130130
131131 if (!avctx->coded_frame) {
132132 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
libavcodec/v210enc.c+1−1
@@ -36,7 +36,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 35 unmodified lines
3636 av_log(avctx, AV_LOG_WARNING, "bits per raw sample: %d != 10-bit\n",
3737 avctx->bits_per_raw_sample);
3838
39− avctx->coded_frame = avcodec_alloc_frame();
39+ avctx->coded_frame = av_frame_alloc();
4040 if (!avctx->coded_frame)
4141 return AVERROR(ENOMEM);
4242
libavcodec/v308enc.c+1−1
@@ -31,7 +31,7 @@ static av_cold int v308_encode_init(AVCodecContext *avctx) · 30 unmodified lines
3131 return AVERROR_INVALIDDATA;
3232 }
3333
34− avctx->coded_frame = avcodec_alloc_frame();
34+ avctx->coded_frame = av_frame_alloc();
3535
3636 if (!avctx->coded_frame) {
3737 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
libavcodec/v408enc.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626
2727 static av_cold int v408_encode_init(AVCodecContext *avctx)
2828 {
29− avctx->coded_frame = avcodec_alloc_frame();
29+ avctx->coded_frame = av_frame_alloc();
3030
3131 if (!avctx->coded_frame) {
3232 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
libavcodec/v410enc.c+1−1
@@ -32,7 +32,7 @@ static av_cold int v410_encode_init(AVCodecContext *avctx) · 31 unmodified lines
3232 return AVERROR_INVALIDDATA;
3333 }
3434
35− avctx->coded_frame = avcodec_alloc_frame();
35+ avctx->coded_frame = av_frame_alloc();
3636
3737 if (!avctx->coded_frame) {
3838 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
libavcodec/xfaceenc.c+1−1
@@ -125,7 +125,7 @@ static void encode_block(char *bitmap, int w, int h, int level, ProbRangesQueue · 124 unmodified lines
125125
126126 static av_cold int xface_encode_init(AVCodecContext *avctx)
127127 {
128− avctx->coded_frame = avcodec_alloc_frame();
128+ avctx->coded_frame = av_frame_alloc();
129129 if (!avctx->coded_frame)
130130 return AVERROR(ENOMEM);
131131 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
libavcodec/y41penc.c+1−1
@@ -30,7 +30,7 @@ static av_cold int y41p_encode_init(AVCodecContext *avctx) · 29 unmodified lines
3030 return AVERROR_INVALIDDATA;
3131 }
3232
33− avctx->coded_frame = avcodec_alloc_frame();
33+ avctx->coded_frame = av_frame_alloc();
3434 avctx->bits_per_coded_sample = 12;
3535
3636 if (!avctx->coded_frame) {
libavcodec/yuv4enc.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 static av_cold int yuv4_encode_init(AVCodecContext *avctx)
2727 {
28− avctx->coded_frame = avcodec_alloc_frame();
28+ avctx->coded_frame = av_frame_alloc();
2929
3030 if (!avctx->coded_frame) {
3131 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
libavfilter/lavfutils.c+1−1
@@ -57,7 +57,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4], · 56 unmodified lines
5757 goto end;
5858 }
5959
60− if (!(frame = avcodec_alloc_frame()) ) {
60+ if (!(frame = av_frame_alloc()) ) {
6161 av_log(log_ctx, AV_LOG_ERROR, "Failed to alloc frame\n");
6262 ret = AVERROR(ENOMEM);
6363 goto end;
libavfilter/libmpcodecs/vf_uspp.c+2−2
@@ -245,8 +245,8 @@ static int config(struct vf_instance *vf, · 244 unmodified lines
245245 av_dict_free(&opts);
246246 assert(avctx_enc->codec);
247247 }
248− vf->priv->frame= avcodec_alloc_frame();
249− vf->priv->frame_dec= avcodec_alloc_frame();
248+ vf->priv->frame= av_frame_alloc();
249+ vf->priv->frame_dec= av_frame_alloc();
250250
251251 vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10;
252252 vf->priv->outbuf= malloc(vf->priv->outbuf_size);
libavformat/utils.c+1−1
@@ -2448,7 +2448,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, A · 2447 unmodified lines
24482448 {
24492449 const AVCodec *codec;
24502450 int got_picture = 1, ret = 0;
2451− AVFrame *frame = avcodec_alloc_frame();
2451+ AVFrame *frame = av_frame_alloc();
24522452 AVSubtitle subtitle;
24532453 AVPacket pkt = *avpkt;
24542454

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t