Browse Source

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

Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
0ee905e243
27 changed files with 33 additions and 33 deletions
  1. +4
    -4
      doc/examples/decoding_encoding.c
  2. +2
    -2
      doc/examples/muxing.c
  3. +2
    -2
      ffmpeg.c
  4. +1
    -1
      ffplay.c
  5. +1
    -1
      libavcodec/avuienc.c
  6. +1
    -1
      libavcodec/ffv1.c
  7. +1
    -1
      libavcodec/libopenjpegenc.c
  8. +1
    -1
      libavcodec/libtheoraenc.c
  9. +1
    -1
      libavcodec/libutvideodec.cpp
  10. +1
    -1
      libavcodec/libutvideoenc.cpp
  11. +1
    -1
      libavcodec/libvpxenc.c
  12. +1
    -1
      libavcodec/proresenc_anatoliy.c
  13. +1
    -1
      libavcodec/proresenc_kostya.c
  14. +1
    -1
      libavcodec/r210enc.c
  15. +1
    -1
      libavcodec/svq1dec.c
  16. +1
    -1
      libavcodec/utils.c
  17. +1
    -1
      libavcodec/utvideoenc.c
  18. +1
    -1
      libavcodec/v210enc.c
  19. +1
    -1
      libavcodec/v308enc.c
  20. +1
    -1
      libavcodec/v408enc.c
  21. +1
    -1
      libavcodec/v410enc.c
  22. +1
    -1
      libavcodec/xfaceenc.c
  23. +1
    -1
      libavcodec/y41penc.c
  24. +1
    -1
      libavcodec/yuv4enc.c
  25. +1
    -1
      libavfilter/lavfutils.c
  26. +2
    -2
      libavfilter/libmpcodecs/vf_uspp.c
  27. +1
    -1
      libavformat/utils.c

+ 4
- 4
doc/examples/decoding_encoding.c View File

@@ -156,7 +156,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);
@@ -287,7 +287,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, "Could not allocate audio frame\n");
exit(1);
}
@@ -386,7 +386,7 @@ static void video_encode_example(const char *filename, int codec_id)
exit(1);
}

frame = avcodec_alloc_frame();
frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate video frame\n");
exit(1);
@@ -565,7 +565,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
exit(1);
}

frame = avcodec_alloc_frame();
frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate video frame\n");
exit(1);


+ 2
- 2
doc/examples/muxing.c View File

@@ -221,7 +221,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, ret, dst_nb_samples;

av_init_packet(&pkt);
@@ -310,7 +310,7 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st)
}

/* allocate and init a re-usable frame */
frame = avcodec_alloc_frame();
frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate video frame\n");
exit(1);


+ 2
- 2
ffmpeg.c View File

@@ -1071,7 +1071,7 @@ static int reap_filters(void)
if (!ost->filter)
continue;

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);
@@ -1536,7 +1536,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
int i, ret, err = 0, resample_changed;
AVRational decoded_frame_tb;

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);


+ 1
- 1
ffplay.c View File

@@ -2163,7 +2163,7 @@ static int audio_decode_frame(VideoState *is)
/* NOTE: the audio packet can contain several frames */
while (pkt_temp->stream_index != -1 || is->audio_buf_frames_pending) {
if (!is->frame) {
if (!(is->frame = avcodec_alloc_frame()))
if (!(is->frame = av_frame_alloc()))
return AVERROR(ENOMEM);
} else {
av_frame_unref(is->frame);


+ 1
- 1
libavcodec/avuienc.c View File

@@ -25,7 +25,7 @@

static av_cold int avui_encode_init(AVCodecContext *avctx)
{
avctx->coded_frame = avcodec_alloc_frame();
avctx->coded_frame = av_frame_alloc();

if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) {
av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n");


+ 1
- 1
libavcodec/ffv1.c View File

@@ -49,7 +49,7 @@ av_cold int ffv1_common_init(AVCodecContext *avctx)
s->avctx = avctx;
s->flags = avctx->flags;

s->picture.f = avcodec_alloc_frame();
s->picture.f = av_frame_alloc();
s->last_picture.f = av_frame_alloc();
if (!s->picture.f || !s->last_picture.f)
return AVERROR(ENOMEM);


+ 1
- 1
libavcodec/libopenjpegenc.c View File

@@ -242,7 +242,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
goto fail;
}

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;


+ 1
- 1
libavcodec/libtheoraenc.c View File

@@ -264,7 +264,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;
}


+ 1
- 1
libavcodec/libutvideodec.cpp View File

@@ -96,7 +96,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
}

/* Allocate the output frame */
avctx->coded_frame = avcodec_alloc_frame();
avctx->coded_frame = av_frame_alloc();

/* Ut Video only supports 8-bit */
avctx->bits_per_raw_sample = 8;


+ 1
- 1
libavcodec/libutvideoenc.cpp View File

@@ -74,7 +74,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
flags = ((avctx->prediction_method + 1) << 8) | (avctx->thread_count - 1);

avctx->priv_data = utv;
avctx->coded_frame = avcodec_alloc_frame();
avctx->coded_frame = av_frame_alloc();

/* Alloc extradata buffer */
info = (UtVideoExtra *)av_malloc(sizeof(*info));


+ 1
- 1
libavcodec/libvpxenc.c View File

@@ -456,7 +456,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
vpx_img_wrap(&ctx->rawimg_alpha, 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);


+ 1
- 1
libavcodec/proresenc_anatoliy.c View File

@@ -581,7 +581,7 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
scale_mat(QMAT_CHROMA[avctx->profile], ctx->qmat_chroma[i - 1], i);
}

avctx->coded_frame = avcodec_alloc_frame();
avctx->coded_frame = av_frame_alloc();
avctx->coded_frame->key_frame = 1;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;



+ 1
- 1
libavcodec/proresenc_kostya.c View File

@@ -1073,7 +1073,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);



+ 1
- 1
libavcodec/r210enc.c View File

@@ -26,7 +26,7 @@

static av_cold int encode_init(AVCodecContext *avctx)
{
avctx->coded_frame = avcodec_alloc_frame();
avctx->coded_frame = av_frame_alloc();

if (!avctx->coded_frame)
return AVERROR(ENOMEM);


+ 1
- 1
libavcodec/svq1dec.c View 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);



+ 1
- 1
libavcodec/utils.c View File

@@ -1559,7 +1559,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;


+ 1
- 1
libavcodec/utvideoenc.c View 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");


+ 1
- 1
libavcodec/v210enc.c View 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);



+ 1
- 1
libavcodec/v308enc.c View File

@@ -31,7 +31,7 @@ static av_cold int v308_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");


+ 1
- 1
libavcodec/v408enc.c View File

@@ -26,7 +26,7 @@

static av_cold int v408_encode_init(AVCodecContext *avctx)
{
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");


+ 1
- 1
libavcodec/v410enc.c View 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");


+ 1
- 1
libavcodec/xfaceenc.c View File

@@ -125,7 +125,7 @@ static void encode_block(char *bitmap, int w, int h, int level, ProbRangesQueue

static av_cold int xface_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;


+ 1
- 1
libavcodec/y41penc.c View File

@@ -30,7 +30,7 @@ static av_cold int y41p_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}

avctx->coded_frame = avcodec_alloc_frame();
avctx->coded_frame = av_frame_alloc();
avctx->bits_per_coded_sample = 12;

if (!avctx->coded_frame) {


+ 1
- 1
libavcodec/yuv4enc.c View File

@@ -25,7 +25,7 @@

static av_cold int yuv4_encode_init(AVCodecContext *avctx)
{
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");


+ 1
- 1
libavfilter/lavfutils.c View File

@@ -57,7 +57,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
goto end;
}

if (!(frame = avcodec_alloc_frame()) ) {
if (!(frame = av_frame_alloc()) ) {
av_log(log_ctx, AV_LOG_ERROR, "Failed to alloc frame\n");
ret = AVERROR(ENOMEM);
goto end;


+ 2
- 2
libavfilter/libmpcodecs/vf_uspp.c View File

@@ -245,8 +245,8 @@ static int config(struct vf_instance *vf,
av_dict_free(&opts);
assert(avctx_enc->codec);
}
vf->priv->frame= avcodec_alloc_frame();
vf->priv->frame_dec= avcodec_alloc_frame();
vf->priv->frame= av_frame_alloc();
vf->priv->frame_dec= av_frame_alloc();

vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10;
vf->priv->outbuf= malloc(vf->priv->outbuf_size);


+ 1
- 1
libavformat/utils.c View File

@@ -2448,7 +2448,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, A
{
const AVCodec *codec;
int got_picture = 1, ret = 0;
AVFrame *frame = avcodec_alloc_frame();
AVFrame *frame = av_frame_alloc();
AVSubtitle subtitle;
AVPacket pkt = *avpkt;



Loading…
Cancel
Save