[packages/gtatool] - fix building wwith ffmpeg 3.x - rel 10
baggins
baggins at pld-linux.org
Tue Mar 29 16:02:49 CEST 2016
commit 94e56c2c703e93be63e1e11c2b5b98e993c7ccb8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Tue Mar 29 16:02:26 2016 +0200
- fix building wwith ffmpeg 3.x
- rel 10
ffmpeg3.patch | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
gtatool.spec | 4 ++-
2 files changed, 114 insertions(+), 1 deletion(-)
---
diff --git a/gtatool.spec b/gtatool.spec
index ab4b116..66e399a 100644
--- a/gtatool.spec
+++ b/gtatool.spec
@@ -24,7 +24,7 @@ Summary: Tools to manipulate Generic Tagged Array (GTA) files
Summary(pl.UTF-8): Narzędzia do obróbki plików GTA (ogólnych tablic etykietowanych)
Name: gtatool
Version: 2.0.1
-Release: 9
+Release: 10
License: GPL v3+
Group: Applications/File
Source0: http://download.savannah.gnu.org/releases/gta/%{name}-%{version}.tar.xz
@@ -33,6 +33,7 @@ Patch0: ffmpeg2.patch
Patch1: %{name}-getopt.patch
Patch2: %{name}-bashcomp.patch
Patch3: pfstools2.patch
+Patch4: ffmpeg3.patch
URL: http://gta.nongnu.org/gtatool.html
%{?with_magick:BuildRequires: ImageMagick-c++-devel}
%{?with_openexr:BuildRequires: OpenEXR-devel}
@@ -286,6 +287,7 @@ Bashowe uzupełnianie parametrów programu gtatool.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
diff --git a/ffmpeg3.patch b/ffmpeg3.patch
new file mode 100644
index 0000000..262871b
--- /dev/null
+++ b/ffmpeg3.patch
@@ -0,0 +1,111 @@
+diff -ur gtatool-2.0.1.orig/src/conv-ffmpeg/media_object.cpp gtatool-2.0.1/src/conv-ffmpeg/media_object.cpp
+--- gtatool-2.0.1.orig/src/conv-ffmpeg/media_object.cpp 2016-03-29 15:47:09.906503157 +0200
++++ gtatool-2.0.1/src/conv-ffmpeg/media_object.cpp 2016-03-29 15:54:14.410037508 +0200
+@@ -430,20 +430,20 @@
+ video_frame_template.value_range = video_frame::u8_full;
+ video_frame_template.chroma_location = video_frame::center;
+ if (!_always_convert_to_bgra32
+- && (video_codec_ctx->pix_fmt == PIX_FMT_YUV444P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV444P10
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P10
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV420P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV420P10))
++ && (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P10
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P10
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV420P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV420P10))
+ {
+- if (video_codec_ctx->pix_fmt == PIX_FMT_YUV444P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV444P10)
++ if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P10)
+ {
+ video_frame_template.layout = video_frame::yuv444p;
+ }
+- else if (video_codec_ctx->pix_fmt == PIX_FMT_YUV422P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P10)
++ else if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P10)
+ {
+ video_frame_template.layout = video_frame::yuv422p;
+ }
+@@ -456,9 +456,9 @@
+ {
+ video_frame_template.color_space = video_frame::yuv709;
+ }
+- if (video_codec_ctx->pix_fmt == PIX_FMT_YUV444P10
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P10
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV420P10)
++ if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P10
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P10
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV420P10)
+ {
+ video_frame_template.value_range = video_frame::u10_mpeg;
+ if (video_codec_ctx->color_range == AVCOL_RANGE_JPEG)
+@@ -485,15 +485,15 @@
+ }
+ }
+ else if (!_always_convert_to_bgra32
+- && (video_codec_ctx->pix_fmt == PIX_FMT_YUVJ444P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUVJ422P
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUVJ420P))
++ && (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ444P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ422P
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ420P))
+ {
+- if (video_codec_ctx->pix_fmt == PIX_FMT_YUVJ444P)
++ if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ444P)
+ {
+ video_frame_template.layout = video_frame::yuv444p;
+ }
+- else if (video_codec_ctx->pix_fmt == PIX_FMT_YUVJ422P)
++ else if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ422P)
+ {
+ video_frame_template.layout = video_frame::yuv422p;
+ }
+@@ -947,8 +947,8 @@
+ _ffmpeg->video_frames.push_back(av_frame_alloc());
+ _ffmpeg->video_buffered_frames.push_back(av_frame_alloc());
+ #endif
+- enum PixelFormat frame_fmt = (_ffmpeg->video_frame_templates[j].layout == video_frame::bgra32
+- ? PIX_FMT_BGRA : _ffmpeg->video_codec_ctxs[j]->pix_fmt);
++ enum AVPixelFormat frame_fmt = (_ffmpeg->video_frame_templates[j].layout == video_frame::bgra32
++ ? AV_PIX_FMT_BGRA : _ffmpeg->video_codec_ctxs[j]->pix_fmt);
+ int frame_bufsize = (avpicture_get_size(frame_fmt,
+ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height));
+ _ffmpeg->video_buffers.push_back(static_cast<uint8_t *>(av_malloc(frame_bufsize)));
+@@ -961,7 +961,7 @@
+ if (_ffmpeg->video_frame_templates[j].layout == video_frame::bgra32)
+ {
+ // Initialize things needed for software pixel format conversion
+- int sws_bufsize = avpicture_get_size(PIX_FMT_BGRA,
++ int sws_bufsize = avpicture_get_size(AV_PIX_FMT_BGRA,
+ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height);
+ #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1)
+ _ffmpeg->video_sws_frames.push_back(avcodec_alloc_frame());
+@@ -974,11 +974,11 @@
+ throw exc(HERE + ": " + strerror(ENOMEM));
+ }
+ avpicture_fill(reinterpret_cast<AVPicture *>(_ffmpeg->video_sws_frames[j]), _ffmpeg->video_sws_buffers[j],
+- PIX_FMT_BGRA, _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height);
++ AV_PIX_FMT_BGRA, _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height);
+ // Call sws_getCachedContext(NULL, ...) instead of sws_getContext(...) just to avoid a deprecation warning.
+ _ffmpeg->video_sws_ctxs.push_back(sws_getCachedContext(NULL,
+ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height, _ffmpeg->video_codec_ctxs[j]->pix_fmt,
+- _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height, PIX_FMT_BGRA,
++ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height, AV_PIX_FMT_BGRA,
+ SWS_POINT, NULL, NULL, NULL));
+ if (!_ffmpeg->video_sws_ctxs[j])
+ {
+@@ -1532,7 +1532,7 @@
+ // We need to buffer the data because FFmpeg will clubber it when decoding the next frame.
+ av_picture_copy(reinterpret_cast<AVPicture *>(_ffmpeg->video_buffered_frames[_video_stream]),
+ reinterpret_cast<AVPicture *>(_ffmpeg->video_frames[_video_stream]),
+- static_cast<enum PixelFormat>(_ffmpeg->video_codec_ctxs[_video_stream]->pix_fmt),
++ static_cast<enum AVPixelFormat>(_ffmpeg->video_codec_ctxs[_video_stream]->pix_fmt),
+ _ffmpeg->video_codec_ctxs[_video_stream]->width,
+ _ffmpeg->video_codec_ctxs[_video_stream]->height);
+ src_frame = _ffmpeg->video_buffered_frames[_video_stream];
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gtatool.git/commitdiff/94e56c2c703e93be63e1e11c2b5b98e993c7ccb8
More information about the pld-cvs-commit
mailing list