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",
63 "cdm_callback_promise.cc",
64 "cdm_callback_promise.h",
70 "cdm_initialized_promise.cc",
71 "cdm_initialized_promise.h",
72 "cdm_key_information.cc",
73 "cdm_key_information.h",
76 "cdm_promise_adapter.cc",
77 "cdm_promise_adapter.h",
80 "channel_mixing_matrix.cc",
81 "channel_mixing_matrix.h",
88 "decoder_buffer_queue.cc",
89 "decoder_buffer_queue.h",
98 "demuxer_stream_provider.cc",
99 "demuxer_stream_provider.h",
103 "key_system_info.cc",
108 "key_systems_support_uma.cc",
109 "key_systems_support_uma.h",
119 "media_permission.cc",
120 "media_permission.h",
127 "multi_channel_resampler.cc",
128 "multi_channel_resampler.h",
129 "null_video_sink.cc",
141 "renderer_factory.cc",
142 "renderer_factory.h",
145 "seekable_buffer.cc",
149 "simd/convert_rgb_to_yuv.h",
150 "simd/convert_rgb_to_yuv_c.cc",
151 "simd/convert_yuv_to_rgb.h",
152 "simd/convert_yuv_to_rgb_c.cc",
154 "simd/filter_yuv_c.cc",
159 "stream_parser_buffer.cc",
160 "stream_parser_buffer.h",
168 "text_track_config.cc",
169 "text_track_config.h",
170 "time_delta_interpolator.cc",
171 "time_delta_interpolator.h",
173 "timestamp_constants.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 # This target uses the ALLOCATOR_SHIM define.
213 "//base/allocator:allocator_shim_define",
214 "//build/config:precompiled_headers",
215 "//media:media_config",
216 "//media:media_implementation",
219 if (media_use_ffmpeg) {
221 "audio_video_metadata_extractor.cc",
222 "audio_video_metadata_extractor.h",
223 "container_names.cc",
225 "media_file_checker.cc",
226 "media_file_checker.h",
229 deps += [ "//third_party/ffmpeg" ]
232 if (enable_browser_cdms) {
236 "browser_cdm_factory.cc",
237 "browser_cdm_factory.h",
243 "//media/base/android",
244 "//media/base/android:media_java",
245 "//media/base/android:media_jni_headers",
246 "//media/base/android:video_capture_jni_headers",
248 allow_circular_includes_from += [ "//media/base/android" ]
251 if (is_linux && use_x11) {
253 "//build/config/linux:x11",
254 "//build/config/linux:xext",
256 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
257 # "//build/config/linux:xdamage",
258 # "//build/config/linux:xfixes",
259 # "//build/config/linux:xtst",
261 sources += [ "user_input_monitor_linux.cc" ]
263 "//ui/events:events_base",
267 sources += [ "user_input_monitor_mac.cc" ]
269 # Required by video_frame.cc.
270 libs = [ "CoreVideo.framework" ]
272 sources += [ "user_input_monitor_win.cc" ]
274 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
277 if (current_cpu == "x86" || current_cpu == "x64") {
279 "simd/convert_rgb_to_yuv_sse2.cc",
280 "simd/convert_rgb_to_yuv_ssse3.cc",
281 "simd/convert_yuv_to_rgb_x86.cc",
282 "simd/filter_yuv_sse2.cc",
284 deps += [ ":media_yasm" ]
287 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
289 if (is_linux || is_win) {
291 "keyboard_event_counter.cc",
292 "keyboard_event_counter.h",
297 # Minimal media component for media/cast on iOS.
298 config("base_for_cast_ios_dependent_config") {
299 defines = [ "MEDIA_FOR_CAST_IOS" ]
303 source_set("base_for_cast_ios") {
305 "simd/convert_rgb_to_yuv.h",
306 "simd/convert_rgb_to_yuv_c.cc",
307 "simd/convert_yuv_to_rgb.h",
308 "simd/convert_yuv_to_rgb_c.cc",
310 "simd/filter_yuv_c.cc",
313 "video_frame_metadata.cc",
314 "video_frame_metadata.h",
323 "//build/config/compiler:no_size_t_to_int_warning",
324 "//media:media_config",
326 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
330 source_set("test_support") {
333 "fake_audio_render_callback.cc",
334 "fake_audio_render_callback.h",
335 "fake_audio_renderer_sink.cc",
336 "fake_audio_renderer_sink.h",
337 "fake_demuxer_stream.cc",
338 "fake_demuxer_stream.h",
339 "fake_output_device.cc",
340 "fake_output_device.h",
341 "fake_text_track_stream.cc",
342 "fake_text_track_stream.h",
343 "gmock_callback_support.h",
344 "mock_audio_renderer_sink.cc",
345 "mock_audio_renderer_sink.h",
346 "mock_demuxer_host.cc",
347 "mock_demuxer_host.h",
357 configs += [ "//media:media_config" ]
363 source_set("unittests") {
366 "audio_block_fifo_unittest.cc",
367 "audio_buffer_converter_unittest.cc",
368 "audio_buffer_queue_unittest.cc",
369 "audio_buffer_unittest.cc",
370 "audio_bus_unittest.cc",
371 "audio_converter_unittest.cc",
372 "audio_discard_helper_unittest.cc",
373 "audio_fifo_unittest.cc",
374 "audio_hardware_config_unittest.cc",
375 "audio_hash_unittest.cc",
376 "audio_pull_fifo_unittest.cc",
377 "audio_renderer_mixer_input_unittest.cc",
378 "audio_renderer_mixer_unittest.cc",
379 "audio_shifter_unittest.cc",
380 "audio_splicer_unittest.cc",
381 "audio_timestamp_helper_unittest.cc",
382 "bind_to_current_loop_unittest.cc",
383 "bit_reader_unittest.cc",
385 "callback_holder_unittest.cc",
386 "channel_mixer_unittest.cc",
387 "channel_mixing_matrix_unittest.cc",
388 "data_buffer_unittest.cc",
389 "decoder_buffer_queue_unittest.cc",
390 "decoder_buffer_unittest.cc",
392 "fake_demuxer_stream_unittest.cc",
393 "gmock_callback_support_unittest.cc",
394 "key_systems_unittest.cc",
395 "mime_util_unittest.cc",
396 "moving_average_unittest.cc",
397 "multi_channel_resampler_unittest.cc",
398 "null_video_sink_unittest.cc",
399 "pipeline_unittest.cc",
400 "ranges_unittest.cc",
401 "run_all_unittests.cc",
402 "seekable_buffer_unittest.cc",
403 "serial_runner_unittest.cc",
404 "sinc_resampler_unittest.cc",
405 "stream_parser_unittest.cc",
406 "text_ranges_unittest.cc",
407 "text_renderer_unittest.cc",
408 "time_delta_interpolator_unittest.cc",
409 "user_input_monitor_unittest.cc",
410 "vector_math_testing.h",
411 "vector_math_unittest.cc",
412 "video_frame_pool_unittest.cc",
413 "video_frame_unittest.cc",
414 "video_util_unittest.cc",
415 "wall_clock_time_source_unittest.cc",
416 "yuv_convert_unittest.cc",
419 "//build/config/compiler:no_size_t_to_int_warning",
420 "//media:media_config",
424 "//gpu/command_buffer/common",
431 if (media_use_ffmpeg) {
433 "audio_video_metadata_extractor_unittest.cc",
434 "media_file_checker_unittest.cc",
439 sources += [ "container_names_unittest.cc" ]
441 deps += [ "//ui/gl" ]
444 if (current_cpu == "x86" || current_cpu == "x64") {
445 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
449 source_set("perftests") {
452 "audio_bus_perftest.cc",
453 "audio_converter_perftest.cc",
454 "run_all_perftests.cc",
455 "sinc_resampler_perftest.cc",
456 "vector_math_perftest.cc",
457 "yuv_convert_perftest.cc",
459 configs += [ "//media:media_config" ]
467 if (media_use_ffmpeg) {
468 sources += [ "demuxer_perftest.cc" ]
472 deps += [ "//ui/gl" ]
476 if (current_cpu == "x86" || current_cpu == "x64") {
477 import("//third_party/yasm/yasm_assemble.gni")
478 yasm_assemble("media_yasm") {
480 "simd/convert_rgb_to_yuv_ssse3.asm",
481 "simd/convert_yuv_to_rgb_sse.asm",
482 "simd/convert_yuva_to_argb_mmx.asm",
483 "simd/empty_register_state_mmx.asm",
484 "simd/linear_scale_yuv_to_rgb_mmx.asm",
485 "simd/linear_scale_yuv_to_rgb_sse.asm",
486 "simd/scale_yuv_to_rgb_mmx.asm",
487 "simd/scale_yuv_to_rgb_sse.asm",
490 # TODO(ajwong): Only export if shared_library build...
495 # In addition to the same path as source asm, let yasm %include
496 # search path be relative to src/ per Chromium policy.
498 rebase_path("..", root_build_dir),
502 "//third_party/x86inc/x86inc.asm",
503 "simd/convert_rgb_to_yuv_ssse3.inc",
504 "simd/convert_yuv_to_rgb_mmx.inc",
505 "simd/convert_yuva_to_argb_mmx.inc",
506 "simd/linear_scale_yuv_to_rgb_mmx.inc",
507 "simd/media_export.asm",
508 "simd/scale_yuv_to_rgb_mmx.inc",
511 if (current_cpu == "x86") {
512 yasm_flags += [ "-DARCH_X86_32" ]
513 } else if (current_cpu == "x64") {
514 yasm_flags += [ "-DARCH_X86_64" ]
516 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
517 "simd/scale_yuv_to_rgb_sse2_x64.asm",
521 if (is_mac || is_ios) {
528 yasm_flags += [ "-DELF" ]
529 if (current_cpu == "x64") {
530 # TODO(ajwong): Why isn't this true in mac?
531 yasm_flags += [ "-DPIC" ]