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/features.gni")
8 import("//build/config/ui.gni")
9 import("//build/config/linux/pkg_config.gni")
10 import("//media/media_options.gni")
13 # This is part of the media component.
14 visibility = [ "//media" ]
16 "audio_block_fifo.cc",
20 "audio_buffer_converter.cc",
21 "audio_buffer_converter.h",
22 "audio_buffer_queue.cc",
23 "audio_buffer_queue.h",
24 "audio_capturer_source.h",
29 "audio_decoder_config.cc",
30 "audio_decoder_config.h",
31 "audio_discard_helper.cc",
32 "audio_discard_helper.h",
35 "audio_hardware_config.cc",
36 "audio_hardware_config.h",
43 "audio_renderer_mixer.cc",
44 "audio_renderer_mixer.h",
45 "audio_renderer_mixer_input.cc",
46 "audio_renderer_mixer_input.h",
47 "audio_renderer_sink.h",
52 "audio_timestamp_helper.cc",
53 "audio_timestamp_helper.h",
54 "bind_to_current_loop.h",
64 "cdm_callback_promise.cc",
65 "cdm_callback_promise.h",
71 "cdm_initialized_promise.cc",
72 "cdm_initialized_promise.h",
73 "cdm_key_information.cc",
74 "cdm_key_information.h",
77 "cdm_promise_adapter.cc",
78 "cdm_promise_adapter.h",
81 "channel_mixing_matrix.cc",
82 "channel_mixing_matrix.h",
90 "decoder_buffer_queue.cc",
91 "decoder_buffer_queue.h",
100 "demuxer_stream_provider.cc",
101 "demuxer_stream_provider.h",
105 "key_system_info.cc",
110 "key_systems_support_uma.cc",
111 "key_systems_support_uma.h",
121 "media_permission.cc",
122 "media_permission.h",
129 "multi_channel_resampler.cc",
130 "multi_channel_resampler.h",
131 "null_video_sink.cc",
142 "renderer_factory.cc",
143 "renderer_factory.h",
146 "seekable_buffer.cc",
150 "simd/convert_rgb_to_yuv.h",
151 "simd/convert_rgb_to_yuv_c.cc",
152 "simd/convert_yuv_to_rgb.h",
153 "simd/convert_yuv_to_rgb_c.cc",
155 "simd/filter_yuv_c.cc",
160 "stream_parser_buffer.cc",
161 "stream_parser_buffer.h",
169 "text_track_config.cc",
170 "text_track_config.h",
171 "time_delta_interpolator.cc",
172 "time_delta_interpolator.h",
174 "user_input_monitor.cc",
175 "user_input_monitor.h",
176 "video_capture_types.cc",
177 "video_capture_types.h",
178 "video_capturer_source.cc",
179 "video_capturer_source.h",
182 "video_decoder_config.cc",
183 "video_decoder_config.h",
186 "video_frame_metadata.cc",
187 "video_frame_metadata.h",
188 "video_frame_pool.cc",
189 "video_frame_pool.h",
197 "wall_clock_time_source.cc",
198 "wall_clock_time_source.h",
203 allow_circular_includes_from = []
207 "//ui/events:events_base",
212 "//media:media_config",
213 "//media:media_implementation",
216 if (media_use_ffmpeg) {
218 "audio_video_metadata_extractor.cc",
219 "audio_video_metadata_extractor.h",
220 "container_names.cc",
222 "media_file_checker.cc",
223 "media_file_checker.h",
226 deps += [ "//third_party/ffmpeg" ]
229 if (enable_browser_cdms) {
233 "browser_cdm_factory.cc",
234 "browser_cdm_factory.h",
240 "//media/base/android",
241 "//media/base/android:media_java",
242 "//media/base/android:media_jni_headers",
243 "//media/base/android:video_capture_jni_headers",
245 allow_circular_includes_from += [ "//media/base/android" ]
248 if (is_linux && use_x11) {
250 "//build/config/linux:x11",
251 "//build/config/linux:xext",
253 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
254 # "//build/config/linux:xdamage",
255 # "//build/config/linux:xfixes",
256 # "//build/config/linux:xtst",
258 sources += [ "user_input_monitor_linux.cc" ]
260 "//ui/events:events_base",
264 sources += [ "user_input_monitor_mac.cc" ]
266 # Required by video_frame.cc.
267 libs = [ "CoreVideo.framework" ]
269 sources += [ "user_input_monitor_win.cc" ]
271 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
274 if (current_cpu == "x86" || current_cpu == "x64") {
276 "simd/convert_rgb_to_yuv_sse2.cc",
277 "simd/convert_rgb_to_yuv_ssse3.cc",
278 "simd/convert_yuv_to_rgb_x86.cc",
279 "simd/filter_yuv_sse2.cc",
281 deps += [ ":media_yasm" ]
284 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
286 if (is_linux || is_win) {
288 "keyboard_event_counter.cc",
289 "keyboard_event_counter.h",
294 # Minimal media component for media/cast on iOS.
295 config("base_for_cast_ios_dependent_config") {
296 defines = [ "MEDIA_FOR_CAST_IOS" ]
300 source_set("base_for_cast_ios") {
302 "simd/convert_rgb_to_yuv.h",
303 "simd/convert_rgb_to_yuv_c.cc",
304 "simd/convert_yuv_to_rgb.h",
305 "simd/convert_yuv_to_rgb_c.cc",
307 "simd/filter_yuv_c.cc",
310 "video_frame_metadata.cc",
311 "video_frame_metadata.h",
320 "//build/config/compiler:no_size_t_to_int_warning",
321 "//media:media_config",
323 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
327 source_set("test_support") {
330 "fake_audio_render_callback.cc",
331 "fake_audio_render_callback.h",
332 "fake_audio_renderer_sink.cc",
333 "fake_audio_renderer_sink.h",
334 "fake_demuxer_stream.cc",
335 "fake_demuxer_stream.h",
336 "fake_text_track_stream.cc",
337 "fake_text_track_stream.h",
338 "gmock_callback_support.h",
339 "mock_audio_renderer_sink.cc",
340 "mock_audio_renderer_sink.h",
341 "mock_demuxer_host.cc",
342 "mock_demuxer_host.h",
350 configs += [ "//media:media_config" ]
356 source_set("unittests") {
359 "audio_block_fifo_unittest.cc",
360 "audio_buffer_converter_unittest.cc",
361 "audio_buffer_queue_unittest.cc",
362 "audio_buffer_unittest.cc",
363 "audio_bus_unittest.cc",
364 "audio_converter_unittest.cc",
365 "audio_discard_helper_unittest.cc",
366 "audio_fifo_unittest.cc",
367 "audio_hardware_config_unittest.cc",
368 "audio_hash_unittest.cc",
369 "audio_pull_fifo_unittest.cc",
370 "audio_renderer_mixer_input_unittest.cc",
371 "audio_renderer_mixer_unittest.cc",
372 "audio_shifter_unittest.cc",
373 "audio_splicer_unittest.cc",
374 "audio_timestamp_helper_unittest.cc",
375 "bind_to_current_loop_unittest.cc",
376 "bit_reader_unittest.cc",
378 "callback_holder_unittest.cc",
379 "channel_mixer_unittest.cc",
380 "channel_mixing_matrix_unittest.cc",
381 "data_buffer_unittest.cc",
382 "decoder_buffer_queue_unittest.cc",
383 "decoder_buffer_unittest.cc",
385 "fake_demuxer_stream_unittest.cc",
386 "gmock_callback_support_unittest.cc",
387 "key_systems_unittest.cc",
388 "mime_util_unittest.cc",
389 "moving_average_unittest.cc",
390 "multi_channel_resampler_unittest.cc",
391 "null_video_sink_unittest.cc",
392 "pipeline_unittest.cc",
393 "ranges_unittest.cc",
394 "run_all_unittests.cc",
395 "seekable_buffer_unittest.cc",
396 "serial_runner_unittest.cc",
397 "sinc_resampler_unittest.cc",
398 "stream_parser_unittest.cc",
399 "text_ranges_unittest.cc",
400 "text_renderer_unittest.cc",
401 "user_input_monitor_unittest.cc",
402 "vector_math_testing.h",
403 "vector_math_unittest.cc",
404 "video_frame_pool_unittest.cc",
405 "video_frame_unittest.cc",
406 "video_util_unittest.cc",
407 "wall_clock_time_source_unittest.cc",
408 "yuv_convert_unittest.cc",
411 "//build/config/compiler:no_size_t_to_int_warning",
412 "//media:media_config",
416 "//gpu/command_buffer/common",
423 if (media_use_ffmpeg) {
425 "audio_video_metadata_extractor_unittest.cc",
426 "media_file_checker_unittest.cc",
431 sources += [ "container_names_unittest.cc" ]
433 deps += [ "//ui/gl" ]
436 if (current_cpu == "x86" || current_cpu == "x64") {
437 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
441 source_set("perftests") {
444 "audio_bus_perftest.cc",
445 "audio_converter_perftest.cc",
446 "run_all_perftests.cc",
447 "sinc_resampler_perftest.cc",
448 "vector_math_perftest.cc",
449 "yuv_convert_perftest.cc",
451 configs += [ "//media:media_config" ]
459 if (media_use_ffmpeg) {
460 sources += [ "demuxer_perftest.cc" ]
464 deps += [ "//ui/gl" ]
468 if (current_cpu == "x86" || current_cpu == "x64") {
469 import("//third_party/yasm/yasm_assemble.gni")
470 yasm_assemble("media_yasm") {
472 "simd/convert_rgb_to_yuv_ssse3.asm",
473 "simd/convert_yuv_to_rgb_sse.asm",
474 "simd/convert_yuva_to_argb_mmx.asm",
475 "simd/empty_register_state_mmx.asm",
476 "simd/linear_scale_yuv_to_rgb_mmx.asm",
477 "simd/linear_scale_yuv_to_rgb_sse.asm",
478 "simd/scale_yuv_to_rgb_mmx.asm",
479 "simd/scale_yuv_to_rgb_sse.asm",
482 # TODO(ajwong): Only export if shared_library build...
487 # In addition to the same path as source asm, let yasm %include
488 # search path be relative to src/ per Chromium policy.
490 rebase_path("..", root_build_dir),
494 "//third_party/x86inc/x86inc.asm",
495 "simd/convert_rgb_to_yuv_ssse3.inc",
496 "simd/convert_yuv_to_rgb_mmx.inc",
497 "simd/convert_yuva_to_argb_mmx.inc",
498 "simd/linear_scale_yuv_to_rgb_mmx.inc",
499 "simd/media_export.asm",
500 "simd/scale_yuv_to_rgb_mmx.inc",
503 if (current_cpu == "x86") {
504 yasm_flags += [ "-DARCH_X86_32" ]
505 } else if (current_cpu == "x64") {
506 yasm_flags += [ "-DARCH_X86_64" ]
508 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
509 "simd/scale_yuv_to_rgb_sse2_x64.asm",
513 if (is_mac || is_ios) {
520 yasm_flags += [ "-DELF" ]
521 if (current_cpu == "x64") {
522 # TODO(ajwong): Why isn't this true in mac?
523 yasm_flags += [ "-DPIC" ]