1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/android/config.gni")
6 import("//build/config/arm.gni")
7 import("//build/config/ui.gni")
8 import("//build/config/linux/pkg_config.gni")
9 import("//media/media_options.gni")
13 "audio_block_fifo.cc",
17 "audio_buffer_queue.cc",
18 "audio_buffer_queue.h",
19 "audio_capturer_source.h",
20 "audio_buffer_converter.cc",
21 "audio_buffer_converter.h",
26 "audio_decoder_config.cc",
27 "audio_decoder_config.h",
28 "audio_discard_helper.cc",
29 "audio_discard_helper.h",
32 "audio_hardware_config.cc",
33 "audio_hardware_config.h",
40 "audio_renderer_mixer.cc",
41 "audio_renderer_mixer.h",
42 "audio_renderer_mixer_input.cc",
43 "audio_renderer_mixer_input.h",
44 "audio_renderer_sink.h",
47 "audio_timestamp_helper.cc",
48 "audio_timestamp_helper.h",
49 "bind_to_current_loop.h",
70 "decoder_buffer_queue.cc",
71 "decoder_buffer_queue.h",
80 "demuxer_stream_provider.cc",
81 "demuxer_stream_provider.h",
93 "multi_channel_resampler.cc",
94 "multi_channel_resampler.h",
106 "scoped_histogram_timer.h",
107 "seekable_buffer.cc",
111 "simd/convert_rgb_to_yuv.h",
112 "simd/convert_rgb_to_yuv_c.cc",
113 "simd/convert_yuv_to_rgb.h",
114 "simd/convert_yuv_to_rgb_c.cc",
116 "simd/filter_yuv_c.cc",
117 "simd/yuv_to_rgb_table.cc",
118 "simd/yuv_to_rgb_table.h",
123 "stream_parser_buffer.cc",
124 "stream_parser_buffer.h",
132 "text_track_config.cc",
133 "text_track_config.h",
134 "time_delta_interpolator.cc",
135 "time_delta_interpolator.h",
137 "user_input_monitor.cc",
138 "user_input_monitor.h",
141 "video_decoder_config.cc",
142 "video_decoder_config.h",
145 "video_frame_pool.cc",
146 "video_frame_pool.h",
152 "wall_clock_time_source.cc",
153 "wall_clock_time_source.h",
160 configs += [ "//media:media_config" ]
162 if (media_use_ffmpeg) {
164 "audio_video_metadata_extractor.cc",
165 "audio_video_metadata_extractor.h",
166 "container_names.cc",
168 "media_file_checker.cc",
169 "media_file_checker.h",
171 deps += [ "//third_party/ffmpeg" ]
174 if (enable_browser_cdms) {
178 "browser_cdm_factory.h",
183 sources += [ "media_stub.cc" ]
185 sources += [ "media_win.cc" ]
186 } else if (is_posix) {
187 sources += [ "media_posix.cc" ]
190 if (is_linux && use_x11) {
192 "//build/config/linux:x11",
193 "//build/config/linux:xext",
194 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
195 # "//build/config/linux:xdamage",
196 # "//build/config/linux:xfixes",
197 # "//build/config/linux:xtst",
199 sources += [ "user_input_monitor_linux.cc" ]
201 "//ui/events:events_base",
205 sources += [ "user_input_monitor_mac.cc" ]
207 sources += [ "user_input_monitor_win.cc" ]
209 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
212 if (cpu_arch == "x86" || cpu_arch == "x64") {
213 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
220 if (is_linux || is_win) {
222 "keyboard_event_counter.cc",
223 "keyboard_event_counter.h",
228 # Minimal media component for media/cast on iOS.
229 config("base_for_cast_ios_dependent_config") {
230 defines = [ "MEDIA_FOR_CAST_IOS" ]
233 source_set("base_for_cast_ios") {
238 configs += [ "//media:media_config" ]
239 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
242 source_set("test_support") {
245 "fake_audio_render_callback.cc",
246 "fake_audio_render_callback.h",
247 "fake_audio_renderer_sink.cc",
248 "fake_audio_renderer_sink.h",
249 "fake_text_track_stream.cc",
250 "fake_text_track_stream.h",
251 "gmock_callback_support.h",
252 "mock_audio_renderer_sink.cc",
253 "mock_audio_renderer_sink.h",
254 "mock_demuxer_host.cc",
255 "mock_demuxer_host.h",
263 configs += [ "//media:media_config" ]
264 deps = [ "//testing/gmock" ]
267 source_set("unittests") {
270 "audio_block_fifo_unittest.cc",
271 "audio_buffer_converter_unittest.cc",
272 "audio_buffer_unittest.cc",
273 "audio_buffer_queue_unittest.cc",
274 "audio_bus_unittest.cc",
275 "audio_converter_unittest.cc",
276 "audio_discard_helper_unittest.cc",
277 "audio_fifo_unittest.cc",
278 "audio_hardware_config_unittest.cc",
279 "audio_hash_unittest.cc",
280 "audio_pull_fifo_unittest.cc",
281 "audio_renderer_mixer_input_unittest.cc",
282 "audio_renderer_mixer_unittest.cc",
283 "audio_splicer_unittest.cc",
284 "audio_timestamp_helper_unittest.cc",
285 "bind_to_current_loop_unittest.cc",
286 "bit_reader_unittest.cc",
288 "callback_holder_unittest.cc",
289 "channel_mixer_unittest.cc",
290 "data_buffer_unittest.cc",
291 "decoder_buffer_queue_unittest.cc",
292 "decoder_buffer_unittest.cc",
294 "gmock_callback_support_unittest.cc",
295 "multi_channel_resampler_unittest.cc",
296 "pipeline_unittest.cc",
297 "ranges_unittest.cc",
298 "run_all_unittests.cc",
299 "scoped_histogram_timer_unittest.cc",
300 "serial_runner_unittest.cc",
301 "seekable_buffer_unittest.cc",
302 "sinc_resampler_unittest.cc",
303 "stream_parser_unittest.cc",
304 "text_ranges_unittest.cc",
305 "text_renderer_unittest.cc",
306 "user_input_monitor_unittest.cc",
307 "vector_math_testing.h",
308 "vector_math_unittest.cc",
309 "video_frame_unittest.cc",
310 "video_frame_pool_unittest.cc",
311 "video_util_unittest.cc",
312 "wall_clock_time_source_unittest.cc",
313 "yuv_convert_unittest.cc",
315 configs += [ "//media:media_config" ]
324 if (media_use_ffmpeg) {
326 "audio_video_metadata_extractor_unittest.cc",
327 "media_file_checker_unittest.cc",
333 "container_names_unittest.cc",
336 deps += [ "//ui/gl" ]
339 if (cpu_arch == "x86" || cpu_arch == "x64") {
340 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
344 source_set("perftests") {
347 "audio_bus_perftest.cc",
348 "audio_converter_perftest.cc",
349 "run_all_perftests.cc",
350 "sinc_resampler_perftest.cc",
351 "vector_math_perftest.cc",
352 "yuv_convert_perftest.cc",
354 configs += [ "//media:media_config" ]
362 if (media_use_ffmpeg) {
364 "demuxer_perftest.cc",
373 if (cpu_arch == "x86" || cpu_arch == "x64") {
374 source_set("media_sse2") {
376 "simd/convert_rgb_to_yuv_sse2.cc",
377 "simd/convert_rgb_to_yuv_ssse3.cc",
378 "simd/filter_yuv_sse2.cc",
380 configs += [ "//media:media_config" ]
382 cflags = [ "-msse2" ]
386 import("//third_party/yasm/yasm_assemble.gni")
387 yasm_assemble("media_yasm") {
389 "simd/convert_rgb_to_yuv_ssse3.asm",
390 "simd/convert_yuv_to_rgb_sse.asm",
391 "simd/convert_yuva_to_argb_mmx.asm",
392 "simd/empty_register_state_mmx.asm",
393 "simd/linear_scale_yuv_to_rgb_mmx.asm",
394 "simd/linear_scale_yuv_to_rgb_sse.asm",
395 "simd/scale_yuv_to_rgb_mmx.asm",
396 "simd/scale_yuv_to_rgb_sse.asm",
399 # TODO(ajwong): Only export if shared_library build...
403 # In addition to the same path as source asm, let yasm %include
404 # search path be relative to src/ per Chromium policy.
405 "-I", rebase_path("..", root_build_dir),
409 "//third_party/x86inc/x86inc.asm",
410 "simd/convert_rgb_to_yuv_ssse3.inc",
411 "simd/convert_yuv_to_rgb_mmx.inc",
412 "simd/convert_yuva_to_argb_mmx.inc",
413 "simd/linear_scale_yuv_to_rgb_mmx.inc",
414 "simd/media_export.asm",
415 "simd/scale_yuv_to_rgb_mmx.inc",
418 if (cpu_arch == "x86") {
419 yasm_flags += [ "-DARCH_X86_32" ]
420 } else if (cpu_arch == "x64") {
421 yasm_flags += [ "-DARCH_X86_64" ]
423 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
424 "simd/scale_yuv_to_rgb_sse2_x64.asm",
428 if (is_mac || is_ios) {
435 yasm_flags += [ "-DELF" ]
436 if (cpu_arch == "x64") {
437 # TODO(ajwong): Why isn't this true in mac?
438 yasm_flags += [ "-DPIC" ]