1 |
commit: a3b9e2c859ba23d5f868fd6b4d6ac89eeb47c04c |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 5 12:11:01 2016 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 5 12:11:22 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3b9e2c8 |
7 |
|
8 |
media-video/bino: apply debian patch to build with ffmpeg 3, bug #587860 |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
|
12 |
media-video/bino/bino-1.6.1-r2.ebuild | 1 + |
13 |
media-video/bino/files/ffmpeg_2.9.patch | 133 ++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 134 insertions(+) |
15 |
|
16 |
diff --git a/media-video/bino/bino-1.6.1-r2.ebuild b/media-video/bino/bino-1.6.1-r2.ebuild |
17 |
index 708c92d..4442bd2 100644 |
18 |
--- a/media-video/bino/bino-1.6.1-r2.ebuild |
19 |
+++ b/media-video/bino/bino-1.6.1-r2.ebuild |
20 |
@@ -46,6 +46,7 @@ DOCS=( AUTHORS ChangeLog NEWS README README.Linux ) |
21 |
|
22 |
PATCHES=( |
23 |
"${FILESDIR}/${PN}-1.4.2-lirc-detect.patch" # detect lirc |
24 |
+ "${FILESDIR}/ffmpeg_2.9.patch" # build with latest ffmpeg, #587860 |
25 |
) |
26 |
|
27 |
src_configure() { |
28 |
|
29 |
diff --git a/media-video/bino/files/ffmpeg_2.9.patch b/media-video/bino/files/ffmpeg_2.9.patch |
30 |
new file mode 100644 |
31 |
index 00000000..c790d6e |
32 |
--- /dev/null |
33 |
+++ b/media-video/bino/files/ffmpeg_2.9.patch |
34 |
@@ -0,0 +1,133 @@ |
35 |
+https://bugs.gentoo.org/show_bug.cgi?id=587860 |
36 |
+https://github.com/schaal/bino/blob/master/debian/patches/ffmpeg_2.9.patch |
37 |
+ |
38 |
+Description: Replace deprecated FFmpeg API |
39 |
+Author: Andreas Cadhalpun <Andreas.Cadhalpun@××××××××××.com> |
40 |
+Last-Update: <2015-11-02> |
41 |
+ |
42 |
+--- bino-1.6.0.orig/src/media_object.cpp |
43 |
++++ bino-1.6.0/src/media_object.cpp |
44 |
+@@ -427,20 +427,20 @@ void media_object::set_video_frame_templ |
45 |
+ video_frame_template.value_range = video_frame::u8_full; |
46 |
+ video_frame_template.chroma_location = video_frame::center; |
47 |
+ if (!_always_convert_to_bgra32 |
48 |
+- && (video_codec_ctx->pix_fmt == PIX_FMT_YUV444P |
49 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV444P10 |
50 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P |
51 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P10 |
52 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV420P |
53 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV420P10)) |
54 |
++ && (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P |
55 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P10 |
56 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P |
57 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P10 |
58 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV420P |
59 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV420P10)) |
60 |
+ { |
61 |
+- if (video_codec_ctx->pix_fmt == PIX_FMT_YUV444P |
62 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV444P10) |
63 |
++ if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P |
64 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P10) |
65 |
+ { |
66 |
+ video_frame_template.layout = video_frame::yuv444p; |
67 |
+ } |
68 |
+- else if (video_codec_ctx->pix_fmt == PIX_FMT_YUV422P |
69 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P10) |
70 |
++ else if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P |
71 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P10) |
72 |
+ { |
73 |
+ video_frame_template.layout = video_frame::yuv422p; |
74 |
+ } |
75 |
+@@ -453,9 +453,9 @@ void media_object::set_video_frame_templ |
76 |
+ { |
77 |
+ video_frame_template.color_space = video_frame::yuv709; |
78 |
+ } |
79 |
+- if (video_codec_ctx->pix_fmt == PIX_FMT_YUV444P10 |
80 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV422P10 |
81 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUV420P10) |
82 |
++ if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV444P10 |
83 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV422P10 |
84 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUV420P10) |
85 |
+ { |
86 |
+ video_frame_template.value_range = video_frame::u10_mpeg; |
87 |
+ if (video_codec_ctx->color_range == AVCOL_RANGE_JPEG) |
88 |
+@@ -482,15 +482,15 @@ void media_object::set_video_frame_templ |
89 |
+ } |
90 |
+ } |
91 |
+ else if (!_always_convert_to_bgra32 |
92 |
+- && (video_codec_ctx->pix_fmt == PIX_FMT_YUVJ444P |
93 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUVJ422P |
94 |
+- || video_codec_ctx->pix_fmt == PIX_FMT_YUVJ420P)) |
95 |
++ && (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ444P |
96 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ422P |
97 |
++ || video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ420P)) |
98 |
+ { |
99 |
+- if (video_codec_ctx->pix_fmt == PIX_FMT_YUVJ444P) |
100 |
++ if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ444P) |
101 |
+ { |
102 |
+ video_frame_template.layout = video_frame::yuv444p; |
103 |
+ } |
104 |
+- else if (video_codec_ctx->pix_fmt == PIX_FMT_YUVJ422P) |
105 |
++ else if (video_codec_ctx->pix_fmt == AV_PIX_FMT_YUVJ422P) |
106 |
+ { |
107 |
+ video_frame_template.layout = video_frame::yuv422p; |
108 |
+ } |
109 |
+@@ -898,15 +898,6 @@ void media_object::open(const std::strin |
110 |
+ // Activate multithreaded decoding. This must be done before opening the codec; see |
111 |
+ // http://lists.gnu.org/archive/html/bino-list/2011-08/msg00019.html |
112 |
+ codec_ctx->thread_count = video_decoding_threads(); |
113 |
+- // Set CODEC_FLAG_EMU_EDGE in the same situations in which ffplay sets it. |
114 |
+- // I don't know what exactly this does, but it is necessary to fix the problem |
115 |
+- // described in this thread: http://lists.nongnu.org/archive/html/bino-list/2012-02/msg00039.html |
116 |
+- int lowres = 0; |
117 |
+-#ifdef FF_API_LOWRES |
118 |
+- lowres = codec_ctx->lowres; |
119 |
+-#endif |
120 |
+- if (lowres || (codec && (codec->capabilities & CODEC_CAP_DR1))) |
121 |
+- codec_ctx->flags |= CODEC_FLAG_EMU_EDGE; |
122 |
+ } |
123 |
+ // Find and open the codec. AV_CODEC_ID_TEXT is a special case: it has no decoder since it is unencoded raw data. |
124 |
+ if (codec_ctx->codec_id != AV_CODEC_ID_TEXT && (!codec || (e = avcodec_open2(codec_ctx, codec, NULL)) < 0)) |
125 |
+@@ -944,8 +935,8 @@ void media_object::open(const std::strin |
126 |
+ _ffmpeg->video_frames.push_back(av_frame_alloc()); |
127 |
+ _ffmpeg->video_buffered_frames.push_back(av_frame_alloc()); |
128 |
+ #endif |
129 |
+- enum PixelFormat frame_fmt = (_ffmpeg->video_frame_templates[j].layout == video_frame::bgra32 |
130 |
+- ? PIX_FMT_BGRA : _ffmpeg->video_codec_ctxs[j]->pix_fmt); |
131 |
++ enum AVPixelFormat frame_fmt = (_ffmpeg->video_frame_templates[j].layout == video_frame::bgra32 |
132 |
++ ? AV_PIX_FMT_BGRA : _ffmpeg->video_codec_ctxs[j]->pix_fmt); |
133 |
+ int frame_bufsize = (avpicture_get_size(frame_fmt, |
134 |
+ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height)); |
135 |
+ _ffmpeg->video_buffers.push_back(static_cast<uint8_t *>(av_malloc(frame_bufsize))); |
136 |
+@@ -958,7 +949,7 @@ void media_object::open(const std::strin |
137 |
+ if (_ffmpeg->video_frame_templates[j].layout == video_frame::bgra32) |
138 |
+ { |
139 |
+ // Initialize things needed for software pixel format conversion |
140 |
+- int sws_bufsize = avpicture_get_size(PIX_FMT_BGRA, |
141 |
++ int sws_bufsize = avpicture_get_size(AV_PIX_FMT_BGRA, |
142 |
+ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height); |
143 |
+ #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) |
144 |
+ _ffmpeg->video_sws_frames.push_back(avcodec_alloc_frame()); |
145 |
+@@ -971,11 +962,11 @@ void media_object::open(const std::strin |
146 |
+ throw exc(HERE + ": " + strerror(ENOMEM)); |
147 |
+ } |
148 |
+ avpicture_fill(reinterpret_cast<AVPicture *>(_ffmpeg->video_sws_frames[j]), _ffmpeg->video_sws_buffers[j], |
149 |
+- PIX_FMT_BGRA, _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height); |
150 |
++ AV_PIX_FMT_BGRA, _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height); |
151 |
+ // Call sws_getCachedContext(NULL, ...) instead of sws_getContext(...) just to avoid a deprecation warning. |
152 |
+ _ffmpeg->video_sws_ctxs.push_back(sws_getCachedContext(NULL, |
153 |
+ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height, _ffmpeg->video_codec_ctxs[j]->pix_fmt, |
154 |
+- _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height, PIX_FMT_BGRA, |
155 |
++ _ffmpeg->video_codec_ctxs[j]->width, _ffmpeg->video_codec_ctxs[j]->height, AV_PIX_FMT_BGRA, |
156 |
+ SWS_POINT, NULL, NULL, NULL)); |
157 |
+ if (!_ffmpeg->video_sws_ctxs[j]) |
158 |
+ { |
159 |
+@@ -1529,7 +1520,7 @@ read_frame: |
160 |
+ // We need to buffer the data because FFmpeg will clubber it when decoding the next frame. |
161 |
+ av_picture_copy(reinterpret_cast<AVPicture *>(_ffmpeg->video_buffered_frames[_video_stream]), |
162 |
+ reinterpret_cast<AVPicture *>(_ffmpeg->video_frames[_video_stream]), |
163 |
+- static_cast<enum PixelFormat>(_ffmpeg->video_codec_ctxs[_video_stream]->pix_fmt), |
164 |
++ static_cast<enum AVPixelFormat>(_ffmpeg->video_codec_ctxs[_video_stream]->pix_fmt), |
165 |
+ _ffmpeg->video_codec_ctxs[_video_stream]->width, |
166 |
+ _ffmpeg->video_codec_ctxs[_video_stream]->height); |
167 |
+ src_frame = _ffmpeg->video_buffered_frames[_video_stream]; |