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",
89 "decoder_buffer_queue.cc",
90 "decoder_buffer_queue.h",
99 "demuxer_stream_provider.cc",
100 "demuxer_stream_provider.h",
104 "key_system_info.cc",
109 "key_systems_support_uma.cc",
110 "key_systems_support_uma.h",
120 "media_permission.cc",
121 "media_permission.h",
128 "multi_channel_resampler.cc",
129 "multi_channel_resampler.h",
130 "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 "user_input_monitor.cc",
174 "user_input_monitor.h",
175 "video_capture_types.cc",
176 "video_capture_types.h",
177 "video_capturer_source.cc",
178 "video_capturer_source.h",
181 "video_decoder_config.cc",
182 "video_decoder_config.h",
185 "video_frame_metadata.cc",
186 "video_frame_metadata.h",
187 "video_frame_pool.cc",
188 "video_frame_pool.h",
196 "wall_clock_time_source.cc",
197 "wall_clock_time_source.h",
202 allow_circular_includes_from = []
206 "//ui/events:events_base",
211 # This target uses the ALLOCATOR_SHIM define.
212 "//base/allocator:allocator_shim_define",
213 "//media:media_config",
214 "//media:media_implementation",
217 if (media_use_ffmpeg) {
219 "audio_video_metadata_extractor.cc",
220 "audio_video_metadata_extractor.h",
221 "container_names.cc",
223 "media_file_checker.cc",
224 "media_file_checker.h",
227 deps += [ "//third_party/ffmpeg" ]
230 if (enable_browser_cdms) {
234 "browser_cdm_factory.cc",
235 "browser_cdm_factory.h",
241 "//media/base/android",
242 "//media/base/android:media_java",
243 "//media/base/android:media_jni_headers",
244 "//media/base/android:video_capture_jni_headers",
246 allow_circular_includes_from += [ "//media/base/android" ]
249 if (is_linux && use_x11) {
251 "//build/config/linux:x11",
252 "//build/config/linux:xext",
254 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
255 # "//build/config/linux:xdamage",
256 # "//build/config/linux:xfixes",
257 # "//build/config/linux:xtst",
259 sources += [ "user_input_monitor_linux.cc" ]
261 "//ui/events:events_base",
265 sources += [ "user_input_monitor_mac.cc" ]
267 # Required by video_frame.cc.
268 libs = [ "CoreVideo.framework" ]
270 sources += [ "user_input_monitor_win.cc" ]
272 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
275 if (current_cpu == "x86" || current_cpu == "x64") {
277 "simd/convert_rgb_to_yuv_sse2.cc",
278 "simd/convert_rgb_to_yuv_ssse3.cc",
279 "simd/convert_yuv_to_rgb_x86.cc",
280 "simd/filter_yuv_sse2.cc",
282 deps += [ ":media_yasm" ]
285 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
287 if (is_linux || is_win) {
289 "keyboard_event_counter.cc",
290 "keyboard_event_counter.h",
295 # Minimal media component for media/cast on iOS.
296 config("base_for_cast_ios_dependent_config") {
297 defines = [ "MEDIA_FOR_CAST_IOS" ]
301 source_set("base_for_cast_ios") {
303 "simd/convert_rgb_to_yuv.h",
304 "simd/convert_rgb_to_yuv_c.cc",
305 "simd/convert_yuv_to_rgb.h",
306 "simd/convert_yuv_to_rgb_c.cc",
308 "simd/filter_yuv_c.cc",
311 "video_frame_metadata.cc",
312 "video_frame_metadata.h",
321 "//build/config/compiler:no_size_t_to_int_warning",
322 "//media:media_config",
324 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
328 source_set("test_support") {
331 "fake_audio_render_callback.cc",
332 "fake_audio_render_callback.h",
333 "fake_audio_renderer_sink.cc",
334 "fake_audio_renderer_sink.h",
335 "fake_demuxer_stream.cc",
336 "fake_demuxer_stream.h",
337 "fake_text_track_stream.cc",
338 "fake_text_track_stream.h",
339 "gmock_callback_support.h",
340 "mock_audio_renderer_sink.cc",
341 "mock_audio_renderer_sink.h",
342 "mock_demuxer_host.cc",
343 "mock_demuxer_host.h",
351 configs += [ "//media:media_config" ]
357 source_set("unittests") {
360 "audio_block_fifo_unittest.cc",
361 "audio_buffer_converter_unittest.cc",
362 "audio_buffer_queue_unittest.cc",
363 "audio_buffer_unittest.cc",
364 "audio_bus_unittest.cc",
365 "audio_converter_unittest.cc",
366 "audio_discard_helper_unittest.cc",
367 "audio_fifo_unittest.cc",
368 "audio_hardware_config_unittest.cc",
369 "audio_hash_unittest.cc",
370 "audio_pull_fifo_unittest.cc",
371 "audio_renderer_mixer_input_unittest.cc",
372 "audio_renderer_mixer_unittest.cc",
373 "audio_shifter_unittest.cc",
374 "audio_splicer_unittest.cc",
375 "audio_timestamp_helper_unittest.cc",
376 "bind_to_current_loop_unittest.cc",
377 "bit_reader_unittest.cc",
379 "callback_holder_unittest.cc",
380 "channel_mixer_unittest.cc",
381 "channel_mixing_matrix_unittest.cc",
382 "data_buffer_unittest.cc",
383 "decoder_buffer_queue_unittest.cc",
384 "decoder_buffer_unittest.cc",
386 "fake_demuxer_stream_unittest.cc",
387 "gmock_callback_support_unittest.cc",
388 "key_systems_unittest.cc",
389 "mime_util_unittest.cc",
390 "moving_average_unittest.cc",
391 "multi_channel_resampler_unittest.cc",
392 "null_video_sink_unittest.cc",
393 "pipeline_unittest.cc",
394 "ranges_unittest.cc",
395 "run_all_unittests.cc",
396 "seekable_buffer_unittest.cc",
397 "serial_runner_unittest.cc",
398 "sinc_resampler_unittest.cc",
399 "stream_parser_unittest.cc",
400 "text_ranges_unittest.cc",
401 "text_renderer_unittest.cc",
402 "user_input_monitor_unittest.cc",
403 "vector_math_testing.h",
404 "vector_math_unittest.cc",
405 "video_frame_pool_unittest.cc",
406 "video_frame_unittest.cc",
407 "video_util_unittest.cc",
408 "wall_clock_time_source_unittest.cc",
409 "yuv_convert_unittest.cc",
412 "//build/config/compiler:no_size_t_to_int_warning",
413 "//media:media_config",
417 "//gpu/command_buffer/common",
424 if (media_use_ffmpeg) {
426 "audio_video_metadata_extractor_unittest.cc",
427 "media_file_checker_unittest.cc",
432 sources += [ "container_names_unittest.cc" ]
434 deps += [ "//ui/gl" ]
437 if (current_cpu == "x86" || current_cpu == "x64") {
438 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
442 source_set("perftests") {
445 "audio_bus_perftest.cc",
446 "audio_converter_perftest.cc",
447 "run_all_perftests.cc",
448 "sinc_resampler_perftest.cc",
449 "vector_math_perftest.cc",
450 "yuv_convert_perftest.cc",
452 configs += [ "//media:media_config" ]
460 if (media_use_ffmpeg) {
461 sources += [ "demuxer_perftest.cc" ]
465 deps += [ "//ui/gl" ]
469 if (current_cpu == "x86" || current_cpu == "x64") {
470 import("//third_party/yasm/yasm_assemble.gni")
471 yasm_assemble("media_yasm") {
473 "simd/convert_rgb_to_yuv_ssse3.asm",
474 "simd/convert_yuv_to_rgb_sse.asm",
475 "simd/convert_yuva_to_argb_mmx.asm",
476 "simd/empty_register_state_mmx.asm",
477 "simd/linear_scale_yuv_to_rgb_mmx.asm",
478 "simd/linear_scale_yuv_to_rgb_sse.asm",
479 "simd/scale_yuv_to_rgb_mmx.asm",
480 "simd/scale_yuv_to_rgb_sse.asm",
483 # TODO(ajwong): Only export if shared_library build...
488 # In addition to the same path as source asm, let yasm %include
489 # search path be relative to src/ per Chromium policy.
491 rebase_path("..", root_build_dir),
495 "//third_party/x86inc/x86inc.asm",
496 "simd/convert_rgb_to_yuv_ssse3.inc",
497 "simd/convert_yuv_to_rgb_mmx.inc",
498 "simd/convert_yuva_to_argb_mmx.inc",
499 "simd/linear_scale_yuv_to_rgb_mmx.inc",
500 "simd/media_export.asm",
501 "simd/scale_yuv_to_rgb_mmx.inc",
504 if (current_cpu == "x86") {
505 yasm_flags += [ "-DARCH_X86_32" ]
506 } else if (current_cpu == "x64") {
507 yasm_flags += [ "-DARCH_X86_64" ]
509 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
510 "simd/scale_yuv_to_rgb_sse2_x64.asm",
514 if (is_mac || is_ios) {
521 yasm_flags += [ "-DELF" ]
522 if (current_cpu == "x64") {
523 # TODO(ajwong): Why isn't this true in mac?
524 yasm_flags += [ "-DPIC" ]