Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-plugins/gst-plugins-libav/files/, media-plugins/gst-plugins-libav/
Date: Wed, 17 Feb 2016 21:08:34
Message-Id: 1455743287.f85d12e25f136a5418416704b1e8a37d041b4437.aballier@gentoo
1 commit: f85d12e25f136a5418416704b1e8a37d041b4437
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 17 21:06:14 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 17 21:08:07 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f85d12e2
7
8 media-plugins/gst-plugins-libav: Fix build and runtime with ffmpeg 3.0. Bug #574790.
9
10 Patches are all from upstream, except gst-plugins-libav-1.6.3-minr-compat.patch which is a small #ifdefery more by myself to preserve working options and passing tests with ffmpeg 2.8.
11
12 Package-Manager: portage-2.2.27
13 Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
14
15 .../files/gst-plugins-libav-1.6.3-bitrate.patch | 49 +++
16 .../gst-plugins-libav-1.6.3-chain-dispose.patch | 23 ++
17 .../gst-plugins-libav-1.6.3-deinterlace-lavf.patch | 199 ++++++++++++
18 .../gst-plugins-libav-1.6.3-minr-compat.patch | 22 ++
19 .../files/gst-plugins-libav-1.6.3-minr-maxr.patch | 74 +++++
20 .../gst-plugins-libav-1.6.3-no-deprecated.patch | 356 +++++++++++++++++++++
21 .../gst-plugins-libav-1.6.3.ebuild | 13 +-
22 7 files changed, 735 insertions(+), 1 deletion(-)
23
24 diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch
25 new file mode 100644
26 index 0000000..4c0510a
27 --- /dev/null
28 +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch
29 @@ -0,0 +1,49 @@
30 +commit 46fb2e9f11820190f2e173f4ebd83f0d15adea40
31 +Author: Sebastian Dröge <sebastian@×××××××××××.com>
32 +Date: Sat Jan 16 16:40:52 2016 +0200
33 +
34 + libav: Bitrate field changed from int to int64_t, fix compiler warnings
35 +
36 + Cast it to a gint64 for now though, as otherwise we will fail compilation
37 + with ffmpeg 2.8.
38 +
39 + https://bugzilla.gnome.org/show_bug.cgi?id=757498
40 +
41 +diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c
42 +index 64d7011..9a8e690 100644
43 +--- a/ext/libav/gstavaudenc.c
44 ++++ b/ext/libav/gstavaudenc.c
45 +@@ -269,8 +269,9 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
46 + ffmpegaudenc->context->bit_rate = ffmpegaudenc->bitrate;
47 + ffmpegaudenc->context->bit_rate_tolerance = ffmpegaudenc->bitrate;
48 + } else {
49 +- GST_INFO_OBJECT (ffmpegaudenc, "Using avcontext default bitrate %d",
50 +- ffmpegaudenc->context->bit_rate);
51 ++ GST_INFO_OBJECT (ffmpegaudenc,
52 ++ "Using avcontext default bitrate %" G_GINT64_FORMAT,
53 ++ (gint64) ffmpegaudenc->context->bit_rate);
54 + }
55 +
56 + /* RTP payload used for GOB production (for Asterisk) */
57 +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
58 +index 2f8dc8a..966c9b8 100644
59 +--- a/ext/libav/gstavcodecmap.c
60 ++++ b/ext/libav/gstavcodecmap.c
61 +@@ -2357,6 +2357,7 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
62 + GstStructure *structure;
63 + const gchar *fmt;
64 + GstAudioFormat format = GST_AUDIO_FORMAT_UNKNOWN;
65 ++ gint bitrate;
66 +
67 + g_return_if_fail (gst_caps_get_size (caps) == 1);
68 +
69 +@@ -2365,7 +2366,8 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
70 + gst_structure_get_int (structure, "channels", &context->channels);
71 + gst_structure_get_int (structure, "rate", &context->sample_rate);
72 + gst_structure_get_int (structure, "block_align", &context->block_align);
73 +- gst_structure_get_int (structure, "bitrate", &context->bit_rate);
74 ++ gst_structure_get_int (structure, "bitrate", &bitrate);
75 ++ context->bit_rate = bitrate;
76 +
77 + if (!raw)
78 + return;
79
80 diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch
81 new file mode 100644
82 index 0000000..de8947a
83 --- /dev/null
84 +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch
85 @@ -0,0 +1,23 @@
86 +commit e04bcf0601286990d0fa2dd9999fcfcff1b5784b
87 +Author: Sebastian Dröge <sebastian@×××××××××××.com>
88 +Date: Sat Jan 16 16:43:16 2016 +0200
89 +
90 + avdeinterlace: Chain up to parent class' dispose()
91 +
92 + https://bugzilla.gnome.org/show_bug.cgi?id=757498
93 +
94 +diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c
95 +index fe2d60d..6bdc605 100644
96 +--- a/ext/libav/gstavdeinterlace.c
97 ++++ b/ext/libav/gstavdeinterlace.c
98 +@@ -310,7 +310,10 @@ static void
99 + gst_ffmpegdeinterlace_dispose (GObject * obj)
100 + {
101 + GstFFMpegDeinterlace *deinterlace = GST_FFMPEGDEINTERLACE (obj);
102 ++
103 + delete_filter_graph (deinterlace);
104 ++
105 ++ G_OBJECT_CLASS (gst_ffmpegdeinterlace_parent_class)->dispose (obj);
106 + }
107 +
108 + static int
109
110 diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch
111 new file mode 100644
112 index 0000000..f53c854
113 --- /dev/null
114 +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch
115 @@ -0,0 +1,199 @@
116 +commit ddec3a2c78dd317efc1e9bc3ec0b2c49bf31ae77
117 +Author: Andreas Cadhalpun <Andreas.Cadhalpun@××××××××××.com>
118 +Date: Wed Nov 4 21:16:18 2015 +0100
119 +
120 + avdeinterlace: Port non-deprecated AVFilter API
121 +
122 + https://bugzilla.gnome.org/show_bug.cgi?id=757498
123 +
124 +diff --git a/configure.ac b/configure.ac
125 +index 19fa183..4d6fe94 100644
126 +--- a/configure.ac
127 ++++ b/configure.ac
128 +@@ -280,7 +280,7 @@ AC_ARG_WITH(system-libav,
129 + [AC_HELP_STRING([--with-system-libav], [use system Libav libraries])])
130 +
131 + if test "x$with_system_libav" = "xyes"; then
132 +- PKG_CHECK_MODULES(LIBAV, libavformat libavcodec libavutil)
133 ++ PKG_CHECK_MODULES(LIBAV, libavfilter libavformat libavcodec libavutil)
134 + PKG_CHECK_MODULES(SWSCALE, libswscale libavutil)
135 + saved_CPPFLAGS="$CPPFLAGS"
136 + CPPFLAGS="$CPPFLAGS $LIBAV_CFLAGS"
137 +@@ -313,6 +313,7 @@ else
138 +
139 + LIBAV_DEPS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
140 + \$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \
141 ++ \$(top_builddir)/gst-libs/ext/libav/libavfilter/libavfilter.a \
142 + \$(top_builddir)/gst-libs/ext/libav/libswresample/libswresample.a \
143 + \$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
144 + if test "x$enable_static_plugins" = xyes; then
145 +@@ -357,7 +358,7 @@ else
146 + # Enable pic and static so that we get .a files, but with PIC code.
147 + emblibav_configure_args="$emblibav_configure_args \
148 + --enable-static --enable-pic \
149 +- --disable-avdevice --disable-postproc --disable-avfilter \
150 ++ --disable-avdevice --disable-postproc \
151 + --disable-programs --disable-ffserver --disable-ffplay --disable-ffprobe --disable-ffmpeg \
152 + --disable-encoder=flac --disable-protocols --disable-devices \
153 + --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau \
154 +diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c
155 +index 2d142a6..6906059 100644
156 +--- a/ext/libav/gstavdeinterlace.c
157 ++++ b/ext/libav/gstavdeinterlace.c
158 +@@ -25,6 +25,9 @@
159 + #endif
160 +
161 + #include <libavcodec/avcodec.h>
162 ++#include <libavfilter/avfilter.h>
163 ++#include <libavfilter/buffersrc.h>
164 ++#include <libavfilter/buffersink.h>
165 +
166 + #include <gst/gst.h>
167 + #include <gst/video/video.h>
168 +@@ -93,6 +96,14 @@ typedef struct _GstFFMpegDeinterlace
169 +
170 + enum PixelFormat pixfmt;
171 + AVPicture from_frame, to_frame;
172 ++
173 ++ AVFilterContext *buffersink_ctx;
174 ++ AVFilterContext *buffersrc_ctx;
175 ++ AVFilterGraph *filter_graph;
176 ++ AVFrame *filter_frame;
177 ++ int last_width, last_height;
178 ++ enum AVPixelFormat last_pixfmt;
179 ++
180 + } GstFFMpegDeinterlace;
181 +
182 + typedef struct _GstFFMpegDeinterlaceClass
183 +@@ -135,6 +146,8 @@ G_DEFINE_TYPE (GstFFMpegDeinterlace, gst_ffmpegdeinterlace, GST_TYPE_ELEMENT);
184 + static GstFlowReturn gst_ffmpegdeinterlace_chain (GstPad * pad,
185 + GstObject * parent, GstBuffer * inbuf);
186 +
187 ++static void gst_ffmpegdeinterlace_dispose (GObject * obj);
188 ++
189 + static void
190 + gst_ffmpegdeinterlace_class_init (GstFFMpegDeinterlaceClass * klass)
191 + {
192 +@@ -167,6 +180,8 @@ gst_ffmpegdeinterlace_class_init (GstFFMpegDeinterlaceClass * klass)
193 + gst_element_class_set_static_metadata (element_class,
194 + "libav Deinterlace element", "Filter/Effect/Video/Deinterlace",
195 + "Deinterlace video", "Luca Ognibene <luogni@×××.it>");
196 ++
197 ++ gobject_class->dispose = gst_ffmpegdeinterlace_dispose;
198 + }
199 +
200 + static void
201 +@@ -277,6 +292,101 @@ gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace)
202 + deinterlace->reconfigure = FALSE;
203 + deinterlace->mode = DEFAULT_MODE;
204 + deinterlace->new_mode = -1;
205 ++ deinterlace->last_width = -1;
206 ++ deinterlace->last_height = -1;
207 ++ deinterlace->last_pixfmt = AV_PIX_FMT_NONE;
208 ++}
209 ++
210 ++static void
211 ++delete_filter_graph (GstFFMpegDeinterlace * deinterlace)
212 ++{
213 ++ if (deinterlace->filter_graph) {
214 ++ av_frame_free (&deinterlace->filter_frame);
215 ++ avfilter_graph_free (&deinterlace->filter_graph);
216 ++ }
217 ++}
218 ++
219 ++static void
220 ++gst_ffmpegdeinterlace_dispose (GObject * obj)
221 ++{
222 ++ GstFFMpegDeinterlace *deinterlace = GST_FFMPEGDEINTERLACE (obj);
223 ++ delete_filter_graph (deinterlace);
224 ++}
225 ++
226 ++static int
227 ++init_filter_graph (GstFFMpegDeinterlace * deinterlace,
228 ++ enum AVPixelFormat pixfmt, int width, int height)
229 ++{
230 ++ AVFilterInOut *inputs = NULL, *outputs = NULL;
231 ++ char args[512];
232 ++ int res;
233 ++
234 ++ delete_filter_graph (deinterlace);
235 ++ deinterlace->filter_graph = avfilter_graph_alloc ();
236 ++ snprintf (args, sizeof (args),
237 ++ "buffer=video_size=%dx%d:pix_fmt=%d:time_base=1/1:pixel_aspect=0/1[in];"
238 ++ "[in]yadif[out];" "[out]buffersink", width, height, pixfmt);
239 ++ res =
240 ++ avfilter_graph_parse2 (deinterlace->filter_graph, args, &inputs,
241 ++ &outputs);
242 ++ if (res < 0)
243 ++ return res;
244 ++ if (inputs || outputs)
245 ++ return -1;
246 ++ res = avfilter_graph_config (deinterlace->filter_graph, NULL);
247 ++ if (res < 0)
248 ++ return res;
249 ++
250 ++ deinterlace->buffersrc_ctx =
251 ++ avfilter_graph_get_filter (deinterlace->filter_graph, "Parsed_buffer_0");
252 ++ deinterlace->buffersink_ctx =
253 ++ avfilter_graph_get_filter (deinterlace->filter_graph,
254 ++ "Parsed_buffersink_2");
255 ++ if (!deinterlace->buffersrc_ctx || !deinterlace->buffersink_ctx)
256 ++ return -1;
257 ++ deinterlace->filter_frame = av_frame_alloc ();
258 ++ deinterlace->last_width = width;
259 ++ deinterlace->last_height = height;
260 ++ deinterlace->last_pixfmt = pixfmt;
261 ++
262 ++ return 0;
263 ++}
264 ++
265 ++static int
266 ++process_filter_graph (GstFFMpegDeinterlace * deinterlace, AVPicture * dst,
267 ++ const AVPicture * src, enum AVPixelFormat pixfmt, int width, int height)
268 ++{
269 ++ int res;
270 ++
271 ++ if (!deinterlace->filter_graph || width != deinterlace->last_width ||
272 ++ height != deinterlace->last_height
273 ++ || pixfmt != deinterlace->last_pixfmt) {
274 ++ res = init_filter_graph (deinterlace, pixfmt, width, height);
275 ++ if (res < 0)
276 ++ return res;
277 ++ }
278 ++
279 ++ memcpy (deinterlace->filter_frame->data, src->data, sizeof (src->data));
280 ++ memcpy (deinterlace->filter_frame->linesize, src->linesize,
281 ++ sizeof (src->linesize));
282 ++ deinterlace->filter_frame->width = width;
283 ++ deinterlace->filter_frame->height = height;
284 ++ deinterlace->filter_frame->format = pixfmt;
285 ++ res =
286 ++ av_buffersrc_add_frame (deinterlace->buffersrc_ctx,
287 ++ deinterlace->filter_frame);
288 ++ if (res < 0)
289 ++ return res;
290 ++ res =
291 ++ av_buffersink_get_frame (deinterlace->buffersink_ctx,
292 ++ deinterlace->filter_frame);
293 ++ if (res < 0)
294 ++ return res;
295 ++ av_picture_copy (dst, (const AVPicture *) deinterlace->filter_frame, pixfmt,
296 ++ width, height);
297 ++ av_frame_unref (deinterlace->filter_frame);
298 ++
299 ++ return 0;
300 + }
301 +
302 + static GstFlowReturn
303 +@@ -320,8 +430,9 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstObject * parent,
304 + gst_ffmpeg_avpicture_fill (&deinterlace->to_frame, to_map.data,
305 + deinterlace->pixfmt, deinterlace->width, deinterlace->height);
306 +
307 +- avpicture_deinterlace (&deinterlace->to_frame, &deinterlace->from_frame,
308 +- deinterlace->pixfmt, deinterlace->width, deinterlace->height);
309 ++ process_filter_graph (deinterlace, &deinterlace->to_frame,
310 ++ &deinterlace->from_frame, deinterlace->pixfmt, deinterlace->width,
311 ++ deinterlace->height);
312 + gst_buffer_unmap (outbuf, &to_map);
313 + gst_buffer_unmap (inbuf, &from_map);
314 +
315
316 diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch
317 new file mode 100644
318 index 0000000..70b2e0a
319 --- /dev/null
320 +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch
321 @@ -0,0 +1,22 @@
322 +Preserve compatibility with ffmpeg 2.8 for rc-min-rate option.
323 +
324 +Index: gst-libav-1.6.3/ext/libav/gstavcfg.c
325 +===================================================================
326 +--- gst-libav-1.6.3.orig/ext/libav/gstavcfg.c
327 ++++ gst-libav-1.6.3/ext/libav/gstavcfg.c
328 +@@ -524,9 +524,15 @@ gst_ffmpeg_cfg_init (void)
329 + #endif
330 + gst_ffmpeg_add_pspec (pspec, config.rc_max_rate, FALSE, mpeg, NULL);
331 +
332 ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0)
333 ++ pspec = g_param_spec_int ("rc-min-rate", "Ratecontrol Minimum Bitrate",
334 ++ "Ratecontrol Minimum Bitrate", 0, G_MAXINT, 0,
335 ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
336 ++#else
337 + pspec = g_param_spec_int64 ("rc-min-rate", "Ratecontrol Minimum Bitrate",
338 + "Ratecontrol Minimum Bitrate", 0, G_MAXINT64, 0,
339 + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
340 ++#endif
341 + gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL);
342 +
343 + pspec =
344
345 diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch
346 new file mode 100644
347 index 0000000..a3b4a91
348 --- /dev/null
349 +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch
350 @@ -0,0 +1,74 @@
351 +commit e3cf542215519f882b7570a4b59aad75a8d2d27a
352 +Author: Edward Hervey <edward@×××××××××××.com>
353 +Date: Tue Feb 16 16:32:38 2016 +0100
354 +
355 + avcfg: rc-min-rate and rc-max-rate are now 64bit integers
356 +
357 + Switch the gobject properties and internal handling to support that
358 +
359 +diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
360 +index d38cce1..a361994 100644
361 +--- a/ext/libav/gstavcfg.c
362 ++++ b/ext/libav/gstavcfg.c
363 +@@ -513,13 +513,19 @@ gst_ffmpeg_cfg_init (void)
364 + gst_ffmpeg_add_pspec (pspec, config.rc_buffer_aggressivity, FALSE, mpeg,
365 + NULL);
366 +
367 ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0)
368 + pspec = g_param_spec_int ("rc-max-rate", "Ratecontrol Maximum Bitrate",
369 + "Ratecontrol Maximum Bitrate", 0, G_MAXINT, 0,
370 + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
371 ++#else
372 ++ pspec = g_param_spec_int64 ("rc-max-rate", "Ratecontrol Maximum Bitrate",
373 ++ "Ratecontrol Maximum Bitrate", 0, G_MAXINT64, 0,
374 ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
375 ++#endif
376 + gst_ffmpeg_add_pspec (pspec, config.rc_max_rate, FALSE, mpeg, NULL);
377 +
378 +- pspec = g_param_spec_int ("rc-min-rate", "Ratecontrol Minimum Bitrate",
379 +- "Ratecontrol Minimum Bitrate", 0, G_MAXINT, 0,
380 ++ pspec = g_param_spec_int64 ("rc-min-rate", "Ratecontrol Minimum Bitrate",
381 ++ "Ratecontrol Minimum Bitrate", 0, G_MAXINT64, 0,
382 + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
383 + gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL);
384 +
385 +@@ -770,6 +776,15 @@ gst_ffmpeg_cfg_install_property (GstFFMpegVidEncClass * klass, guint base)
386 + : pint->default_value, pspec->flags);
387 + break;
388 + }
389 ++ case G_TYPE_INT64:{
390 ++ GParamSpecInt64 *pint = G_PARAM_SPEC_INT64 (pspec);
391 ++
392 ++ pspec = g_param_spec_int64 (name, nick, blurb,
393 ++ pint->minimum, pint->maximum,
394 ++ lavc_default ? G_STRUCT_MEMBER (gint64, ctx, ctx_offset)
395 ++ : pint->default_value, pspec->flags);
396 ++ break;
397 ++ }
398 + case G_TYPE_UINT:{
399 + GParamSpecUInt *puint = G_PARAM_SPEC_UINT (pspec);
400 +
401 +@@ -862,6 +877,11 @@ gst_ffmpeg_cfg_set_property (GObject * object,
402 + G_STRUCT_MEMBER (gint, ffmpegenc, qdata->offset) =
403 + g_value_get_int (value);
404 + break;
405 ++ case G_TYPE_INT64:
406 ++ g_return_val_if_fail (qdata->size == sizeof (gint64), TRUE);
407 ++ G_STRUCT_MEMBER (gint64, ffmpegenc, qdata->offset) =
408 ++ g_value_get_int64 (value);
409 ++ break;
410 + case G_TYPE_FLOAT:
411 + g_return_val_if_fail (qdata->size == sizeof (gfloat), TRUE);
412 + G_STRUCT_MEMBER (gfloat, ffmpegenc, qdata->offset) =
413 +@@ -924,6 +944,11 @@ gst_ffmpeg_cfg_get_property (GObject * object,
414 + g_return_val_if_fail (qdata->size == sizeof (gint), TRUE);
415 + g_value_set_int (value, G_STRUCT_MEMBER (gint, ffmpegenc, qdata->offset));
416 + break;
417 ++ case G_TYPE_INT64:
418 ++ g_return_val_if_fail (qdata->size == sizeof (gint64), TRUE);
419 ++ g_value_set_int64 (value, G_STRUCT_MEMBER (gint64, ffmpegenc,
420 ++ qdata->offset));
421 ++ break;
422 + case G_TYPE_FLOAT:
423 + g_return_val_if_fail (qdata->size == sizeof (gfloat), TRUE);
424 + g_value_set_float (value,
425
426 diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch
427 new file mode 100644
428 index 0000000..5788533
429 --- /dev/null
430 +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch
431 @@ -0,0 +1,356 @@
432 +commit 6235a04ef356f8d7e2f933758ddba359fa95a5ec
433 +Author: Andreas Cadhalpun <Andreas.Cadhalpun@××××××××××.com>
434 +Date: Wed Nov 4 21:18:56 2015 +0100
435 +
436 + libav: Remove usage of deprecated API
437 +
438 + https://bugzilla.gnome.org/show_bug.cgi?id=757498
439 +
440 +diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
441 +index a85f547..d38cce1 100644
442 +--- a/ext/libav/gstavcfg.c
443 ++++ b/ext/libav/gstavcfg.c
444 +@@ -173,13 +173,10 @@ gst_ffmpeg_idct_algo_get_type (void)
445 + {FF_IDCT_SIMPLEMMX, "Simple MMX", "simplemmx"},
446 + {FF_IDCT_ARM, "ARM", "arm"},
447 + {FF_IDCT_ALTIVEC, "Altivec", "altivec"},
448 +- {FF_IDCT_SH4, "SH4", "sh4"},
449 + {FF_IDCT_SIMPLEARM, "Simple ARM", "simplearm"},
450 +- {FF_IDCT_IPP, "IPP", "ipp"},
451 + {FF_IDCT_XVID, "XVID", "xvid"},
452 + {FF_IDCT_SIMPLEARMV5TE, "Simple ARMV5TE", "simplearmv5te"},
453 + {FF_IDCT_SIMPLEARMV6, "Simple ARMV6", "simplearmv6"},
454 +- {FF_IDCT_SIMPLEVIS, "Simple Vis", "simplevis"},
455 + {FF_IDCT_FAAN, "FAAN", "faan"},
456 + {FF_IDCT_SIMPLENEON, "Simple NEON", "simpleneon"},
457 + {0, NULL, NULL},
458 +@@ -665,7 +662,7 @@ gst_ffmpeg_cfg_init (void)
459 + gst_ffmpeg_add_pspec (pspec, interlaced, FALSE, mpeg, NULL);
460 +
461 + pspec = g_param_spec_int ("max-bframes", "Max B-Frames",
462 +- "Maximum B-frames in a row", 0, FF_MAX_B_FRAMES, 0,
463 ++ "Maximum B-frames in a row", 0, INT_MAX, 0,
464 + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
465 + gst_ffmpeg_add_pspec (pspec, config.max_b_frames, FALSE, mpeg, NULL);
466 +
467 +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
468 +index 11a9ed2..2f8dc8a 100644
469 +--- a/ext/libav/gstavcodecmap.c
470 ++++ b/ext/libav/gstavcodecmap.c
471 +@@ -770,10 +770,6 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
472 + }
473 + break;
474 +
475 +- case AV_CODEC_ID_MPEG2VIDEO_XVMC:
476 +- /* this is a special ID - don't need it in GStreamer, I think */
477 +- break;
478 +-
479 + case AV_CODEC_ID_H263:
480 + if (encode) {
481 + caps =
482 +@@ -2202,7 +2198,7 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
483 + */
484 +
485 + static GstCaps *
486 +-gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context,
487 ++gst_ffmpeg_pixfmt_to_caps (enum AVPixelFormat pix_fmt, AVCodecContext * context,
488 + enum AVCodecID codec_id)
489 + {
490 + GstCaps *caps = NULL;
491 +@@ -2533,7 +2529,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
492 + typedef struct
493 + {
494 + GstVideoFormat format;
495 +- enum PixelFormat pixfmt;
496 ++ enum AVPixelFormat pixfmt;
497 + } PixToFmt;
498 +
499 + /* FIXME : FILLME */
500 +@@ -2625,7 +2621,7 @@ static const PixToFmt pixtofmttable[] = {
501 + };
502 +
503 + GstVideoFormat
504 +-gst_ffmpeg_pixfmt_to_videoformat (enum PixelFormat pixfmt)
505 ++gst_ffmpeg_pixfmt_to_videoformat (enum AVPixelFormat pixfmt)
506 + {
507 + guint i;
508 +
509 +@@ -2637,7 +2633,7 @@ gst_ffmpeg_pixfmt_to_videoformat (enum PixelFormat pixfmt)
510 + return GST_VIDEO_FORMAT_UNKNOWN;
511 + }
512 +
513 +-static enum PixelFormat
514 ++static enum AVPixelFormat
515 + gst_ffmpeg_videoformat_to_pixfmt_for_codec (GstVideoFormat format,
516 + const AVCodec * codec)
517 + {
518 +@@ -2661,7 +2657,7 @@ gst_ffmpeg_videoformat_to_pixfmt_for_codec (GstVideoFormat format,
519 + return AV_PIX_FMT_NONE;
520 + }
521 +
522 +-enum PixelFormat
523 ++enum AVPixelFormat
524 + gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format)
525 + {
526 + return gst_ffmpeg_videoformat_to_pixfmt_for_codec (format, NULL);
527 +diff --git a/ext/libav/gstavcodecmap.h b/ext/libav/gstavcodecmap.h
528 +index 40f46c3..486a0d5 100644
529 +--- a/ext/libav/gstavcodecmap.h
530 ++++ b/ext/libav/gstavcodecmap.h
531 +@@ -132,8 +132,8 @@ void
532 + gst_ffmpeg_audioinfo_to_context (GstAudioInfo *info,
533 + AVCodecContext *context);
534 +
535 +-GstVideoFormat gst_ffmpeg_pixfmt_to_videoformat (enum PixelFormat pixfmt);
536 +-enum PixelFormat gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format);
537 ++GstVideoFormat gst_ffmpeg_pixfmt_to_videoformat (enum AVPixelFormat pixfmt);
538 ++enum AVPixelFormat gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format);
539 +
540 + GstAudioFormat gst_ffmpeg_smpfmt_to_audioformat (enum AVSampleFormat sample_fmt);
541 +
542 +diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c
543 +index 6906059..fe2d60d 100644
544 +--- a/ext/libav/gstavdeinterlace.c
545 ++++ b/ext/libav/gstavdeinterlace.c
546 +@@ -94,7 +94,7 @@ typedef struct _GstFFMpegDeinterlace
547 + gboolean reconfigure;
548 + GstFFMpegDeinterlaceMode new_mode;
549 +
550 +- enum PixelFormat pixfmt;
551 ++ enum AVPixelFormat pixfmt;
552 + AVPicture from_frame, to_frame;
553 +
554 + AVFilterContext *buffersink_ctx;
555 +diff --git a/ext/libav/gstavutils.c b/ext/libav/gstavutils.c
556 +index c434202..5d1567b 100644
557 +--- a/ext/libav/gstavutils.c
558 ++++ b/ext/libav/gstavutils.c
559 +@@ -279,7 +279,7 @@ gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height)
560 +
561 + int
562 + gst_ffmpeg_avpicture_fill (AVPicture * picture,
563 +- uint8_t * ptr, enum PixelFormat pix_fmt, int width, int height)
564 ++ uint8_t * ptr, enum AVPixelFormat pix_fmt, int width, int height)
565 + {
566 + int size, w2, h2, size2;
567 + int stride, stride2;
568 +diff --git a/ext/libav/gstavutils.h b/ext/libav/gstavutils.h
569 +index 6d111a2..f4d90ef 100644
570 +--- a/ext/libav/gstavutils.h
571 ++++ b/ext/libav/gstavutils.h
572 +@@ -42,7 +42,7 @@ gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height);
573 + int
574 + gst_ffmpeg_avpicture_fill (AVPicture * picture,
575 + uint8_t * ptr,
576 +- enum PixelFormat pix_fmt,
577 ++ enum AVPixelFormat pix_fmt,
578 + int width,
579 + int height);
580 +
581 +diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
582 +index da9acf6..cc0cf03 100644
583 +--- a/ext/libav/gstavviddec.c
584 ++++ b/ext/libav/gstavviddec.c
585 +@@ -444,9 +444,6 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
586 +
587 + /* set buffer functions */
588 + ffmpegdec->context->get_buffer2 = gst_ffmpegviddec_get_buffer2;
589 +- ffmpegdec->context->get_buffer = NULL;
590 +- ffmpegdec->context->reget_buffer = NULL;
591 +- ffmpegdec->context->release_buffer = NULL;
592 + ffmpegdec->context->draw_horiz_band = NULL;
593 +
594 + /* reset coded_width/_height to prevent it being reused from last time when
595 +@@ -825,10 +822,6 @@ gst_ffmpegviddec_get_buffer2 (AVCodecContext * context, AVFrame * picture,
596 +
597 + picture->buf[0] = av_buffer_create (NULL, 0, dummy_free_buffer, dframe, 0);
598 +
599 +- /* tell ffmpeg we own this buffer, transfer the ref we have on the buffer to
600 +- * the opaque data. */
601 +- picture->type = FF_BUFFER_TYPE_USER;
602 +-
603 + GST_LOG_OBJECT (ffmpegdec, "returned frame %p", dframe->buffer);
604 +
605 + return 0;
606 +@@ -1355,8 +1348,6 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
607 + (guint64) ffmpegdec->picture->pts);
608 + GST_DEBUG_OBJECT (ffmpegdec, "picture: num %d",
609 + ffmpegdec->picture->coded_picture_number);
610 +- GST_DEBUG_OBJECT (ffmpegdec, "picture: ref %d",
611 +- ffmpegdec->picture->reference);
612 + GST_DEBUG_OBJECT (ffmpegdec, "picture: display %d",
613 + ffmpegdec->picture->display_picture_number);
614 + GST_DEBUG_OBJECT (ffmpegdec, "picture: opaque %p",
615 +diff --git a/ext/libav/gstavviddec.h b/ext/libav/gstavviddec.h
616 +index f152ba8..a9965b7 100644
617 +--- a/ext/libav/gstavviddec.h
618 ++++ b/ext/libav/gstavviddec.h
619 +@@ -41,7 +41,7 @@ struct _GstFFMpegVidDec
620 + gboolean opened;
621 +
622 + /* current output pictures */
623 +- enum PixelFormat pic_pix_fmt;
624 ++ enum AVPixelFormat pic_pix_fmt;
625 + gint pic_width;
626 + gint pic_height;
627 + gint pic_par_n;
628 +@@ -70,7 +70,7 @@ struct _GstFFMpegVidDec
629 + GstBufferPool *internal_pool;
630 + gint pool_width;
631 + gint pool_height;
632 +- enum PixelFormat pool_format;
633 ++ enum AVPixelFormat pool_format;
634 + GstVideoInfo pool_info;
635 + };
636 +
637 +diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c
638 +index 1df1699..94aca49 100644
639 +--- a/ext/libav/gstavvidenc.c
640 ++++ b/ext/libav/gstavvidenc.c
641 +@@ -290,7 +290,7 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
642 + GstCaps *allowed_caps;
643 + GstCaps *icaps;
644 + GstVideoCodecState *output_format;
645 +- enum PixelFormat pix_fmt;
646 ++ enum AVPixelFormat pix_fmt;
647 + GstFFMpegVidEnc *ffmpegenc = (GstFFMpegVidEnc *) encoder;
648 + GstFFMpegVidEncClass *oclass =
649 + (GstFFMpegVidEncClass *) G_OBJECT_GET_CLASS (ffmpegenc);
650 +diff --git a/ext/libswscale/gstffmpegscale.c b/ext/libswscale/gstffmpegscale.c
651 +index f34259b..62343d0 100644
652 +--- a/ext/libswscale/gstffmpegscale.c
653 ++++ b/ext/libswscale/gstffmpegscale.c
654 +@@ -45,7 +45,7 @@ typedef struct _GstFFMpegScale
655 + /* state */
656 + GstVideoInfo in_info, out_info;
657 +
658 +- enum PixelFormat in_pixfmt, out_pixfmt;
659 ++ enum AVPixelFormat in_pixfmt, out_pixfmt;
660 + struct SwsContext *ctx;
661 +
662 + /* property */
663 +@@ -214,8 +214,8 @@ gst_ffmpegscale_init (GstFFMpegScale * scale)
664 + {
665 + scale->method = DEFAULT_PROP_METHOD;
666 + scale->ctx = NULL;
667 +- scale->in_pixfmt = PIX_FMT_NONE;
668 +- scale->out_pixfmt = PIX_FMT_NONE;
669 ++ scale->in_pixfmt = AV_PIX_FMT_NONE;
670 ++ scale->out_pixfmt = AV_PIX_FMT_NONE;
671 + }
672 +
673 + static void
674 +@@ -226,8 +226,8 @@ gst_ffmpegscale_reset (GstFFMpegScale * scale)
675 + scale->ctx = NULL;
676 + }
677 +
678 +- scale->in_pixfmt = PIX_FMT_NONE;
679 +- scale->out_pixfmt = PIX_FMT_NONE;
680 ++ scale->in_pixfmt = AV_PIX_FMT_NONE;
681 ++ scale->out_pixfmt = AV_PIX_FMT_NONE;
682 + }
683 +
684 + static void
685 +@@ -442,11 +442,11 @@ gst_ffmpegscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
686 +
687 + /* Convert a GstCaps (video/raw) to a FFMPEG PixFmt
688 + */
689 +-static enum PixelFormat
690 ++static enum AVPixelFormat
691 + gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps)
692 + {
693 + GstVideoInfo info;
694 +- enum PixelFormat pix_fmt;
695 ++ enum AVPixelFormat pix_fmt;
696 +
697 + GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps);
698 +
699 +@@ -455,52 +455,52 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps)
700 +
701 + switch (GST_VIDEO_INFO_FORMAT (&info)) {
702 + case GST_VIDEO_FORMAT_YUY2:
703 +- pix_fmt = PIX_FMT_YUYV422;
704 ++ pix_fmt = AV_PIX_FMT_YUYV422;
705 + break;
706 + case GST_VIDEO_FORMAT_UYVY:
707 +- pix_fmt = PIX_FMT_UYVY422;
708 ++ pix_fmt = AV_PIX_FMT_UYVY422;
709 + break;
710 + case GST_VIDEO_FORMAT_I420:
711 +- pix_fmt = PIX_FMT_YUV420P;
712 ++ pix_fmt = AV_PIX_FMT_YUV420P;
713 + break;
714 + case GST_VIDEO_FORMAT_Y41B:
715 +- pix_fmt = PIX_FMT_YUV411P;
716 ++ pix_fmt = AV_PIX_FMT_YUV411P;
717 + break;
718 + case GST_VIDEO_FORMAT_Y42B:
719 +- pix_fmt = PIX_FMT_YUV422P;
720 ++ pix_fmt = AV_PIX_FMT_YUV422P;
721 + break;
722 + case GST_VIDEO_FORMAT_YUV9:
723 +- pix_fmt = PIX_FMT_YUV410P;
724 ++ pix_fmt = AV_PIX_FMT_YUV410P;
725 + break;
726 + case GST_VIDEO_FORMAT_ARGB:
727 +- pix_fmt = PIX_FMT_ARGB;
728 ++ pix_fmt = AV_PIX_FMT_ARGB;
729 + break;
730 + case GST_VIDEO_FORMAT_RGBA:
731 +- pix_fmt = PIX_FMT_RGBA;
732 ++ pix_fmt = AV_PIX_FMT_RGBA;
733 + break;
734 + case GST_VIDEO_FORMAT_BGRA:
735 +- pix_fmt = PIX_FMT_BGRA;
736 ++ pix_fmt = AV_PIX_FMT_BGRA;
737 + break;
738 + case GST_VIDEO_FORMAT_ABGR:
739 +- pix_fmt = PIX_FMT_ABGR;
740 ++ pix_fmt = AV_PIX_FMT_ABGR;
741 + break;
742 + case GST_VIDEO_FORMAT_BGR:
743 +- pix_fmt = PIX_FMT_BGR24;
744 ++ pix_fmt = AV_PIX_FMT_BGR24;
745 + break;
746 + case GST_VIDEO_FORMAT_RGB:
747 +- pix_fmt = PIX_FMT_RGB24;
748 ++ pix_fmt = AV_PIX_FMT_RGB24;
749 + break;
750 + case GST_VIDEO_FORMAT_RGB16:
751 +- pix_fmt = PIX_FMT_RGB565;
752 ++ pix_fmt = AV_PIX_FMT_RGB565;
753 + break;
754 + case GST_VIDEO_FORMAT_RGB15:
755 +- pix_fmt = PIX_FMT_RGB555;
756 ++ pix_fmt = AV_PIX_FMT_RGB555;
757 + break;
758 + case GST_VIDEO_FORMAT_RGB8P:
759 +- pix_fmt = PIX_FMT_PAL8;
760 ++ pix_fmt = AV_PIX_FMT_PAL8;
761 + break;
762 + default:
763 +- pix_fmt = PIX_FMT_NONE;
764 ++ pix_fmt = AV_PIX_FMT_NONE;
765 + break;
766 + }
767 + return pix_fmt;
768 +@@ -508,7 +508,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps)
769 + /* ERROR */
770 + invalid_caps:
771 + {
772 +- return PIX_FMT_NONE;
773 ++ return AV_PIX_FMT_NONE;
774 + }
775 + }
776 +
777 +@@ -537,8 +537,8 @@ gst_ffmpegscale_set_caps (GstBaseTransform * trans, GstCaps * incaps,
778 + scale->in_pixfmt = gst_ffmpeg_caps_to_pixfmt (incaps);
779 + scale->out_pixfmt = gst_ffmpeg_caps_to_pixfmt (outcaps);
780 +
781 +- if (!ok || scale->in_pixfmt == PIX_FMT_NONE ||
782 +- scale->out_pixfmt == PIX_FMT_NONE ||
783 ++ if (!ok || scale->in_pixfmt == AV_PIX_FMT_NONE ||
784 ++ scale->out_pixfmt == AV_PIX_FMT_NONE ||
785 + GST_VIDEO_INFO_FORMAT (&scale->in_info) == GST_VIDEO_FORMAT_UNKNOWN ||
786 + GST_VIDEO_INFO_FORMAT (&scale->out_info) == GST_VIDEO_FORMAT_UNKNOWN)
787 + goto refuse_caps;
788
789 diff --git a/media-plugins/gst-plugins-libav/gst-plugins-libav-1.6.3.ebuild b/media-plugins/gst-plugins-libav/gst-plugins-libav-1.6.3.ebuild
790 index 320ac6e..d2d35c4 100644
791 --- a/media-plugins/gst-plugins-libav/gst-plugins-libav-1.6.3.ebuild
792 +++ b/media-plugins/gst-plugins-libav/gst-plugins-libav-1.6.3.ebuild
793 @@ -3,7 +3,7 @@
794 # $Id$
795
796 EAPI="5"
797 -inherit eutils multilib-minimal
798 +inherit eutils multilib-minimal autotools
799
800 MY_PN="gst-libav"
801 DESCRIPTION="FFmpeg based gstreamer plugin"
802 @@ -31,6 +31,17 @@ DEPEND="${RDEPEND}
803
804 S="${WORKDIR}/${MY_PN}-${PV}"
805
806 +src_prepare() {
807 + epatch \
808 + "${FILESDIR}/${PN}-1.6.3-deinterlace-lavf.patch" \
809 + "${FILESDIR}/${PN}-1.6.3-no-deprecated.patch" \
810 + "${FILESDIR}/${PN}-1.6.3-bitrate.patch" \
811 + "${FILESDIR}/${PN}-1.6.3-chain-dispose.patch" \
812 + "${FILESDIR}/${PN}-1.6.3-minr-maxr.patch" \
813 + "${FILESDIR}/${PN}-1.6.3-minr-compat.patch"
814 + eautoreconf
815 +}
816 +
817 multilib_src_configure() {
818 GST_PLUGINS_BUILD=""
819 # Upstream dropped support for system libav and won't work