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")
12 visibility = [ "//media/*" ]
14 "audio_block_fifo.cc",
18 "audio_buffer_queue.cc",
19 "audio_buffer_queue.h",
20 "audio_capturer_source.h",
21 "audio_buffer_converter.cc",
22 "audio_buffer_converter.h",
27 "audio_decoder_config.cc",
28 "audio_decoder_config.h",
29 "audio_discard_helper.cc",
30 "audio_discard_helper.h",
33 "audio_hardware_config.cc",
34 "audio_hardware_config.h",
41 "audio_renderer_mixer.cc",
42 "audio_renderer_mixer.h",
43 "audio_renderer_mixer_input.cc",
44 "audio_renderer_mixer_input.h",
45 "audio_renderer_sink.h",
50 "audio_timestamp_helper.cc",
51 "audio_timestamp_helper.h",
52 "bind_to_current_loop.h",
62 "cdm_callback_promise.cc",
63 "cdm_callback_promise.h",
68 "cdm_key_information.cc",
69 "cdm_key_information.h",
72 "cdm_promise_adapter.cc",
73 "cdm_promise_adapter.h",
76 "channel_mixing_matrix.cc",
77 "channel_mixing_matrix.h",
85 "decoder_buffer_queue.cc",
86 "decoder_buffer_queue.h",
95 "demuxer_stream_provider.cc",
96 "demuxer_stream_provider.h",
100 "key_system_info.cc",
104 "key_systems_support_uma.cc",
105 "key_systems_support_uma.h",
116 "media_permission.cc",
117 "media_permission.h",
120 "multi_channel_resampler.cc",
121 "multi_channel_resampler.h",
131 "renderer_factory.cc",
132 "renderer_factory.h",
135 "scoped_histogram_timer.h",
136 "seekable_buffer.cc",
140 "simd/convert_rgb_to_yuv.h",
141 "simd/convert_rgb_to_yuv_c.cc",
142 "simd/convert_yuv_to_rgb.h",
143 "simd/convert_yuv_to_rgb_c.cc",
145 "simd/filter_yuv_c.cc",
150 "stream_parser_buffer.cc",
151 "stream_parser_buffer.h",
159 "text_track_config.cc",
160 "text_track_config.h",
161 "time_delta_interpolator.cc",
162 "time_delta_interpolator.h",
164 "user_input_monitor.cc",
165 "user_input_monitor.h",
168 "video_decoder_config.cc",
169 "video_decoder_config.h",
172 "video_frame_pool.cc",
173 "video_frame_pool.h",
179 "wall_clock_time_source.cc",
180 "wall_clock_time_source.h",
189 configs += [ "//media:media_config" ]
191 if (media_use_ffmpeg) {
193 "audio_video_metadata_extractor.cc",
194 "audio_video_metadata_extractor.h",
195 "container_names.cc",
197 "media_file_checker.cc",
198 "media_file_checker.h",
200 deps += [ "//third_party/ffmpeg" ]
203 if (enable_browser_cdms) {
207 "browser_cdm_factory.cc",
208 "browser_cdm_factory.h",
213 sources += [ "media_stub.cc" ]
215 sources += [ "media_win.cc" ]
216 } else if (is_posix) {
217 sources += [ "media_posix.cc" ]
220 if (is_linux && use_x11) {
222 "//build/config/linux:x11",
223 "//build/config/linux:xext",
225 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
226 # "//build/config/linux:xdamage",
227 # "//build/config/linux:xfixes",
228 # "//build/config/linux:xtst",
230 sources += [ "user_input_monitor_linux.cc" ]
232 "//ui/events:events_base",
236 sources += [ "user_input_monitor_mac.cc" ]
238 sources += [ "user_input_monitor_win.cc" ]
240 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
243 if (cpu_arch == "x86" || cpu_arch == "x64") {
244 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
251 if (is_linux || is_win) {
253 "keyboard_event_counter.cc",
254 "keyboard_event_counter.h",
259 # Minimal media component for media/cast on iOS.
260 config("base_for_cast_ios_dependent_config") {
261 defines = [ "MEDIA_FOR_CAST_IOS" ]
264 source_set("base_for_cast_ios") {
269 configs += [ "//media:media_config" ]
270 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
273 source_set("test_support") {
276 "fake_audio_render_callback.cc",
277 "fake_audio_render_callback.h",
278 "fake_audio_renderer_sink.cc",
279 "fake_audio_renderer_sink.h",
280 "fake_text_track_stream.cc",
281 "fake_text_track_stream.h",
282 "gmock_callback_support.h",
283 "mock_audio_renderer_sink.cc",
284 "mock_audio_renderer_sink.h",
285 "mock_demuxer_host.cc",
286 "mock_demuxer_host.h",
294 configs += [ "//media:media_config" ]
300 source_set("unittests") {
303 "audio_block_fifo_unittest.cc",
304 "audio_buffer_converter_unittest.cc",
305 "audio_buffer_unittest.cc",
306 "audio_buffer_queue_unittest.cc",
307 "audio_bus_unittest.cc",
308 "audio_converter_unittest.cc",
309 "audio_discard_helper_unittest.cc",
310 "audio_fifo_unittest.cc",
311 "audio_hardware_config_unittest.cc",
312 "audio_hash_unittest.cc",
313 "audio_pull_fifo_unittest.cc",
314 "audio_renderer_mixer_input_unittest.cc",
315 "audio_renderer_mixer_unittest.cc",
316 "audio_shifter_unittest.cc",
317 "audio_splicer_unittest.cc",
318 "audio_timestamp_helper_unittest.cc",
319 "bind_to_current_loop_unittest.cc",
320 "bit_reader_unittest.cc",
322 "callback_holder_unittest.cc",
323 "channel_mixer_unittest.cc",
324 "channel_mixing_matrix_unittest.cc",
325 "data_buffer_unittest.cc",
326 "decoder_buffer_queue_unittest.cc",
327 "decoder_buffer_unittest.cc",
329 "gmock_callback_support_unittest.cc",
330 "key_systems_unittest.cc",
331 "multi_channel_resampler_unittest.cc",
332 "pipeline_unittest.cc",
333 "ranges_unittest.cc",
334 "run_all_unittests.cc",
335 "scoped_histogram_timer_unittest.cc",
336 "serial_runner_unittest.cc",
337 "seekable_buffer_unittest.cc",
338 "sinc_resampler_unittest.cc",
339 "stream_parser_unittest.cc",
340 "text_ranges_unittest.cc",
341 "text_renderer_unittest.cc",
342 "user_input_monitor_unittest.cc",
343 "vector_math_testing.h",
344 "vector_math_unittest.cc",
345 "video_frame_unittest.cc",
346 "video_frame_pool_unittest.cc",
347 "video_util_unittest.cc",
348 "wall_clock_time_source_unittest.cc",
349 "yuv_convert_unittest.cc",
351 configs += [ "//media:media_config" ]
360 if (media_use_ffmpeg) {
362 "audio_video_metadata_extractor_unittest.cc",
363 "media_file_checker_unittest.cc",
368 sources += [ "container_names_unittest.cc" ]
370 deps += [ "//ui/gl" ]
373 if (cpu_arch == "x86" || cpu_arch == "x64") {
374 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
378 source_set("perftests") {
381 "audio_bus_perftest.cc",
382 "audio_converter_perftest.cc",
383 "run_all_perftests.cc",
384 "sinc_resampler_perftest.cc",
385 "vector_math_perftest.cc",
386 "yuv_convert_perftest.cc",
388 configs += [ "//media:media_config" ]
396 if (media_use_ffmpeg) {
397 sources += [ "demuxer_perftest.cc" ]
401 deps += [ "//ui/gl" ]
405 if (cpu_arch == "x86" || cpu_arch == "x64") {
406 source_set("media_sse2") {
408 "simd/convert_rgb_to_yuv_sse2.cc",
409 "simd/convert_rgb_to_yuv_ssse3.cc",
410 "simd/filter_yuv_sse2.cc",
412 configs += [ "//media:media_config" ]
414 cflags = [ "-msse2" ]
418 import("//third_party/yasm/yasm_assemble.gni")
419 yasm_assemble("media_yasm") {
421 "simd/convert_rgb_to_yuv_ssse3.asm",
422 "simd/convert_yuv_to_rgb_sse.asm",
423 "simd/convert_yuva_to_argb_mmx.asm",
424 "simd/empty_register_state_mmx.asm",
425 "simd/linear_scale_yuv_to_rgb_mmx.asm",
426 "simd/linear_scale_yuv_to_rgb_sse.asm",
427 "simd/scale_yuv_to_rgb_mmx.asm",
428 "simd/scale_yuv_to_rgb_sse.asm",
431 # TODO(ajwong): Only export if shared_library build...
436 # In addition to the same path as source asm, let yasm %include
437 # search path be relative to src/ per Chromium policy.
439 rebase_path("..", root_build_dir),
443 "//third_party/x86inc/x86inc.asm",
444 "simd/convert_rgb_to_yuv_ssse3.inc",
445 "simd/convert_yuv_to_rgb_mmx.inc",
446 "simd/convert_yuva_to_argb_mmx.inc",
447 "simd/linear_scale_yuv_to_rgb_mmx.inc",
448 "simd/media_export.asm",
449 "simd/scale_yuv_to_rgb_mmx.inc",
452 if (cpu_arch == "x86") {
453 yasm_flags += [ "-DARCH_X86_32" ]
454 } else if (cpu_arch == "x64") {
455 yasm_flags += [ "-DARCH_X86_64" ]
457 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
458 "simd/scale_yuv_to_rgb_sse2_x64.asm",
462 if (is_mac || is_ios) {
469 yasm_flags += [ "-DELF" ]
470 if (cpu_arch == "x64") {
471 # TODO(ajwong): Why isn't this true in mac?
472 yasm_flags += [ "-DPIC" ]