[SCM] lives/master: Fix build with ffmpeg 3.0

sramacher at users.alioth.debian.org sramacher at users.alioth.debian.org
Tue Mar 8 21:10:39 UTC 2016


The following commit has been merged in the master branch:
commit e30f4ae95672030066f32ef571f379d7daa18e57
Author: Sebastian Ramacher <sramacher at debian.org>
Date:   Tue Mar 8 22:07:07 2016 +0100

    Fix build with ffmpeg 3.0
    
    Thanks: Gabriel Finch
    Closes: #803839

diff --git a/debian/patches/ffmpeg3.0.patch b/debian/patches/ffmpeg3.0.patch
new file mode 100644
index 0000000..fb17c67
--- /dev/null
+++ b/debian/patches/ffmpeg3.0.patch
@@ -0,0 +1,255 @@
+Description: Fix build with ffmpeg 3.0
+Author: salsaman <salsaman at gmail.com>
+
+--- a/libweed/weed-compat.h
++++ b/libweed/weed-compat.h
+@@ -42,7 +42,7 @@
+ 
+ */
+ 
+-/* (C) Gabriel "Salsaman" Finch, 2005 - 2012 */
++/* (C) Gabriel "Salsaman" Finch, 2005 - 2016 */
+ 
+ #ifndef __WEED_COMPAT_H__
+ #define __WEED_COMPAT_H__
+@@ -595,6 +595,8 @@
+ #include <weed/weed-palettes.h>
+ #endif
+ 
++#ifdef FF_API_PIX_FMT
++
+ int avi_pix_fmt_to_weed_palette(enum PixelFormat pix_fmt, int *clamped) {
+   // clamped may be set to NULL if you are not interested in the value
+ 
+@@ -635,17 +637,14 @@
+   case PIX_FMT_YUVJ420P:
+     if (clamped) *clamped=WEED_YUV_CLAMPING_UNCLAMPED;
+     return WEED_PALETTE_YUV420P;
+-
++    
+   default:
+     return WEED_PALETTE_END;
+   }
+ }
+ 
+ 
+-
+-
+ enum PixelFormat weed_palette_to_avi_pix_fmt(int pal, int *clamped) {
+-
+   switch (pal) {
+   case WEED_PALETTE_RGB24:
+       return PIX_FMT_RGB24;
+@@ -684,11 +683,100 @@
+   default:
+     return PIX_FMT_NONE;
+   }
++}
++
++#else
+ 
+-  return PIX_FMT_NONE;
++int avi_pix_fmt_to_weed_palette(enum AVPixelFormat pix_fmt, int *clamped) {
++  // clamped may be set to NULL if you are not interested in the value
+ 
++  switch (pix_fmt) {
++  case AV_PIX_FMT_RGB24:
++    return WEED_PALETTE_RGB24;
++  case AV_PIX_FMT_BGR24:
++    return WEED_PALETTE_BGR24;
++  case AV_PIX_FMT_RGBA:
++    return WEED_PALETTE_RGBA32;
++  case AV_PIX_FMT_BGRA:
++    return WEED_PALETTE_BGRA32;
++  case AV_PIX_FMT_ARGB:
++    return WEED_PALETTE_ARGB32;
++  case AV_PIX_FMT_YUV444P:
++    return WEED_PALETTE_YUV444P;
++  case AV_PIX_FMT_YUV422P:
++    return WEED_PALETTE_YUV422P;
++  case AV_PIX_FMT_YUV420P:
++    return WEED_PALETTE_YUV420P;
++  case AV_PIX_FMT_YUYV422:
++    return WEED_PALETTE_YUYV;
++  case AV_PIX_FMT_UYVY422:
++    return WEED_PALETTE_UYVY;
++  case AV_PIX_FMT_UYYVYY411:
++    return WEED_PALETTE_YUV411;
++  case AV_PIX_FMT_GRAY8:
++    return WEED_PALETTE_A8;
++  case AV_PIX_FMT_MONOWHITE:
++  case AV_PIX_FMT_MONOBLACK:
++    return WEED_PALETTE_A1;
++  case AV_PIX_FMT_YUVJ422P:
++    if (clamped) *clamped=WEED_YUV_CLAMPING_UNCLAMPED;
++    return WEED_PALETTE_YUV422P;
++  case AV_PIX_FMT_YUVJ444P:
++    if (clamped) *clamped=WEED_YUV_CLAMPING_UNCLAMPED;
++    return WEED_PALETTE_YUV444P;
++  case AV_PIX_FMT_YUVJ420P:
++    if (clamped) *clamped=WEED_YUV_CLAMPING_UNCLAMPED;
++    return WEED_PALETTE_YUV420P;
++    
++  default:
++    return WEED_PALETTE_END;
++  }
+ }
+ 
++
++enum AVPixelFormat weed_palette_to_avi_pix_fmt(int pal, int *clamped) {
++  switch (pal) {
++  case WEED_PALETTE_RGB24:
++      return AV_PIX_FMT_RGB24;
++  case WEED_PALETTE_BGR24:
++    return AV_PIX_FMT_BGR24;
++  case WEED_PALETTE_RGBA32:
++    return AV_PIX_FMT_RGBA;
++  case WEED_PALETTE_BGRA32:
++    return AV_PIX_FMT_BGRA;
++  case WEED_PALETTE_ARGB32:
++    return AV_PIX_FMT_ARGB;
++  case WEED_PALETTE_YUV444P:
++    if (clamped && *clamped==WEED_YUV_CLAMPING_UNCLAMPED)
++      return AV_PIX_FMT_YUVJ444P;
++    return AV_PIX_FMT_YUV444P;
++  case WEED_PALETTE_YUV422P:
++    if (clamped && *clamped==WEED_YUV_CLAMPING_UNCLAMPED)
++      return AV_PIX_FMT_YUVJ422P;
++    return AV_PIX_FMT_YUV422P;
++  case WEED_PALETTE_YUV420P:
++    if (clamped && *clamped==WEED_YUV_CLAMPING_UNCLAMPED)
++      return AV_PIX_FMT_YUVJ420P;
++    return AV_PIX_FMT_YUV420P;
++  case WEED_PALETTE_YUYV:
++    return AV_PIX_FMT_YUYV422;
++  case WEED_PALETTE_UYVY:
++    return AV_PIX_FMT_UYVY422;
++  case WEED_PALETTE_YUV411:
++    return AV_PIX_FMT_UYYVYY411;
++
++  case WEED_PALETTE_A8:
++    return AV_PIX_FMT_GRAY8;
++  case WEED_PALETTE_A1:
++    return AV_PIX_FMT_MONOBLACK;
++
++  default:
++    return AV_PIX_FMT_NONE;
++  }
++}
++  
++#endif
++  
+ #endif // HAVE_AVUTIL
+ #endif // HAVE_AVCODEC
+ 
+--- a/lives-plugins/plugins/decoders/mkv_decoder.c
++++ b/lives-plugins/plugins/decoders/mkv_decoder.c
+@@ -1,5 +1,5 @@
+ // LiVES - mkv decoder plugin
+-// (c) G. Finch 2011 <salsaman at xs4all.nl,salsaman at gmail.com>
++// (c) G. Finch 2011 - 2016 <salsaman at gmail.com>
+ 
+ /*
+  * This file is free software; you can redistribute it and/or
+@@ -40,7 +40,7 @@
+ #include <sys/stat.h>
+ #include <pthread.h>
+ 
+-const char *plugin_version="LiVES mkv decoder version 1.2";
++const char *plugin_version="LiVES mkv decoder version 1.3";
+ 
+ #ifdef HAVE_AV_CONFIG_H
+ #undef HAVE_AV_CONFIG_H
+@@ -901,7 +901,7 @@
+   out->data = newdata;
+   memcpy(out->data+out->size, in->data, in->size);
+   out->size += in->size;
+-  av_destruct_packet(in);
++  av_packet_unref(in);
+   av_free(in);
+   return 0;
+ }
+--- a/lives-plugins/plugins/decoders/mpegts_decoder.c
++++ b/lives-plugins/plugins/decoders/mpegts_decoder.c
+@@ -1,5 +1,5 @@
+ // LiVES - mpegts decoder plugin
+-// (c) G. Finch 2012 - 2014 <salsaman at gmail.com>
++// (c) G. Finch 2012 - 2016 <salsaman at gmail.com>
+ 
+ /*
+  * This file is free software; you can redistribute it and/or
+@@ -34,7 +34,7 @@
+ #include <endian.h>
+ #endif
+ 
+-const char *plugin_version="LiVES mpegts decoder version 1.2a";
++const char *plugin_version="LiVES mpegts decoder version 1.3";
+ 
+ #ifdef HAVE_AV_CONFIG_H
+ #undef HAVE_AV_CONFIG_H
+@@ -1023,7 +1023,9 @@
+ static void new_pes_packet(PESContext *pes, AVPacket *pkt) {
+   av_init_packet(pkt);
+ 
++#if FF_API_DESTRUCT_PACKET
+   pkt->destruct = av_destruct_packet;
++#endif
+   pkt->data = pes->buffer;
+   pkt->size = pes->data_index;
+ 
+--- a/src/colourspace.c
++++ b/src/colourspace.c
+@@ -79,8 +79,13 @@
+   int iheight;
+   int width;
+   int height;
++#ifdef FF_API_PIX_FMT
+   enum PixelFormat ipixfmt;
+   enum PixelFormat opixfmt;
++#else
++  enum AVPixelFormat ipixfmt;
++  enum AVPixelFormat opixfmt;
++#endif
+   int flags;
+   struct SwsContext *ctx;
+ };
+@@ -10211,7 +10216,12 @@
+ 
+ static struct SwsContext *swscale_find_context(int iwidth, int iheight,
+     int width, int height,
+-    enum PixelFormat ipixfmt, enum PixelFormat opixfmt, int flags) {
++#ifdef FF_API_PIX_FMT
++    enum PixelFormat ipixfmt, enum PixelFormat opixfmt, int flags)
++#else
++    enum AVPixelFormat ipixfmt, enum AVPixelFormat opixfmt, int flags)
++#endif  
++{
+   register int i;
+   struct _swscale_ctx tmpctx;
+ 
+@@ -10249,7 +10259,12 @@
+ }
+ 
+ 
+-static void swscale_add_context(int iwidth, int iheight, int width, int height, enum PixelFormat ipixfmt, enum PixelFormat opixfmt,
++static void swscale_add_context(int iwidth, int iheight, int width, int height,
++#ifdef FF_API_PIX_FMT
++				enum PixelFormat ipixfmt, enum PixelFormat opixfmt,
++#else
++				enum AVPixelFormat ipixfmt, enum AVPixelFormat opixfmt,
++#endif
+                                 int flags, struct SwsContext *ctx) {
+   // add at head of list
+   register int i;
+@@ -10396,7 +10411,11 @@
+       weed_palette_is_resizable(opal_hint, oclamp_hint, FALSE)) {
+     struct SwsContext *swscale;
+ 
++#ifdef FF_API_PIX_FMT
+     enum PixelFormat ipixfmt,opixfmt;
++#else
++    enum AVPixelFormat ipixfmt,opixfmt;
++#endif
+ 
+     void **pd_array;
+     void **in_pixel_data,**out_pixel_data;
diff --git a/debian/patches/series b/debian/patches/series
index d63c229..89f5e9a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 02-drop_py3_multiencoder.patch
 parallel-build.patch
 04-underlinking.patch
+ffmpeg3.0.patch

-- 
lives packaging



More information about the pkg-multimedia-commits mailing list