Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/libav/, media-video/libav/files/
Date: Fri, 05 Jul 2019 15:11:36
Message-Id: 1562339475.1fc52f0bb000f6710d41bca2cef07dec319bb46a.dilfridge@gentoo
1 commit: 1fc52f0bb000f6710d41bca2cef07dec319bb46a
2 Author: Andreas K. Huettel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 5 15:10:38 2019 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 5 15:11:15 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fc52f0b
7
8 media-video/libav: Fix build on stable, bug 681888
9
10 Closes: https://bugs.gentoo.org/681888
11 Package-Manager: Portage-2.3.67, Repoman-2.3.16
12 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
13
14 media-video/libav/files/libav-12.3-x264.patch | 85 +++++++++++++++++++++++++++
15 media-video/libav/libav-12.3.ebuild | 1 +
16 2 files changed, 86 insertions(+)
17
18 diff --git a/media-video/libav/files/libav-12.3-x264.patch b/media-video/libav/files/libav-12.3-x264.patch
19 new file mode 100644
20 index 00000000000..25c089bfeac
21 --- /dev/null
22 +++ b/media-video/libav/files/libav-12.3-x264.patch
23 @@ -0,0 +1,85 @@
24 +From c6558e8840fbb2386bf8742e4d68dd6e067d262e Mon Sep 17 00:00:00 2001
25 +From: Luca Barbato <lu_zero@g.o>
26 +Date: Tue, 26 Dec 2017 12:32:42 +0100
27 +Subject: [PATCH] x264: Support version 153
28 +
29 +It has native simultaneus 8 and 10 bit support.
30 +---
31 + libavcodec/libx264.c | 30 ++++++++++++++++++++++++++++++
32 + 1 file changed, 30 insertions(+)
33 +
34 +diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
35 +index 0dec12edd..3dc53aaf3 100644
36 +--- a/libavcodec/libx264.c
37 ++++ b/libavcodec/libx264.c
38 +@@ -243,7 +243,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
39 +
40 + x264_picture_init( &x4->pic );
41 + x4->pic.img.i_csp = x4->params.i_csp;
42 ++#if X264_BUILD >= 153
43 ++ if (x4->params.i_bitdepth > 8)
44 ++#else
45 + if (x264_bit_depth > 8)
46 ++#endif
47 + x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
48 + x4->pic.img.i_plane = 3;
49 +
50 +@@ -395,6 +399,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
51 + x4->params.p_log_private = avctx;
52 + x4->params.i_log_level = X264_LOG_DEBUG;
53 + x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
54 ++#if X264_BUILD >= 153
55 ++ x4->params.i_bitdepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
56 ++#endif
57 +
58 + if (avctx->bit_rate) {
59 + x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
60 +@@ -659,6 +666,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
61 + return 0;
62 + }
63 +
64 ++#if X264_BUILD < 153
65 + static const enum AVPixelFormat pix_fmts_8bit[] = {
66 + AV_PIX_FMT_YUV420P,
67 + AV_PIX_FMT_YUVJ420P,
68 +@@ -685,15 +693,37 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
69 + AV_PIX_FMT_NV20,
70 + AV_PIX_FMT_NONE
71 + };
72 ++#else
73 ++static const enum AVPixelFormat pix_fmts_all[] = {
74 ++ AV_PIX_FMT_YUV420P,
75 ++ AV_PIX_FMT_YUVJ420P,
76 ++ AV_PIX_FMT_YUV422P,
77 ++ AV_PIX_FMT_YUVJ422P,
78 ++ AV_PIX_FMT_YUV444P,
79 ++ AV_PIX_FMT_YUVJ444P,
80 ++ AV_PIX_FMT_NV12,
81 ++ AV_PIX_FMT_NV16,
82 ++ AV_PIX_FMT_NV21,
83 ++ AV_PIX_FMT_YUV420P10,
84 ++ AV_PIX_FMT_YUV422P10,
85 ++ AV_PIX_FMT_YUV444P10,
86 ++ AV_PIX_FMT_NV20,
87 ++ AV_PIX_FMT_NONE
88 ++};
89 ++#endif
90 +
91 + static av_cold void X264_init_static(AVCodec *codec)
92 + {
93 ++#if X264_BUILD < 153
94 + if (x264_bit_depth == 8)
95 + codec->pix_fmts = pix_fmts_8bit;
96 + else if (x264_bit_depth == 9)
97 + codec->pix_fmts = pix_fmts_9bit;
98 + else if (x264_bit_depth == 10)
99 + codec->pix_fmts = pix_fmts_10bit;
100 ++#else
101 ++ codec->pix_fmts = pix_fmts_all;
102 ++#endif
103 + }
104 +
105 + #define OFFSET(x) offsetof(X264Context, x)
106 +--
107 +2.21.0
108 +
109
110 diff --git a/media-video/libav/libav-12.3.ebuild b/media-video/libav/libav-12.3.ebuild
111 index 30617cd70e6..2e4a307f5bd 100644
112 --- a/media-video/libav/libav-12.3.ebuild
113 +++ b/media-video/libav/libav-12.3.ebuild
114 @@ -144,6 +144,7 @@ src_unpack() {
115
116 src_prepare() {
117 eapply_user
118 + eapply "${FILESDIR}/${P}-x264.patch" # bug 681888
119
120 # if we have snapshot then we need to hardcode the version
121 if [[ ${PV%_p*} != ${PV} ]]; then