Mercurial > libavcodec.hg
comparison utils.c @ 12462:ffb3668ff7af libavcodec
Use new imgutils.h API names, fix deprecation warnings.
| author | stefano |
|---|---|
| date | Tue, 07 Sep 2010 19:15:29 +0000 |
| parents | 914f484bb476 |
| children | d821f7c64fc9 |
comparison
equal
deleted
inserted
replaced
| 12461:25174028da0a | 12462:ffb3668ff7af |
|---|---|
| 213 *width=FFALIGN(*width, align); | 213 *width=FFALIGN(*width, align); |
| 214 } | 214 } |
| 215 | 215 |
| 216 #if LIBAVCODEC_VERSION_MAJOR < 53 | 216 #if LIBAVCODEC_VERSION_MAJOR < 53 |
| 217 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){ | 217 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){ |
| 218 return av_check_image_size(w, h, 0, av_log_ctx); | 218 return av_image_check_size(w, h, 0, av_log_ctx); |
| 219 } | 219 } |
| 220 #endif | 220 #endif |
| 221 | 221 |
| 222 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ | 222 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ |
| 223 int i; | 223 int i; |
| 233 if(s->internal_buffer_count >= INTERNAL_BUFFER_SIZE) { | 233 if(s->internal_buffer_count >= INTERNAL_BUFFER_SIZE) { |
| 234 av_log(s, AV_LOG_ERROR, "internal_buffer_count overflow (missing release_buffer?)\n"); | 234 av_log(s, AV_LOG_ERROR, "internal_buffer_count overflow (missing release_buffer?)\n"); |
| 235 return -1; | 235 return -1; |
| 236 } | 236 } |
| 237 | 237 |
| 238 if(av_check_image_size(w, h, 0, s)) | 238 if(av_image_check_size(w, h, 0, s)) |
| 239 return -1; | 239 return -1; |
| 240 | 240 |
| 241 if(s->internal_buffer==NULL){ | 241 if(s->internal_buffer==NULL){ |
| 242 s->internal_buffer= av_mallocz((INTERNAL_BUFFER_SIZE+1)*sizeof(InternalBuffer)); | 242 s->internal_buffer= av_mallocz((INTERNAL_BUFFER_SIZE+1)*sizeof(InternalBuffer)); |
| 243 } | 243 } |
| 485 else if(avctx->width && avctx->height) | 485 else if(avctx->width && avctx->height) |
| 486 avcodec_set_dimensions(avctx, avctx->width, avctx->height); | 486 avcodec_set_dimensions(avctx, avctx->width, avctx->height); |
| 487 | 487 |
| 488 #define SANE_NB_CHANNELS 128U | 488 #define SANE_NB_CHANNELS 128U |
| 489 if (((avctx->coded_width || avctx->coded_height) | 489 if (((avctx->coded_width || avctx->coded_height) |
| 490 && av_check_image_size(avctx->coded_width, avctx->coded_height, 0, avctx)) | 490 && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx)) |
| 491 || avctx->channels > SANE_NB_CHANNELS) { | 491 || avctx->channels > SANE_NB_CHANNELS) { |
| 492 ret = AVERROR(EINVAL); | 492 ret = AVERROR(EINVAL); |
| 493 goto free_and_end; | 493 goto free_and_end; |
| 494 } | 494 } |
| 495 | 495 |
| 552 { | 552 { |
| 553 if(buf_size < FF_MIN_BUFFER_SIZE){ | 553 if(buf_size < FF_MIN_BUFFER_SIZE){ |
| 554 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n"); | 554 av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n"); |
| 555 return -1; | 555 return -1; |
| 556 } | 556 } |
| 557 if(av_check_image_size(avctx->width, avctx->height, 0, avctx)) | 557 if(av_image_check_size(avctx->width, avctx->height, 0, avctx)) |
| 558 return -1; | 558 return -1; |
| 559 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){ | 559 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){ |
| 560 int ret = avctx->codec->encode(avctx, buf, buf_size, pict); | 560 int ret = avctx->codec->encode(avctx, buf, buf_size, pict); |
| 561 avctx->frame_number++; | 561 avctx->frame_number++; |
| 562 emms_c(); //needed to avoid an emms_c() call before every return; | 562 emms_c(); //needed to avoid an emms_c() call before every return; |
| 602 AVPacket *avpkt) | 602 AVPacket *avpkt) |
| 603 { | 603 { |
| 604 int ret; | 604 int ret; |
| 605 | 605 |
| 606 *got_picture_ptr= 0; | 606 *got_picture_ptr= 0; |
| 607 if((avctx->coded_width||avctx->coded_height) && av_check_image_size(avctx->coded_width, avctx->coded_height, 0, avctx)) | 607 if((avctx->coded_width||avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx)) |
| 608 return -1; | 608 return -1; |
| 609 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){ | 609 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){ |
| 610 ret = avctx->codec->decode(avctx, picture, got_picture_ptr, | 610 ret = avctx->codec->decode(avctx, picture, got_picture_ptr, |
| 611 avpkt); | 611 avpkt); |
| 612 | 612 |
