[SCM] gmerlin-avdecoder/master: Fix FTBFS with ffmpeg-2.9

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Tue Nov 3 12:25:31 UTC 2015


The following commit has been merged in the master branch:
commit b00a006212222a9a0c99ad1841aadb1f8d6b73b3
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date:   Tue Nov 3 12:27:11 2015 +0100

    Fix FTBFS with ffmpeg-2.9
    
    Closes: #803817
    Thanks: Andreas Cadhalpun

diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 0000000..f92abc0
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,258 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Last-Update: <2015-11-02>
+
+--- gmerlin-avdecoder-1.2.0~dfsg.orig/lib/video_ffmpeg.c
++++ gmerlin-avdecoder-1.2.0~dfsg/lib/video_ffmpeg.c
+@@ -117,7 +117,7 @@ typedef struct
+     
+   /* Pixelformat */
+   int do_convert;
+-  enum PixelFormat dst_format;
++  enum AVPixelFormat dst_format;
+ 
+   /* Real video ugliness */
+ 
+@@ -181,16 +181,15 @@ typedef struct
+   
+ #endif
+ 
+-  int b_age;
+-  int ip_age[2];
+-
+   bgav_packet_t * p;
+   
+   } ffmpeg_video_priv;
+ 
+ 
+ #ifdef HAVE_VDPAU
+-static int vdpau_get_buffer(struct AVCodecContext *c, AVFrame *pic)
++static void vdpau_dummy_free_buffer(void *opaque, uint8_t *data);
++
++static int vdpau_get_buffer(struct AVCodecContext *c, AVFrame *pic, int flags)
+   {
+   ffmpeg_video_priv * priv;
+   int i = 0;
+@@ -202,8 +201,8 @@ static int vdpau_get_buffer(struct AVCod
+     {
+     if(!priv->vdpau_states[i].used)
+       {
+-      pic->data[0] = (uint8_t*)(&priv->vdpau_states[i]);
+-      pic->type = FF_BUFFER_TYPE_USER;
++      pic->buf[0] = av_buffer_create((uint8_t*)(&priv->vdpau_states[i]), 0, vdpau_dummy_free_buffer, NULL, 0);
++      pic->data[0] = pic->buf[0]->data;
+       
+       //      pic->age = INT_MAX;
+       
+@@ -219,24 +218,6 @@ static int vdpau_get_buffer(struct AVCod
+           //                  priv->vdpau_states[i].state.surface);
+           }
+         }
+-      if(pic->reference)
+-        {
+-#if LIBAVCODEC_VERSION_INT < ((53<<16)|(28<<8)|1)
+-        pic->age= priv->ip_age[0];
+-#endif
+-        priv->ip_age[0]= priv->ip_age[1]+1;
+-        priv->ip_age[1]= 1;
+-        priv->b_age++;
+-        }
+-      else
+-        {
+-#if LIBAVCODEC_VERSION_INT < ((53<<16)|(28<<8)|1)
+-        pic->age= priv->b_age;
+-#endif
+-        priv->ip_age[0]++;
+-        priv->ip_age[1]++;
+-        priv->b_age=1;
+-        }
+       priv->vdpau_states[i].used = 1;
+       return 0;
+       }
+@@ -245,10 +226,9 @@ static int vdpau_get_buffer(struct AVCod
+   return -1;
+   }
+ 
+-static void vdpau_release_buffer(struct AVCodecContext *avctx, AVFrame *pic)
++static void vdpau_dummy_free_buffer(void *opaque, uint8_t *data)
+   {
+-  vdpau_state_t * state = (vdpau_state_t *)pic->data[0];
+-  pic->data[0] = NULL;
++  vdpau_state_t * state = (vdpau_state_t *)data;
+   state->used = 0;
+   }
+ 
+@@ -273,7 +253,7 @@ static void vdpau_draw_horiz_band(struct
+                                     state->bitstream_buffers);
+   }
+ 
+-static enum PixelFormat vdpau_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt)
++static enum AVPixelFormat vdpau_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
+   {
+   return *fmt;
+   }
+@@ -785,8 +765,7 @@ static int init_vdpau(bgav_stream_t * s,
+   if(priv->vdpau_decoder == VDP_INVALID_HANDLE)
+     goto fail;
+   
+-  priv->ctx->get_buffer      = vdpau_get_buffer;
+-  priv->ctx->release_buffer      = vdpau_release_buffer;
++  priv->ctx->get_buffer2      = vdpau_get_buffer;
+   priv->ctx->draw_horiz_band = vdpau_draw_horiz_band;
+   priv->ctx->get_format      = vdpau_get_format;
+   
+@@ -822,10 +801,6 @@ static int init_ffmpeg(bgav_stream_t * s
+   priv = calloc(1, sizeof(*priv));
+   priv->skip_time = BGAV_TIMESTAMP_UNDEFINED;
+ 
+-  priv->ip_age[0] = 256*256*256*64;
+-  priv->ip_age[1] = 256*256*256*64;
+-  priv->b_age = 256*256*256*64;
+-  
+   s->data.video.decoder->priv = priv;
+   
+   /* Set up coded specific details */
+@@ -934,7 +909,7 @@ static int init_ffmpeg(bgav_stream_t * s
+   
+   //  bgav_hexdump(s->ext_data, s->ext_size, 16);
+   
+-  priv->frame = avcodec_alloc_frame();
++  priv->frame = av_frame_alloc();
+   priv->gavl_frame = gavl_video_frame_create(NULL);
+   
+   /* Some codecs need extra stuff */
+@@ -1032,7 +1007,7 @@ static int init_ffmpeg(bgav_stream_t * s
+     {
+     s->data.video.format.pixelformat = GAVL_YUV_420_P;
+     priv->do_convert = 1;
+-    priv->dst_format = PIX_FMT_YUV420P;
++    priv->dst_format = AV_PIX_FMT_YUV420P;
+ 
+ #ifdef HAVE_LIBSWSCALE
+     priv->swsContext =
+@@ -1073,10 +1048,6 @@ static void resync_ffmpeg(bgav_stream_t
+   priv = s->data.video.decoder->priv;
+   avcodec_flush_buffers(priv->ctx);
+ 
+-  priv->ip_age[0] = 256*256*256*64;
+-  priv->ip_age[1] = 256*256*256*64;
+-  priv->b_age = 256*256*256*64;
+-
+   priv->last_dv_timecode = GAVL_TIMECODE_UNDEFINED;
+ 
+   bgav_pts_cache_clear(&priv->pts_cache);
+@@ -1142,7 +1113,7 @@ static void close_ffmpeg(bgav_stream_t *
+     sws_freeContext(priv->swsContext);
+ #endif
+   
+-  free(priv->frame);
++  av_frame_free(&priv->frame);
+   free(priv);
+   }
+ 
+@@ -2108,50 +2079,48 @@ static void rgba32_to_rgba32(gavl_video_
+ 
+ static const struct
+   {
+-  enum PixelFormat  ffmpeg_csp;
++  enum AVPixelFormat  ffmpeg_csp;
+   gavl_pixelformat_t gavl_csp;
+   } pixelformats[] =
+   {
+-    { PIX_FMT_YUV420P,       GAVL_YUV_420_P },  ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
++    { AV_PIX_FMT_YUV420P,       GAVL_YUV_420_P },  ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
+ #if LIBAVUTIL_VERSION_INT < (50<<16)
+-    { PIX_FMT_YUV422,        GAVL_YUY2      },
++    { AV_PIX_FMT_YUV422,        GAVL_YUY2      },
+ #else
+-    { PIX_FMT_YUYV422,       GAVL_YUY2      },
++    { AV_PIX_FMT_YUYV422,       GAVL_YUY2      },
+ #endif
+-    { PIX_FMT_RGB24,         GAVL_RGB_24    },  ///< Packed pixel, 3 bytes per pixel, RGBRGB...
+-    { PIX_FMT_BGR24,         GAVL_BGR_24    },  ///< Packed pixel, 3 bytes per pixel, BGRBGR...
+-    { PIX_FMT_YUV422P,       GAVL_YUV_422_P },  ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
+-    { PIX_FMT_YUV444P,       GAVL_YUV_444_P }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples)
++    { AV_PIX_FMT_RGB24,         GAVL_RGB_24    },  ///< Packed pixel, 3 bytes per pixel, RGBRGB...
++    { AV_PIX_FMT_BGR24,         GAVL_BGR_24    },  ///< Packed pixel, 3 bytes per pixel, BGRBGR...
++    { AV_PIX_FMT_YUV422P,       GAVL_YUV_422_P },  ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
++    { AV_PIX_FMT_YUV444P,       GAVL_YUV_444_P }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples)
+ #if LIBAVUTIL_VERSION_INT < (50<<16)
+-    { PIX_FMT_RGBA32,        GAVL_RGBA_32   },  ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
++    { AV_PIX_FMT_RGBA32,        GAVL_RGBA_32   },  ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
+ #else
+-    { PIX_FMT_RGB32,         GAVL_RGBA_32   },  ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
++    { AV_PIX_FMT_RGB32,         GAVL_RGBA_32   },  ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
+ #endif
+-    { PIX_FMT_YUV410P,       GAVL_YUV_410_P }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
+-    { PIX_FMT_YUV411P,       GAVL_YUV_411_P }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
+-    { PIX_FMT_RGB565,        GAVL_RGB_16 }, ///< always stored in cpu endianness
+-    { PIX_FMT_RGB555,        GAVL_RGB_15 }, ///< always stored in cpu endianness, most significant bit to 1
+-    { PIX_FMT_GRAY8,         GAVL_PIXELFORMAT_NONE },
+-    { PIX_FMT_MONOWHITE,     GAVL_PIXELFORMAT_NONE }, ///< 0 is white
+-    { PIX_FMT_MONOBLACK,     GAVL_PIXELFORMAT_NONE }, ///< 0 is black
+-    // { PIX_FMT_PAL8,          GAVL_RGB_24     }, ///< 8 bit with RGBA palette
+-    { PIX_FMT_YUVJ420P,      GAVL_YUVJ_420_P }, ///< Planar YUV 4:2:0 full scale (jpeg)
+-    { PIX_FMT_YUVJ422P,      GAVL_YUVJ_422_P }, ///< Planar YUV 4:2:2 full scale (jpeg)
+-    { PIX_FMT_YUVJ444P,      GAVL_YUVJ_444_P }, ///< Planar YUV 4:4:4 full scale (jpeg)
+-    { PIX_FMT_XVMC_MPEG2_MC, GAVL_PIXELFORMAT_NONE }, ///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
+-    { PIX_FMT_XVMC_MPEG2_IDCT, GAVL_PIXELFORMAT_NONE },
++    { AV_PIX_FMT_YUV410P,       GAVL_YUV_410_P }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
++    { AV_PIX_FMT_YUV411P,       GAVL_YUV_411_P }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
++    { AV_PIX_FMT_RGB565,        GAVL_RGB_16 }, ///< always stored in cpu endianness
++    { AV_PIX_FMT_RGB555,        GAVL_RGB_15 }, ///< always stored in cpu endianness, most significant bit to 1
++    { AV_PIX_FMT_GRAY8,         GAVL_PIXELFORMAT_NONE },
++    { AV_PIX_FMT_MONOWHITE,     GAVL_PIXELFORMAT_NONE }, ///< 0 is white
++    { AV_PIX_FMT_MONOBLACK,     GAVL_PIXELFORMAT_NONE }, ///< 0 is black
++    // { AV_PIX_FMT_PAL8,          GAVL_RGB_24     }, ///< 8 bit with RGBA palette
++    { AV_PIX_FMT_YUVJ420P,      GAVL_YUVJ_420_P }, ///< Planar YUV 4:2:0 full scale (jpeg)
++    { AV_PIX_FMT_YUVJ422P,      GAVL_YUVJ_422_P }, ///< Planar YUV 4:2:2 full scale (jpeg)
++    { AV_PIX_FMT_YUVJ444P,      GAVL_YUVJ_444_P }, ///< Planar YUV 4:4:4 full scale (jpeg)
+ #if LIBAVCODEC_BUILD >= ((51<<16)+(45<<8)+0)
+-    { PIX_FMT_YUVA420P,      GAVL_YUVA_32 },
++    { AV_PIX_FMT_YUVA420P,      GAVL_YUVA_32 },
+ #endif
+-    { PIX_FMT_NB, GAVL_PIXELFORMAT_NONE }
++    { AV_PIX_FMT_NB, GAVL_PIXELFORMAT_NONE }
+ };
+ 
+ 
+-static gavl_pixelformat_t get_pixelformat(enum PixelFormat p,
++static gavl_pixelformat_t get_pixelformat(enum AVPixelFormat p,
+                                           gavl_pixelformat_t pixelformat)
+   {
+   int i;
+-  if(p == PIX_FMT_PAL8)
++  if(p == AV_PIX_FMT_PAL8)
+     {
+     if(pixelformat == GAVL_RGBA_32)
+       return GAVL_RGBA_32;
+@@ -2310,7 +2279,7 @@ static void put_frame(bgav_stream_t * s,
+   
+   ffmpeg_video_priv * priv;
+   priv = s->data.video.decoder->priv;
+-  if(priv->ctx->pix_fmt == PIX_FMT_PAL8)
++  if(priv->ctx->pix_fmt == AV_PIX_FMT_PAL8)
+     {
+     if(s->data.video.format.pixelformat == GAVL_RGBA_32)
+       pal8_to_rgba32(f, priv->frame,
+@@ -2332,9 +2301,9 @@ static void put_frame(bgav_stream_t * s,
+     }
+ #endif
+ #if LIBAVUTIL_VERSION_INT < (50<<16)
+-  else if(priv->ctx->pix_fmt == PIX_FMT_RGBA32)
++  else if(priv->ctx->pix_fmt == AV_PIX_FMT_RGBA32)
+ #else
+-  else if(priv->ctx->pix_fmt == PIX_FMT_RGB32)
++  else if(priv->ctx->pix_fmt == AV_PIX_FMT_RGB32)
+ #endif
+     {
+     rgba32_to_rgba32(f, priv->frame,
+@@ -2342,7 +2311,7 @@ static void put_frame(bgav_stream_t * s,
+                      s->data.video.format.image_height, !!(priv->flags & FLIP_Y));
+     }
+ #if LIBAVCODEC_BUILD >= ((51<<16)+(45<<8)+0)
+-  else if(priv->ctx->pix_fmt == PIX_FMT_YUVA420P)
++  else if(priv->ctx->pix_fmt == AV_PIX_FMT_YUVA420P)
+     {
+     yuva420_to_yuva32(f, priv->frame,
+                       s->data.video.format.image_width,
diff --git a/debian/patches/series b/debian/patches/series
index 0e565fd..63f6023 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ fix_typos.patch
 fix-ftbfs-libav9.patch
 plugins-ldflags.patch
 libav10.patch
+ffmpeg_2.9.patch

-- 
gmerlin-avdecoder packaging



More information about the pkg-multimedia-commits mailing list