[gnash] 05/05: Fix FTBFS with ffmpeg 2.9 (Closes: #803819). Thanks Andreas Cadhalpun.
Gabriele Giacone
gg0-guest at moszumanska.debian.org
Sat Jan 9 18:57:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
gg0-guest pushed a commit to branch master
in repository gnash.
commit 31d8d28a1a5df39f2387ab3b4b4715ad033b1387
Author: Gabriele Giacone <1o5g4r8o at gmail.com>
Date: Sat Jan 9 15:25:05 2016 +0100
Fix FTBFS with ffmpeg 2.9 (Closes: #803819). Thanks Andreas Cadhalpun.
---
debian/changelog | 3 +-
debian/patches/01ffmpeg_2.9.patch | 223 ++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 226 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index f9caff4..37dbee4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
-gnash (0.8.11~git20160109-1) UNRELEASED; urgency=medium
+gnash (0.8.11~git20160109-1) unstable; urgency=medium
* New upstream snapshot.
+ * Fix FTBFS with ffmpeg 2.9 (Closes: #803819). Thanks Andreas Cadhalpun.
-- Gabriele Giacone <1o5g4r8o at gmail.com> Sat, 09 Jan 2016 14:58:48 +0100
diff --git a/debian/patches/01ffmpeg_2.9.patch b/debian/patches/01ffmpeg_2.9.patch
new file mode 100644
index 0000000..2e571b1
--- /dev/null
+++ b/debian/patches/01ffmpeg_2.9.patch
@@ -0,0 +1,223 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Last-Update: <2015-11-03>
+
+--- gnash-0.8.11~git20150419.orig/libmedia/ffmpeg/VideoConverterFfmpeg.cpp
++++ gnash-0.8.11~git20150419/libmedia/ffmpeg/VideoConverterFfmpeg.cpp
+@@ -26,6 +26,27 @@
+ #include "ffmpegHeaders.h"
+ #include "log.h"
+
++#if LIBAVUTIL_VERSION_MAJOR < 52
++#define AVPixelFormat PixelFormat
++#define AV_PIX_FMT_RGB24 PIX_FMT_RGB24
++#define AV_PIX_FMT_YUV444P PIX_FMT_YUV444P
++#define AV_PIX_FMT_YUVJ444P PIX_FMT_YUVJ444P
++#define AV_PIX_FMT_YUV440P PIX_FMT_YUV440P
++#define AV_PIX_FMT_YUVJ440P PIX_FMT_YUVJ440P
++#define AV_PIX_FMT_YUV422P PIX_FMT_YUV422P
++#define AV_PIX_FMT_YUVJ422P PIX_FMT_YUVJ422P
++#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
++#define AV_PIX_FMT_YUVJ420P PIX_FMT_YUVJ420P
++#define AV_PIX_FMT_YUV411P PIX_FMT_YUV411P
++#define AV_PIX_FMT_YUV410P PIX_FMT_YUV410P
++#define AV_PIX_FMT_NV12 PIX_FMT_NV12
++#define AV_PIX_FMT_NV21 PIX_FMT_NV21
++#define AV_PIX_FMT_YUYV422 PIX_FMT_YUYV422
++#define AV_PIX_FMT_UYVY422 PIX_FMT_UYVY422
++#define AV_PIX_FMT_UYYVYY411 PIX_FMT_UYYVYY411
++#define AV_PIX_FMT_NONE PIX_FMT_NONE
++#endif
++
+ namespace gnash {
+ namespace media {
+ namespace ffmpeg {
+@@ -57,7 +78,7 @@ private:
+
+ // The lookup table in this function is adapted from chroma.c from the VLC
+ // codebase; its license permits distribution under GPLv3 and later.
+-PixelFormat
++AVPixelFormat
+ fourcc_to_ffmpeg(ImgBuf::Type4CC code)
+ {
+
+@@ -68,40 +89,40 @@ fourcc_to_ffmpeg(ImgBuf::Type4CC code)
+ static const struct
+ {
+ ImgBuf::Type4CC fourcc;
+- PixelFormat ffmpegcode;
++ AVPixelFormat ffmpegcode;
+ } pixfmt_table[] =
+ {
+ // Planar YUV formats
+- {GNASH_FOURCC('I','4','4','4'), PIX_FMT_YUV444P},
+- {GNASH_FOURCC('J','4','4','4'), PIX_FMT_YUVJ444P},
++ {GNASH_FOURCC('I','4','4','4'), AV_PIX_FMT_YUV444P},
++ {GNASH_FOURCC('J','4','4','4'), AV_PIX_FMT_YUVJ444P},
+
+ #if LIBAVUTIL_VERSION_INT >= ((49<<16)+(5<<8)+0)
+- {GNASH_FOURCC('I','4','4','0'), PIX_FMT_YUV440P},
+- {GNASH_FOURCC('J','4','4','0'), PIX_FMT_YUVJ440P},
++ {GNASH_FOURCC('I','4','4','0'), AV_PIX_FMT_YUV440P},
++ {GNASH_FOURCC('J','4','4','0'), AV_PIX_FMT_YUVJ440P},
+ #endif
+
+- {GNASH_FOURCC('I','4','2','2'), PIX_FMT_YUV422P},
+- {GNASH_FOURCC('J','4','2','2'), PIX_FMT_YUVJ422P},
++ {GNASH_FOURCC('I','4','2','2'), AV_PIX_FMT_YUV422P},
++ {GNASH_FOURCC('J','4','2','2'), AV_PIX_FMT_YUVJ422P},
+
+- {GNASH_FOURCC('I','4','2','0'), PIX_FMT_YUV420P},
+- {GNASH_FOURCC('Y','V','1','2'), PIX_FMT_YUV420P},
+- {GNASH_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P},
+- {GNASH_FOURCC('J','4','2','0'), PIX_FMT_YUVJ420P},
+- {GNASH_FOURCC('I','4','1','1'), PIX_FMT_YUV411P},
+- {GNASH_FOURCC('I','4','1','0'), PIX_FMT_YUV410P},
+- {GNASH_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P},
++ {GNASH_FOURCC('I','4','2','0'), AV_PIX_FMT_YUV420P},
++ {GNASH_FOURCC('Y','V','1','2'), AV_PIX_FMT_YUV420P},
++ {GNASH_FOURCC('I','Y','U','V'), AV_PIX_FMT_YUV420P},
++ {GNASH_FOURCC('J','4','2','0'), AV_PIX_FMT_YUVJ420P},
++ {GNASH_FOURCC('I','4','1','1'), AV_PIX_FMT_YUV411P},
++ {GNASH_FOURCC('I','4','1','0'), AV_PIX_FMT_YUV410P},
++ {GNASH_FOURCC('Y','V','U','9'), AV_PIX_FMT_YUV410P},
+
+ #if LIBAVUTIL_VERSION_INT >= ((49<<16)+(0<<8)+1)
+- {GNASH_FOURCC('N','V','1','2'), PIX_FMT_NV12},
+- {GNASH_FOURCC('N','V','2','1'), PIX_FMT_NV21},
++ {GNASH_FOURCC('N','V','1','2'), AV_PIX_FMT_NV12},
++ {GNASH_FOURCC('N','V','2','1'), AV_PIX_FMT_NV21},
+ #endif
+
+- {GNASH_FOURCC('Y','U','Y','2'), PIX_FMT_YUYV422},
+- {GNASH_FOURCC('Y','U','Y','V'), PIX_FMT_YUYV422},
+- {GNASH_FOURCC('U','Y','V','Y'), PIX_FMT_UYVY422},
+- {GNASH_FOURCC('Y','4','1','1'), PIX_FMT_UYYVYY411},
++ {GNASH_FOURCC('Y','U','Y','2'), AV_PIX_FMT_YUYV422},
++ {GNASH_FOURCC('Y','U','Y','V'), AV_PIX_FMT_YUYV422},
++ {GNASH_FOURCC('U','Y','V','Y'), AV_PIX_FMT_UYVY422},
++ {GNASH_FOURCC('Y','4','1','1'), AV_PIX_FMT_UYYVYY411},
+
+- { 0, PIX_FMT_NONE}
++ { 0, AV_PIX_FMT_NONE}
+ };
+ #undef GNASH_FOURCC
+
+@@ -112,13 +133,13 @@ fourcc_to_ffmpeg(ImgBuf::Type4CC code)
+ }
+ }
+
+- return PIX_FMT_NONE;
++ return AV_PIX_FMT_NONE;
+ }
+
+ VideoConverterFfmpeg::VideoConverterFfmpeg(ImgBuf::Type4CC srcFormat, ImgBuf::Type4CC dstFormat)
+ : VideoConverter(srcFormat, dstFormat)
+ {
+- if(fourcc_to_ffmpeg(_dst_fmt) == PIX_FMT_NONE) {
++ if(fourcc_to_ffmpeg(_dst_fmt) == AV_PIX_FMT_NONE) {
+ throw MediaException(_("VideoConverterFfmpeg cannot convert to the "
+ "requested format"));
+ }
+@@ -138,9 +159,9 @@ VideoConverterFfmpeg::convert(const ImgB
+ const int width = src.width;
+ const int height = src.height;
+
+- PixelFormat dst_pixFmt = fourcc_to_ffmpeg(_dst_fmt);
+- assert(dst_pixFmt != PIX_FMT_NONE);
+- PixelFormat src_pixFmt = PIX_FMT_RGB24;
++ AVPixelFormat dst_pixFmt = fourcc_to_ffmpeg(_dst_fmt);
++ assert(dst_pixFmt != AV_PIX_FMT_NONE);
++ AVPixelFormat src_pixFmt = AV_PIX_FMT_RGB24;
+
+ #ifdef HAVE_SWSCALE_H
+
+--- gnash-0.8.11~git20150419.orig/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
++++ gnash-0.8.11~git20150419/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+@@ -39,6 +39,14 @@
+ # include "GnashVaapiImage.h"
+ #endif
+
++#if LIBAVUTIL_VERSION_MAJOR < 52
++#define AVPixelFormat PixelFormat
++#define AV_PIX_FMT_RGBA PIX_FMT_RGBA
++#define AV_PIX_FMT_RGB24 PIX_FMT_RGB24
++#define AV_PIX_FMT_NONE PIX_FMT_NONE
++#define AV_PIX_FMT_VAAPI_VLD PIX_FMT_VAAPI_VLD
++#endif
++
+ namespace gnash {
+ namespace media {
+ namespace ffmpeg {
+@@ -51,7 +59,7 @@ namespace {
+ void set_vaapi_context(AVCodecContext* avctx, VaapiContextFfmpeg* vactx);
+ void clear_vaapi_context(AVCodecContext* avctx);
+ void reset_context(AVCodecContext* avctx, VaapiContextFfmpeg* vactx = nullptr);
+- PixelFormat get_format(AVCodecContext* avctx, const PixelFormat* fmt);
++ AVPixelFormat get_format(AVCodecContext* avctx, const AVPixelFormat* fmt);
+ #if LIBAVCODEC_VERSION_MAJOR >= 55
+ int get_buffer(AVCodecContext* avctx, AVFrame* pic, int flags);
+ #else
+@@ -251,16 +259,16 @@ VideoDecoderFfmpeg::frameToImage(AVCodec
+ const AVFrame& srcFrameRef)
+ {
+ const AVFrame *srcFrame = &srcFrameRef;
+- PixelFormat srcPixFmt = srcCtx->pix_fmt;
++ AVPixelFormat srcPixFmt = srcCtx->pix_fmt;
+
+ const int width = srcCtx->width;
+ const int height = srcCtx->height;
+
+ #ifdef FFMPEG_VP6A
+- PixelFormat pixFmt = (srcCtx->codec->id == AV_CODEC_ID_VP6A) ?
+- PIX_FMT_RGBA : PIX_FMT_RGB24;
++ AVPixelFormat pixFmt = (srcCtx->codec->id == AV_CODEC_ID_VP6A) ?
++ AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24;
+ #else
+- PixelFormat pixFmt = PIX_FMT_RGB24;
++ AVPixelFormat pixFmt = AV_PIX_FMT_RGB24;
+ #endif
+
+ std::unique_ptr<image::GnashImage> im;
+@@ -306,10 +314,10 @@ VideoDecoderFfmpeg::frameToImage(AVCodec
+
+ switch (pixFmt)
+ {
+- case PIX_FMT_RGBA:
++ case AV_PIX_FMT_RGBA:
+ im.reset(new image::ImageRGBA(width, height));
+ break;
+- case PIX_FMT_RGB24:
++ case AV_PIX_FMT_RGB24:
+ im.reset(new image::ImageRGB(width, height));
+ break;
+ default:
+@@ -325,7 +333,7 @@ VideoDecoderFfmpeg::frameToImage(AVCodec
+ avpicture_fill(&picture, im->begin(), pixFmt, width, height);
+
+ #ifndef HAVE_SWSCALE_H
+- img_convert(&picture, PIX_FMT_RGB24, (AVPicture*)srcFrame,
++ img_convert(&picture, AV_PIX_FMT_RGB24, (AVPicture*)srcFrame,
+ srcPixFmt, width, height);
+ #else
+
+@@ -499,15 +507,15 @@ reset_context(AVCodecContext* avctx, Vaa
+ }
+
+ /// AVCodecContext.get_format() implementation
+-PixelFormat
+-get_format(AVCodecContext* avctx, const PixelFormat* fmt)
++AVPixelFormat
++get_format(AVCodecContext* avctx, const AVPixelFormat* fmt)
+ {
+ #ifdef HAVE_VA_VA_H
+ VaapiContextFfmpeg* const vactx = get_vaapi_context(avctx);
+
+ if (vactx) {
+- for (int i = 0; fmt[i] != PIX_FMT_NONE; i++) {
+- if (fmt[i] != PIX_FMT_VAAPI_VLD) continue;
++ for (int i = 0; fmt[i] != AV_PIX_FMT_NONE; i++) {
++ if (fmt[i] != AV_PIX_FMT_VAAPI_VLD) continue;
+
+ if (vactx->initDecoder(avctx->width, avctx->height)) {
+ return fmt[i];
diff --git a/debian/patches/series b/debian/patches/series
index 1eb8018..8c934fb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
00sensible
+01ffmpeg_2.9.patch
--
Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git
More information about the pkg-flash-devel
mailing list