Merge commit 'f7edcac040f73635fc1127489c9bb29ca8b43532'
authorHendrik Leppkes <h.leppkes@gmail.com>
Tue, 8 Dec 2015 09:03:08 +0000 (10:03 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Tue, 8 Dec 2015 09:03:08 +0000 (10:03 +0100)
* commit 'f7edcac040f73635fc1127489c9bb29ca8b43532':
  avpicture: Suppress warning from deprecated code

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavcodec/avpicture.c
libavcodec/imgconvert.c

@@@ -32,7 -33,8 +33,8 @@@
  #include "libavutil/colorspace.h"
  
  #if FF_API_AVPICTURE
 -int avpicture_fill(AVPicture *picture, uint8_t *ptr,
+ FF_DISABLE_DEPRECATION_WARNINGS
 +int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
                     enum AVPixelFormat pix_fmt, int width, int height)
  {
      return av_image_fill_arrays(picture->data, picture->linesize,
@@@ -73,7 -76,8 +75,8 @@@ void avpicture_free(AVPicture *picture
  void av_picture_copy(AVPicture *dst, const AVPicture *src,
                       enum AVPixelFormat pix_fmt, int width, int height)
  {
 -    av_image_copy(dst->data, dst->linesize, src->data,
 +    av_image_copy(dst->data, dst->linesize, (const uint8_t **)src->data,
                    src->linesize, pix_fmt, width, height);
  }
+ FF_ENABLE_DEPRECATION_WARNINGS
  #endif /* FF_API_AVPICTURE */
@@@ -321,31 -340,5 +324,32 @@@ int av_picture_pad(AVPicture *dst, cons
      return 0;
  }
  
 +#ifdef TEST
 +
 +int main(void){
 +    int i;
 +    int err=0;
 +    int skip = 0;
 +
 +    for (i=0; i<AV_PIX_FMT_NB*2; i++) {
 +        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
 +        if(!desc || !desc->name) {
 +            skip ++;
 +            continue;
 +        }
 +        if (skip) {
 +            av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
 +            skip = 0;
 +        }
 +        av_log(NULL, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc));
 +        if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
 +            av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
 +            err = 1;
 +        }
 +    }
 +    return err;
 +}
 +
 +#endif
+ FF_DISABLE_DEPRECATION_WARNINGS
  #endif /* FF_API_AVPICTURE */