Gentoo Archives: gentoo-commits

From: "PaweA Hajdan (phajdan.jr)" <phajdan.jr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/chromium/files: chromium-system-ffmpeg-r2.patch
Date: Tue, 26 Feb 2013 19:01:51
Message-Id: 20130226190147.51BCA20081@flycatcher.gentoo.org
1 phajdan.jr 13/02/26 19:01:47
2
3 Added: chromium-system-ffmpeg-r2.patch
4 Log:
5 Dev channel bump. Remove old.
6
7 (Portage version: 2.1.11.50/cvs/Linux i686, signed Manifest commit with key 30427902)
8
9 Revision Changes Path
10 1.1 www-client/chromium/files/chromium-system-ffmpeg-r2.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/files/chromium-system-ffmpeg-r2.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/files/chromium-system-ffmpeg-r2.patch?rev=1.1&content-type=text/plain
14
15 Index: chromium-system-ffmpeg-r2.patch
16 ===================================================================
17 diff --git a/media/filters/ffmpeg_glue.h b/media/filters/ffmpeg_glue.h
18 index 17241b9..8a92312 100644
19 --- a/media/filters/ffmpeg_glue.h
20 +++ b/media/filters/ffmpeg_glue.h
21 @@ -28,9 +28,9 @@
22 #include "base/basictypes.h"
23 #include "base/memory/scoped_ptr.h"
24 #include "media/base/media_export.h"
25 +#include "media/ffmpeg/ffmpeg_common.h"
26
27 struct AVFormatContext;
28 -struct AVIOContext;
29
30 namespace media {
31
32 diff --git a/media/media.gyp b/media/media.gyp
33 index df217d2..fde3830 100644
34 --- a/media/media.gyp
35 +++ b/media/media.gyp
36 @@ -363,6 +363,9 @@
37 'dependencies': [
38 '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
39 ],
40 + 'export_dependent_settings': [
41 + '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
42 + ],
43 }, { # use_ffmpeg == 0
44 # Exclude the sources that depend on ffmpeg.
45 'sources!': [
46 diff --git a/webkit/media/webkit_media.gypi b/webkit/media/webkit_media.gypi
47 index 81b770c..7b6d673 100644
48 --- a/webkit/media/webkit_media.gypi
49 +++ b/webkit/media/webkit_media.gypi
50 @@ -24,6 +24,7 @@
51 'dependencies': [
52 '<(DEPTH)/base/base.gyp:base',
53 '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
54 + '<(DEPTH)/media/media.gyp:media',
55 '<(DEPTH)/media/media.gyp:shared_memory_support',
56 '<(DEPTH)/media/media.gyp:yuv_convert',
57 '<(DEPTH)/skia/skia.gyp:skia',
58 --- a/media/ffmpeg/ffmpeg_common.cc.orig 2013-01-17 00:07:51.635057013 +0000
59 +++ b/media/ffmpeg/ffmpeg_common.cc 2013-01-17 00:15:50.867406811 +0000
60 @@ -10,6 +10,8 @@
61 #include "media/base/video_frame.h"
62 #include "media/base/video_util.h"
63
64 +#undef SampleFormat
65 +
66 namespace media {
67
68 // Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
69 Index: build/common.gypi
70 diff --git a/build/common.gypi b/build/common.gypi
71 index 34c6a15e0add1001e4a24712c9c809e3b698a390..521decfa19d102263086ebf4de7c8bac74c95e30 100644
72 --- a/build/common.gypi
73 +++ b/build/common.gypi
74 @@ -741,6 +741,9 @@
75 'google_default_client_secret%': '<(google_default_client_secret)',
76 'enable_managed_users%': '<(enable_managed_users)',
77
78 + # Use system ffmpeg instead of bundled one.
79 + 'use_system_ffmpeg%': 0,
80 +
81 # Use system mesa instead of bundled one.
82 'use_system_mesa%': 0,
83
84 Index: media/ffmpeg/ffmpeg_common.cc
85 diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
86 index 26953efc699a0dc1ce9cd951eb47b04713974b44..bf234304aa2b26fb7e0f729a4e75257099c00358 100644
87 --- a/media/ffmpeg/ffmpeg_common.cc
88 +++ b/media/ffmpeg/ffmpeg_common.cc
89 @@ -84,8 +84,10 @@ AudioCodec CodecIDToAudioCodec(CodecID codec_id) {
90 return kCodecGSM_MS;
91 case CODEC_ID_PCM_MULAW:
92 return kCodecPCM_MULAW;
93 +#ifndef CHROMIUM_OMIT_CODEC_ID_OPUS
94 case CODEC_ID_OPUS:
95 return kCodecOpus;
96 +#endif
97 default:
98 DVLOG(1) << "Unknown audio CodecID: " << codec_id;
99 }
100 @@ -129,8 +131,10 @@ static CodecID AudioCodecToCodecID(AudioCodec audio_codec,
101 return CODEC_ID_GSM_MS;
102 case kCodecPCM_MULAW:
103 return CODEC_ID_PCM_MULAW;
104 +#ifndef CHROMIUM_OMIT_CODEC_ID_OPUS
105 case kCodecOpus:
106 return CODEC_ID_OPUS;
107 +#endif
108 default:
109 DVLOG(1) << "Unknown AudioCodec: " << audio_codec;
110 }
111 @@ -147,8 +151,10 @@ VideoCodec CodecIDToVideoCodec(CodecID codec_id) {
112 return kCodecMPEG4;
113 case CODEC_ID_VP8:
114 return kCodecVP8;
115 +#ifndef CHROMIUM_OMIT_AV_CODEC_ID_VP9
116 case AV_CODEC_ID_VP9:
117 return kCodecVP9;
118 +#endif
119 default:
120 DVLOG(1) << "Unknown video CodecID: " << codec_id;
121 }
122 @@ -165,8 +171,10 @@ static CodecID VideoCodecToCodecID(VideoCodec video_codec) {
123 return CODEC_ID_MPEG4;
124 case kCodecVP8:
125 return CODEC_ID_VP8;
126 +#ifndef CHROMIUM_OMIT_AV_CODEC_ID_VP9
127 case kCodecVP9:
128 return AV_CODEC_ID_VP9;
129 +#endif
130 default:
131 DVLOG(1) << "Unknown VideoCodec: " << video_codec;
132 }
133 @@ -468,8 +476,10 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
134 return CHANNEL_LAYOUT_6_1_FRONT;
135 case AV_CH_LAYOUT_7POINT0_FRONT:
136 return CHANNEL_LAYOUT_7_0_FRONT;
137 +#ifdef AV_CH_LAYOUT_7POINT1_WIDE_BACK
138 case AV_CH_LAYOUT_7POINT1_WIDE_BACK:
139 return CHANNEL_LAYOUT_7_1_WIDE_BACK;
140 +#endif
141 case AV_CH_LAYOUT_OCTAGONAL:
142 return CHANNEL_LAYOUT_OCTAGONAL;
143 default:
144 Index: media/media.gyp
145 diff --git a/media/media.gyp b/media/media.gyp
146 index f514dec48e5cc78567d141f20e2cb970a8707e92..75b62bebb503e2d9488bf0fc5cec3fd0a7e1916d 100644
147 --- a/media/media.gyp
148 +++ b/media/media.gyp
149 @@ -469,6 +469,18 @@
150 'filters/vpx_video_decoder.h',
151 ],
152 }],
153 + ['use_system_ffmpeg == 1', {
154 + 'defines': [
155 + '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
156 + '--code "#include <libavcodec/avcodec.h>\n'
157 + 'int test() { return CODEC_ID_OPUS; }" '
158 + '--on-failure CHROMIUM_OMIT_CODEC_ID_OPUS)',
159 + '<!(python <(DEPTH)/tools/compile_test/compile_test.py '
160 + '--code "#include <libavcodec/avcodec.h>\n'
161 + 'int test() { return AV_CODEC_ID_VP9; }" '
162 + '--on-failure CHROMIUM_OMIT_AV_CODEC_ID_VP9)',
163 + ],
164 + }],
165 ['OS == "ios"', {
166 'includes': [
167 # For shared_memory_support_sources variable.
168 Index: tools/compile_test/compile_test.py
169 diff --git a/tools/compile_test/compile_test.py b/tools/compile_test/compile_test.py
170 new file mode 100755
171 index 0000000000000000000000000000000000000000..a52c0720209142af858d656a071ca43328dd3b16
172 --- /dev/null
173 +++ b/tools/compile_test/compile_test.py
174 @@ -0,0 +1,57 @@
175 +#!/usr/bin/env python
176 +# Copyright (c) 2013 The Chromium Authors. All rights reserved.
177 +# Use of this source code is governed by a BSD-style license that can be
178 +# found in the LICENSE file.
179 +
180 +"""
181 +Tries to compile given code, produces different output depending on success.
182 +
183 +This is similar to checks done by ./configure scripts.
184 +"""
185 +
186 +
187 +import optparse
188 +import os
189 +import shutil
190 +import subprocess
191 +import sys
192 +import tempfile
193 +
194 +
195 +def DoMain(argv):
196 + parser = optparse.OptionParser()
197 + parser.add_option('--code')
198 + parser.add_option('--on-success', default='')
199 + parser.add_option('--on-failure', default='')
200 +
201 + options, args = parser.parse_args(argv)
202 +
203 + if not options.code:
204 + parser.error('Missing required --code switch.')
205 +
206 + cxx = os.environ.get('CXX', 'g++')
207 +
208 + tmpdir = tempfile.mkdtemp()
209 + try:
210 + cxx_path = os.path.join(tmpdir, 'test.cc')
211 + with open(cxx_path, 'w') as f:
212 + f.write(options.code.decode('string-escape'))
213 +
214 + o_path = os.path.join(tmpdir, 'test.o')
215 +
216 + cxx_popen = subprocess.Popen([cxx, cxx_path, '-o', o_path, '-c'],
217 + stdout=subprocess.PIPE,
218 + stderr=subprocess.PIPE)
219 + cxx_stdout, cxx_stderr = cxx_popen.communicate()
220 + if cxx_popen.returncode == 0:
221 + print options.on_success
222 + else:
223 + print options.on_failure
224 + finally:
225 + shutil.rmtree(tmpdir)
226 +
227 + return 0
228 +
229 +
230 +if __name__ == '__main__':
231 + sys.exit(DoMain(sys.argv[1:]))