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_key_information.cc",
72 "cdm_key_information.h",
75 "cdm_promise_adapter.cc",
76 "cdm_promise_adapter.h",
79 "channel_mixing_matrix.cc",
80 "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",
138 "renderer_factory.cc",
139 "renderer_factory.h",
142 "seekable_buffer.cc",
146 "simd/convert_rgb_to_yuv.h",
147 "simd/convert_rgb_to_yuv_c.cc",
148 "simd/convert_yuv_to_rgb.h",
149 "simd/convert_yuv_to_rgb_c.cc",
151 "simd/filter_yuv_c.cc",
156 "stream_parser_buffer.cc",
157 "stream_parser_buffer.h",
165 "text_track_config.cc",
166 "text_track_config.h",
167 "time_delta_interpolator.cc",
168 "time_delta_interpolator.h",
170 "user_input_monitor.cc",
171 "user_input_monitor.h",
172 "video_capture_types.cc",
173 "video_capture_types.h",
174 "video_capturer_source.cc",
175 "video_capturer_source.h",
178 "video_decoder_config.cc",
179 "video_decoder_config.h",
182 "video_frame_metadata.cc",
183 "video_frame_metadata.h",
184 "video_frame_pool.cc",
185 "video_frame_pool.h",
191 "wall_clock_time_source.cc",
192 "wall_clock_time_source.h",
197 allow_circular_includes_from = []
201 "//ui/events:events_base",
206 "//media:media_config",
207 "//media:media_implementation",
210 if (media_use_ffmpeg) {
212 "audio_video_metadata_extractor.cc",
213 "audio_video_metadata_extractor.h",
214 "container_names.cc",
216 "media_file_checker.cc",
217 "media_file_checker.h",
220 sources += [ "media_win.cc" ]
221 } else if (is_posix) {
222 sources += [ "media_posix.cc" ]
225 deps += [ "//third_party/ffmpeg" ]
228 if (enable_browser_cdms) {
232 "browser_cdm_factory.cc",
233 "browser_cdm_factory.h",
238 sources += [ "media_stub.cc" ]
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") {
275 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
282 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
284 if (is_linux || is_win) {
286 "keyboard_event_counter.cc",
287 "keyboard_event_counter.h",
292 # Minimal media component for media/cast on iOS.
293 config("base_for_cast_ios_dependent_config") {
294 defines = [ "MEDIA_FOR_CAST_IOS" ]
298 source_set("base_for_cast_ios") {
300 "simd/convert_rgb_to_yuv.h",
301 "simd/convert_rgb_to_yuv_c.cc",
302 "simd/convert_yuv_to_rgb.h",
303 "simd/convert_yuv_to_rgb_c.cc",
305 "simd/filter_yuv_c.cc",
308 "video_frame_metadata.cc",
309 "video_frame_metadata.h",
316 "//build/config/compiler:no_size_t_to_int_warning",
317 "//media:media_config",
319 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
323 source_set("test_support") {
326 "fake_audio_render_callback.cc",
327 "fake_audio_render_callback.h",
328 "fake_audio_renderer_sink.cc",
329 "fake_audio_renderer_sink.h",
330 "fake_demuxer_stream.cc",
331 "fake_demuxer_stream.h",
332 "fake_text_track_stream.cc",
333 "fake_text_track_stream.h",
334 "gmock_callback_support.h",
335 "mock_audio_renderer_sink.cc",
336 "mock_audio_renderer_sink.h",
337 "mock_demuxer_host.cc",
338 "mock_demuxer_host.h",
341 "null_video_sink.cc",
348 configs += [ "//media:media_config" ]
354 source_set("unittests") {
357 "audio_block_fifo_unittest.cc",
358 "audio_buffer_converter_unittest.cc",
359 "audio_buffer_queue_unittest.cc",
360 "audio_buffer_unittest.cc",
361 "audio_bus_unittest.cc",
362 "audio_converter_unittest.cc",
363 "audio_discard_helper_unittest.cc",
364 "audio_fifo_unittest.cc",
365 "audio_hardware_config_unittest.cc",
366 "audio_hash_unittest.cc",
367 "audio_pull_fifo_unittest.cc",
368 "audio_renderer_mixer_input_unittest.cc",
369 "audio_renderer_mixer_unittest.cc",
370 "audio_shifter_unittest.cc",
371 "audio_splicer_unittest.cc",
372 "audio_timestamp_helper_unittest.cc",
373 "bind_to_current_loop_unittest.cc",
374 "bit_reader_unittest.cc",
376 "callback_holder_unittest.cc",
377 "channel_mixer_unittest.cc",
378 "channel_mixing_matrix_unittest.cc",
379 "data_buffer_unittest.cc",
380 "decoder_buffer_queue_unittest.cc",
381 "decoder_buffer_unittest.cc",
383 "fake_demuxer_stream_unittest.cc",
384 "gmock_callback_support_unittest.cc",
385 "key_systems_unittest.cc",
386 "mime_util_unittest.cc",
387 "moving_average_unittest.cc",
388 "multi_channel_resampler_unittest.cc",
389 "null_video_sink_unittest.cc",
390 "pipeline_unittest.cc",
391 "ranges_unittest.cc",
392 "run_all_unittests.cc",
393 "seekable_buffer_unittest.cc",
394 "serial_runner_unittest.cc",
395 "sinc_resampler_unittest.cc",
396 "stream_parser_unittest.cc",
397 "text_ranges_unittest.cc",
398 "text_renderer_unittest.cc",
399 "user_input_monitor_unittest.cc",
400 "vector_math_testing.h",
401 "vector_math_unittest.cc",
402 "video_frame_pool_unittest.cc",
403 "video_frame_unittest.cc",
404 "video_util_unittest.cc",
405 "wall_clock_time_source_unittest.cc",
406 "yuv_convert_unittest.cc",
409 "//build/config/compiler:no_size_t_to_int_warning",
410 "//media:media_config",
414 "//gpu/command_buffer/common",
421 if (media_use_ffmpeg) {
423 "audio_video_metadata_extractor_unittest.cc",
424 "media_file_checker_unittest.cc",
429 sources += [ "container_names_unittest.cc" ]
431 deps += [ "//ui/gl" ]
434 if (current_cpu == "x86" || current_cpu == "x64") {
435 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
439 source_set("perftests") {
442 "audio_bus_perftest.cc",
443 "audio_converter_perftest.cc",
444 "run_all_perftests.cc",
445 "sinc_resampler_perftest.cc",
446 "vector_math_perftest.cc",
447 "yuv_convert_perftest.cc",
449 configs += [ "//media:media_config" ]
457 if (media_use_ffmpeg) {
458 sources += [ "demuxer_perftest.cc" ]
462 deps += [ "//ui/gl" ]
466 if (current_cpu == "x86" || current_cpu == "x64") {
467 source_set("media_sse2") {
469 "simd/convert_rgb_to_yuv_sse2.cc",
470 "simd/convert_rgb_to_yuv_ssse3.cc",
471 "simd/filter_yuv_sse2.cc",
474 "//media:media_config",
475 "//media:media_implementation",
478 cflags = [ "-msse2" ]
482 import("//third_party/yasm/yasm_assemble.gni")
483 yasm_assemble("media_yasm") {
485 "simd/convert_rgb_to_yuv_ssse3.asm",
486 "simd/convert_yuv_to_rgb_sse.asm",
487 "simd/convert_yuva_to_argb_mmx.asm",
488 "simd/empty_register_state_mmx.asm",
489 "simd/linear_scale_yuv_to_rgb_mmx.asm",
490 "simd/linear_scale_yuv_to_rgb_sse.asm",
491 "simd/scale_yuv_to_rgb_mmx.asm",
492 "simd/scale_yuv_to_rgb_sse.asm",
495 # TODO(ajwong): Only export if shared_library build...
500 # In addition to the same path as source asm, let yasm %include
501 # search path be relative to src/ per Chromium policy.
503 rebase_path("..", root_build_dir),
507 "//third_party/x86inc/x86inc.asm",
508 "simd/convert_rgb_to_yuv_ssse3.inc",
509 "simd/convert_yuv_to_rgb_mmx.inc",
510 "simd/convert_yuva_to_argb_mmx.inc",
511 "simd/linear_scale_yuv_to_rgb_mmx.inc",
512 "simd/media_export.asm",
513 "simd/scale_yuv_to_rgb_mmx.inc",
516 if (current_cpu == "x86") {
517 yasm_flags += [ "-DARCH_X86_32" ]
518 } else if (current_cpu == "x64") {
519 yasm_flags += [ "-DARCH_X86_64" ]
521 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
522 "simd/scale_yuv_to_rgb_sse2_x64.asm",
526 if (is_mac || is_ios) {
533 yasm_flags += [ "-DELF" ]
534 if (current_cpu == "x64") {
535 # TODO(ajwong): Why isn't this true in mac?
536 yasm_flags += [ "-DPIC" ]