Commit e16f217c authored by Stefano Sabatini's avatar Stefano Sabatini
Browse files

Use new imgutils.h API names, fix deprecation warnings.

Originally committed as revision 25058 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 9b7269e3
......@@ -32,7 +32,7 @@
#define LIBAVCODEC_VERSION_MAJOR 52
#define LIBAVCODEC_VERSION_MINOR 87
#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_MICRO 2
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
......
......@@ -972,7 +972,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->pic.data[0] = NULL;
if (av_check_image_size(avctx->width, avctx->height, 0, avctx) < 0) {
if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) {
return 1;
}
......
......@@ -269,7 +269,7 @@ int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
if (parse_source_parameters(avctx, gb, source))
return -1;
if (av_check_image_size(source->width, source->height, 0, avctx))
if (av_image_check_size(source->width, source->height, 0, avctx))
return -1;
avcodec_set_dimensions(avctx, source->width, source->height);
......
......@@ -306,7 +306,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
avctx->pix_fmt = PIX_FMT_YUV422P;
if (av_check_image_size(ctx->width, ctx->height, 0, avctx))
if (av_image_check_size(ctx->width, ctx->height, 0, avctx))
return -1;
avcodec_set_dimensions(avctx, ctx->width, ctx->height);
......
......@@ -140,7 +140,7 @@ static int decode_frame(AVCodecContext *avctx,
if (s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
if (av_check_image_size(w, h, 0, avctx))
if (av_image_check_size(w, h, 0, avctx))
return -1;
if (w != avctx->width || h != avctx->height)
avcodec_set_dimensions(avctx, w, h);
......
......@@ -157,7 +157,7 @@ static int cmv_decode_frame(AVCodecContext *avctx,
return buf_size;
}
if (av_check_image_size(s->width, s->height, 0, s->avctx))
if (av_image_check_size(s->width, s->height, 0, s->avctx))
return -1;
/* shuffle */
......
......@@ -261,7 +261,7 @@ static int decode_frame(AVCodecContext *avctx,
buf += 16;
if (avctx->width != s->width || avctx->height != s->height) {
if (av_check_image_size(s->width, s->height, 0, avctx) < 0)
if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
return -1;
avcodec_set_dimensions(avctx, s->width, s->height);
if (t->frame.data[0])
......
......@@ -276,7 +276,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
}
}
if (av_check_image_size(s->width, s->height, 0, avctx))
if (av_image_check_size(s->width, s->height, 0, avctx))
return -1;
/* shuffle */
......
......@@ -83,7 +83,7 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
width = height = 0;
break;
}
if(av_check_image_size(width, height, 0, s->avctx))
if(av_image_check_size(width, height, 0, s->avctx))
return -1;
s->width = width;
s->height = height;
......
......@@ -297,7 +297,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, A
return -1;
avctx->pix_fmt = PIX_FMT_PAL8;
if (av_check_image_size(s->screen_width, s->screen_height, 0, avctx))
if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx))
return -1;
avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);
......
......@@ -342,7 +342,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->mb_width = get_ue_golomb(&s->gb) + 1;
sps->mb_height= get_ue_golomb(&s->gb) + 1;
if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_MAX/16 ||
av_check_image_size(16*sps->mb_width, 16*sps->mb_height, 0, h->s.avctx)){
av_image_check_size(16*sps->mb_width, 16*sps->mb_height, 0, h->s.avctx)){
av_log(h->s.avctx, AV_LOG_ERROR, "mb_width/height overflow\n");
goto fail;
}
......
......@@ -161,7 +161,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
if ((err = av_check_image_size(avctx->width, avctx->height, 0, avctx)))
if ((err = av_image_check_size(avctx->width, avctx->height, 0, avctx)))
return err;
s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
......
......@@ -501,13 +501,13 @@ int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){
#if LIBAVCODEC_VERSION_MAJOR < 53
int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
{
return av_fill_image_linesizes(picture->linesize, pix_fmt, width);
return av_image_fill_linesizes(picture->linesize, pix_fmt, width);
}
int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
int height)
{
return av_fill_image_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
}
#endif
......@@ -515,13 +515,13 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr,
enum PixelFormat pix_fmt, int width, int height)
{
if(av_check_image_size(width, height, 0, NULL))
if(av_image_check_size(width, height, 0, NULL))
return -1;
if (av_fill_image_linesizes(picture->linesize, pix_fmt, width))
if (av_image_fill_linesizes(picture->linesize, pix_fmt, width))
return -1;
return av_fill_image_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
}
int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
......@@ -597,7 +597,7 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height)
{
AVPicture dummy_pict;
if(av_check_image_size(width, height, 0, NULL))
if(av_image_check_size(width, height, 0, NULL))
return -1;
switch (pix_fmt) {
case PIX_FMT_RGB8:
......@@ -797,7 +797,7 @@ void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
#if LIBAVCODEC_VERSION_MAJOR < 53
int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
{
return av_get_image_linesize(pix_fmt, width, plane);
return av_image_get_linesize(pix_fmt, width, plane);
}
#endif
......@@ -814,7 +814,7 @@ void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
case FF_PIXEL_PLANAR:
for(i = 0; i < pf->nb_channels; i++) {
int h;
int bwidth = av_get_image_linesize(pix_fmt, width, i);
int bwidth = av_image_get_linesize(pix_fmt, width, i);
h = height;
if (i == 1 || i == 2) {
h= -((-height)>>desc->log2_chroma_h);
......
......@@ -996,7 +996,7 @@ static int iv_decode_frame(AVCodecContext *avctx,
image_height = bytestream_get_le16(&buf_pos);
image_width = bytestream_get_le16(&buf_pos);
if(av_check_image_size(image_width, image_height, 0, avctx))
if(av_image_check_size(image_width, image_height, 0, avctx))
return -1;
if (image_width != avctx->width || image_height != avctx->height) {
int ret;
......
......@@ -51,7 +51,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
h = (buf[1] + 1) * 8;
buf += 2;
if (av_check_image_size(w, h, 0, avctx))
if (av_image_check_size(w, h, 0, avctx))
return -1;
if (w != avctx->width || h != avctx->height)
......
......@@ -106,7 +106,7 @@ static int libdirac_decode_frame(AVCodecContext *avccontext,
/* tell FFmpeg about sequence details */
dirac_sourceparams_t *src_params = &p_dirac_params->p_decoder->src_params;
if (av_check_image_size(src_params->width, src_params->height,
if (av_image_check_size(src_params->width, src_params->height,
0, avccontext) < 0) {
av_log(avccontext, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n",
src_params->width, src_params->height);
......
......@@ -114,7 +114,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
}
width = image->comps[0].w << avctx->lowres;
height = image->comps[0].h << avctx->lowres;
if(av_check_image_size(width, height, 0, avctx) < 0) {
if(av_image_check_size(width, height, 0, avctx) < 0) {
av_log(avctx, AV_LOG_ERROR, "%dx%d dimension invalid.\n", width, height);
goto done;
}
......
......@@ -170,7 +170,7 @@ static void libschroedinger_handle_first_access_unit(AVCodecContext *avccontext)
p_schro_params->format = schro_decoder_get_video_format(decoder);
/* Tell FFmpeg about sequence details. */
if (av_check_image_size(p_schro_params->format->width, p_schro_params->format->height,
if (av_image_check_size(p_schro_params->format->width, p_schro_params->format->height,
0, avccontext) < 0) {
av_log(avccontext, AV_LOG_ERROR, "invalid dimensions (%dx%d)\n",
p_schro_params->format->width, p_schro_params->format->height);
......
......@@ -87,7 +87,7 @@ static int vp8_decode(AVCodecContext *avctx,
if ((int) img->d_w != avctx->width || (int) img->d_h != avctx->height) {
av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n",
avctx->width, avctx->height, img->d_w, img->d_h);
if (av_check_image_size(img->d_w, img->d_h, 0, avctx))
if (av_image_check_size(img->d_w, img->d_h, 0, avctx))
return AVERROR_INVALIDDATA;
avcodec_set_dimensions(avctx, img->d_w, img->d_h);
}
......
......@@ -219,7 +219,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
height= s->height;
av_log(s->avctx, AV_LOG_DEBUG, "sof0: picture: %dx%d\n", width, height);
if(av_check_image_size(width, height, 0, s->avctx))
if(av_image_check_size(width, height, 0, s->avctx))
return -1;
nb_components = get_bits(&s->gb, 8);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment