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
156 }156 }
157 157
158 /* frame containing input raw audio */158 /* frame containing input raw audio */
159 frame = avcodec_alloc_frame();159 frame = av_frame_alloc();
160 if (!frame) {160 if (!frame) {
161 fprintf(stderr, "Could not allocate audio frame\n");161 fprintf(stderr, "Could not allocate audio frame\n");
162 exit(1);162 exit(1);
@@ -287,7 +287,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 124 unmodified lines
287 int got_frame = 0;287 int got_frame = 0;
288 288
289 if (!decoded_frame) {289 if (!decoded_frame) {
290 if (!(decoded_frame = avcodec_alloc_frame())) {290 if (!(decoded_frame = av_frame_alloc())) {
291 fprintf(stderr, "Could not allocate audio frame\n");291 fprintf(stderr, "Could not allocate audio frame\n");
292 exit(1);292 exit(1);
293 }293 }
@@ -386,7 +386,7 @@ static void video_encode_example(const char *filename, int codec_id) · 92 unmodified lines
386 exit(1);386 exit(1);
387 }387 }
388 388
389 frame = avcodec_alloc_frame();389 frame = av_frame_alloc();
390 if (!frame) {390 if (!frame) {
391 fprintf(stderr, "Could not allocate video frame\n");391 fprintf(stderr, "Could not allocate video frame\n");
392 exit(1);392 exit(1);
@@ -565,7 +565,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 172 unmodified lines
565 exit(1);565 exit(1);
566 }566 }
567 567
568 frame = avcodec_alloc_frame();568 frame = av_frame_alloc();
569 if (!frame) {569 if (!frame) {
570 fprintf(stderr, "Could not allocate video frame\n");570 fprintf(stderr, "Could not allocate video frame\n");
571 exit(1);571 exit(1);
doc/examples/muxing.c+2−2
@@ -221,7 +221,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) · 220 unmodified lines
221{221{
222 AVCodecContext *c;222 AVCodecContext *c;
223 AVPacket pkt = { 0 }; // data and size must be 0;223 AVPacket pkt = { 0 }; // data and size must be 0;
224 AVFrame *frame = avcodec_alloc_frame();224 AVFrame *frame = av_frame_alloc();
225 int got_packet, ret, dst_nb_samples;225 int got_packet, ret, dst_nb_samples;
226 226
227 av_init_packet(&pkt);227 av_init_packet(&pkt);
@@ -310,7 +310,7 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st) · 82 unmodified lines
310 }310 }
311 311
312 /* allocate and init a re-usable frame */312 /* allocate and init a re-usable frame */
313 frame = avcodec_alloc_frame();313 frame = av_frame_alloc();
314 if (!frame) {314 if (!frame) {
315 fprintf(stderr, "Could not allocate video frame\n");315 fprintf(stderr, "Could not allocate video frame\n");
316 exit(1);316 exit(1);
ffmpeg.c+2−2
@@ -1071,7 +1071,7 @@ static int reap_filters(void) · 1070 unmodified lines
1071 if (!ost->filter)1071 if (!ost->filter)
1072 continue;1072 continue;
1073 1073
1074 if (!ost->filtered_frame && !(ost->filtered_frame = avcodec_alloc_frame())) {1074 if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
1075 return AVERROR(ENOMEM);1075 return AVERROR(ENOMEM);
1076 } else1076 } else
1077 avcodec_get_frame_defaults(ost->filtered_frame);1077 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
1536 int i, ret, err = 0, resample_changed;1536 int i, ret, err = 0, resample_changed;
1537 AVRational decoded_frame_tb;1537 AVRational decoded_frame_tb;
1538 1538
1539 if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))1539 if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
1540 return AVERROR(ENOMEM);1540 return AVERROR(ENOMEM);
1541 if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))1541 if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
1542 return AVERROR(ENOMEM);1542 return AVERROR(ENOMEM);
ffplay.c+1−1
@@ -2163,7 +2163,7 @@ static int audio_decode_frame(VideoState *is) · 2162 unmodified lines
2163 /* NOTE: the audio packet can contain several frames */2163 /* NOTE: the audio packet can contain several frames */
2164 while (pkt_temp->stream_index != -1 || is->audio_buf_frames_pending) {2164 while (pkt_temp->stream_index != -1 || is->audio_buf_frames_pending) {
2165 if (!is->frame) {2165 if (!is->frame) {
2166 if (!(is->frame = avcodec_alloc_frame()))2166 if (!(is->frame = av_frame_alloc()))
2167 return AVERROR(ENOMEM);2167 return AVERROR(ENOMEM);
2168 } else {2168 } else {
2169 av_frame_unref(is->frame);2169 av_frame_unref(is->frame);
libavcodec/avuienc.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25 25
26static av_cold int avui_encode_init(AVCodecContext *avctx)26static av_cold int avui_encode_init(AVCodecContext *avctx)
27{27{
28 avctx->coded_frame = avcodec_alloc_frame();28 avctx->coded_frame = av_frame_alloc();
29 29
30 if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) {30 if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) {
31 av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n");31 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
49 s->avctx = avctx;49 s->avctx = avctx;
50 s->flags = avctx->flags;50 s->flags = avctx->flags;
51 51
52 s->picture.f = avcodec_alloc_frame();52 s->picture.f = av_frame_alloc();
53 s->last_picture.f = av_frame_alloc();53 s->last_picture.f = av_frame_alloc();
54 if (!s->picture.f || !s->last_picture.f)54 if (!s->picture.f || !s->last_picture.f)
55 return AVERROR(ENOMEM);55 return AVERROR(ENOMEM);
libavcodec/libopenjpegenc.c+1−1
@@ -242,7 +242,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) · 241 unmodified lines
242 goto fail;242 goto fail;
243 }243 }
244 244
245 avctx->coded_frame = avcodec_alloc_frame();245 avctx->coded_frame = av_frame_alloc();
246 if (!avctx->coded_frame) {246 if (!avctx->coded_frame) {
247 av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");247 av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
248 goto fail;248 goto fail;
libavcodec/libtheoraenc.c+1−1
@@ -264,7 +264,7 @@ static av_cold int encode_init(AVCodecContext* avc_context) · 263 unmodified lines
264 th_comment_clear(&t_comment);264 th_comment_clear(&t_comment);
265 265
266 /* Set up the output AVFrame */266 /* Set up the output AVFrame */
267 avc_context->coded_frame= avcodec_alloc_frame();267 avc_context->coded_frame = av_frame_alloc();
268 268
269 return 0;269 return 0;
270}270}
libavcodec/libutvideodec.cpp+1−1
@@ -96,7 +96,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx) · 95 unmodified lines
96 }96 }
97 97
98 /* Allocate the output frame */98 /* Allocate the output frame */
99 avctx->coded_frame = avcodec_alloc_frame();99 avctx->coded_frame = av_frame_alloc();
100 100
101 /* Ut Video only supports 8-bit */101 /* Ut Video only supports 8-bit */
102 avctx->bits_per_raw_sample = 8;102 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
74 flags = ((avctx->prediction_method + 1) << 8) | (avctx->thread_count - 1);74 flags = ((avctx->prediction_method + 1) << 8) | (avctx->thread_count - 1);
75 75
76 avctx->priv_data = utv;76 avctx->priv_data = utv;
77 avctx->coded_frame = avcodec_alloc_frame();77 avctx->coded_frame = av_frame_alloc();
78 78
79 /* Alloc extradata buffer */79 /* Alloc extradata buffer */
80 info = (UtVideoExtra *)av_malloc(sizeof(*info));80 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
456 vpx_img_wrap(&ctx->rawimg_alpha, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,456 vpx_img_wrap(&ctx->rawimg_alpha, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
457 (unsigned char*)1);457 (unsigned char*)1);
458 458
459 avctx->coded_frame = avcodec_alloc_frame();459 avctx->coded_frame = av_frame_alloc();
460 if (!avctx->coded_frame) {460 if (!avctx->coded_frame) {
461 av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");461 av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
462 vp8_free(avctx);462 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
581 scale_mat(QMAT_CHROMA[avctx->profile], ctx->qmat_chroma[i - 1], i);581 scale_mat(QMAT_CHROMA[avctx->profile], ctx->qmat_chroma[i - 1], i);
582 }582 }
583 583
584 avctx->coded_frame = avcodec_alloc_frame();584 avctx->coded_frame = av_frame_alloc();
585 avctx->coded_frame->key_frame = 1;585 avctx->coded_frame->key_frame = 1;
586 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;586 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
587 587
libavcodec/proresenc_kostya.c+1−1
@@ -1073,7 +1073,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1072 unmodified lines
1073 int interlaced = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);1073 int interlaced = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
1074 1074
1075 avctx->bits_per_raw_sample = 10;1075 avctx->bits_per_raw_sample = 10;
1076 avctx->coded_frame = avcodec_alloc_frame();1076 avctx->coded_frame = av_frame_alloc();
1077 if (!avctx->coded_frame)1077 if (!avctx->coded_frame)
1078 return AVERROR(ENOMEM);1078 return AVERROR(ENOMEM);
1079 1079
libavcodec/r210enc.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27static av_cold int encode_init(AVCodecContext *avctx)27static av_cold int encode_init(AVCodecContext *avctx)
28{28{
29 avctx->coded_frame = avcodec_alloc_frame();29 avctx->coded_frame = av_frame_alloc();
30 30
31 if (!avctx->coded_frame)31 if (!avctx->coded_frame)
32 return AVERROR(ENOMEM);32 return AVERROR(ENOMEM);
libavcodec/svq1dec.c+1−1
@@ -742,7 +742,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) · 741 unmodified lines
742 int i;742 int i;
743 int offset = 0;743 int offset = 0;
744 744
745 s->prev = avcodec_alloc_frame();745 s->prev = av_frame_alloc();
746 if (!s->prev)746 if (!s->prev)
747 return AVERROR(ENOMEM);747 return AVERROR(ENOMEM);
748 748
libavcodec/utils.c+1−1
@@ -1559,7 +1559,7 @@ static int pad_last_frame(AVCodecContext *s, AVFrame **dst, const AVFrame *src) · 1558 unmodified lines
1559 AVFrame *frame = NULL;1559 AVFrame *frame = NULL;
1560 int ret;1560 int ret;
1561 1561
1562 if (!(frame = avcodec_alloc_frame()))1562 if (!(frame = av_frame_alloc()))
1563 return AVERROR(ENOMEM);1563 return AVERROR(ENOMEM);
1564 1564
1565 frame->format = src->format;1565 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
126 return AVERROR_OPTION_NOT_FOUND;126 return AVERROR_OPTION_NOT_FOUND;
127 }127 }
128 128
129 avctx->coded_frame = avcodec_alloc_frame();129 avctx->coded_frame = av_frame_alloc();
130 130
131 if (!avctx->coded_frame) {131 if (!avctx->coded_frame) {
132 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");132 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
36 av_log(avctx, AV_LOG_WARNING, "bits per raw sample: %d != 10-bit\n",36 av_log(avctx, AV_LOG_WARNING, "bits per raw sample: %d != 10-bit\n",
37 avctx->bits_per_raw_sample);37 avctx->bits_per_raw_sample);
38 38
39 avctx->coded_frame = avcodec_alloc_frame();39 avctx->coded_frame = av_frame_alloc();
40 if (!avctx->coded_frame)40 if (!avctx->coded_frame)
41 return AVERROR(ENOMEM);41 return AVERROR(ENOMEM);
42 42
libavcodec/v308enc.c+1−1
@@ -31,7 +31,7 @@ static av_cold int v308_encode_init(AVCodecContext *avctx) · 30 unmodified lines
31 return AVERROR_INVALIDDATA;31 return AVERROR_INVALIDDATA;
32 }32 }
33 33
34 avctx->coded_frame = avcodec_alloc_frame();34 avctx->coded_frame = av_frame_alloc();
35 35
36 if (!avctx->coded_frame) {36 if (!avctx->coded_frame) {
37 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");37 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
libavcodec/v408enc.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27static av_cold int v408_encode_init(AVCodecContext *avctx)27static av_cold int v408_encode_init(AVCodecContext *avctx)
28{28{
29 avctx->coded_frame = avcodec_alloc_frame();29 avctx->coded_frame = av_frame_alloc();
30 30
31 if (!avctx->coded_frame) {31 if (!avctx->coded_frame) {
32 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");32 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
32 return AVERROR_INVALIDDATA;32 return AVERROR_INVALIDDATA;
33 }33 }
34 34
35 avctx->coded_frame = avcodec_alloc_frame();35 avctx->coded_frame = av_frame_alloc();
36 36
37 if (!avctx->coded_frame) {37 if (!avctx->coded_frame) {
38 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");38 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
125 125
126static av_cold int xface_encode_init(AVCodecContext *avctx)126static av_cold int xface_encode_init(AVCodecContext *avctx)
127{127{
128 avctx->coded_frame = avcodec_alloc_frame();128 avctx->coded_frame = av_frame_alloc();
129 if (!avctx->coded_frame)129 if (!avctx->coded_frame)
130 return AVERROR(ENOMEM);130 return AVERROR(ENOMEM);
131 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;131 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
30 return AVERROR_INVALIDDATA;30 return AVERROR_INVALIDDATA;
31 }31 }
32 32
33 avctx->coded_frame = avcodec_alloc_frame();33 avctx->coded_frame = av_frame_alloc();
34 avctx->bits_per_coded_sample = 12;34 avctx->bits_per_coded_sample = 12;
35 35
36 if (!avctx->coded_frame) {36 if (!avctx->coded_frame) {
libavcodec/yuv4enc.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25 25
26static av_cold int yuv4_encode_init(AVCodecContext *avctx)26static av_cold int yuv4_encode_init(AVCodecContext *avctx)
27{27{
28 avctx->coded_frame = avcodec_alloc_frame();28 avctx->coded_frame = av_frame_alloc();
29 29
30 if (!avctx->coded_frame) {30 if (!avctx->coded_frame) {
31 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");31 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
57 goto end;57 goto end;
58 }58 }
59 59
60 if (!(frame = avcodec_alloc_frame()) ) {60 if (!(frame = av_frame_alloc()) ) {
61 av_log(log_ctx, AV_LOG_ERROR, "Failed to alloc frame\n");61 av_log(log_ctx, AV_LOG_ERROR, "Failed to alloc frame\n");
62 ret = AVERROR(ENOMEM);62 ret = AVERROR(ENOMEM);
63 goto end;63 goto end;
libavfilter/libmpcodecs/vf_uspp.c+2−2
@@ -245,8 +245,8 @@ static int config(struct vf_instance *vf, · 244 unmodified lines
245 av_dict_free(&opts);245 av_dict_free(&opts);
246 assert(avctx_enc->codec);246 assert(avctx_enc->codec);
247 }247 }
248 vf->priv->frame= avcodec_alloc_frame();248 vf->priv->frame= av_frame_alloc();
249 vf->priv->frame_dec= avcodec_alloc_frame();249 vf->priv->frame_dec= av_frame_alloc();
250 250
251 vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10;251 vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10;
252 vf->priv->outbuf= malloc(vf->priv->outbuf_size);252 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
2448{2448{
2449 const AVCodec *codec;2449 const AVCodec *codec;
2450 int got_picture = 1, ret = 0;2450 int got_picture = 1, ret = 0;
2451 AVFrame *frame = avcodec_alloc_frame();2451 AVFrame *frame = av_frame_alloc();
2452 AVSubtitle subtitle;2452 AVSubtitle subtitle;
2453 AVPacket pkt = *avpkt;2453 AVPacket pkt = *avpkt;
2454 2454

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