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_converter.cc",
19 "audio_buffer_converter.h",
20 "audio_buffer_queue.cc",
21 "audio_buffer_queue.h",
22 "audio_capturer_source.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",
105 "key_systems_support_uma.cc",
106 "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 "seekable_buffer.cc",
139 "simd/convert_rgb_to_yuv.h",
140 "simd/convert_rgb_to_yuv_c.cc",
141 "simd/convert_yuv_to_rgb.h",
142 "simd/convert_yuv_to_rgb_c.cc",
144 "simd/filter_yuv_c.cc",
149 "stream_parser_buffer.cc",
150 "stream_parser_buffer.h",
158 "text_track_config.cc",
159 "text_track_config.h",
160 "time_delta_interpolator.cc",
161 "time_delta_interpolator.h",
163 "user_input_monitor.cc",
164 "user_input_monitor.h",
165 "video_capture_types.cc",
166 "video_capture_types.h",
167 "video_capturer_source.cc",
168 "video_capturer_source.h",
171 "video_decoder_config.cc",
172 "video_decoder_config.h",
175 "video_frame_metadata.cc",
176 "video_frame_metadata.h",
177 "video_frame_pool.cc",
178 "video_frame_pool.h",
184 "wall_clock_time_source.cc",
185 "wall_clock_time_source.h",
192 configs += [ "//media:media_config" ]
198 if (media_use_ffmpeg) {
200 "audio_video_metadata_extractor.cc",
201 "audio_video_metadata_extractor.h",
202 "container_names.cc",
204 "media_file_checker.cc",
205 "media_file_checker.h",
207 deps += [ "//third_party/ffmpeg" ]
210 if (enable_browser_cdms) {
214 "browser_cdm_factory.cc",
215 "browser_cdm_factory.h",
220 sources += [ "media_stub.cc" ]
222 sources += [ "media_win.cc" ]
223 } else if (is_posix) {
224 sources += [ "media_posix.cc" ]
227 if (is_linux && use_x11 && !is_ensemble) {
229 "//build/config/linux:x11",
230 "//build/config/linux:xext",
232 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
233 # "//build/config/linux:xdamage",
234 # "//build/config/linux:xfixes",
235 # "//build/config/linux:xtst",
237 sources += [ "user_input_monitor_linux.cc" ]
239 "//ui/events:events_base",
243 sources += [ "user_input_monitor_mac.cc" ]
245 sources += [ "user_input_monitor_win.cc" ]
247 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
250 if (current_cpu == "x86" || current_cpu == "x64") {
251 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
258 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
260 if (is_linux || is_win) {
262 "keyboard_event_counter.cc",
263 "keyboard_event_counter.h",
268 # Minimal media component for media/cast on iOS.
269 config("base_for_cast_ios_dependent_config") {
270 defines = [ "MEDIA_FOR_CAST_IOS" ]
273 source_set("base_for_cast_ios") {
275 "simd/convert_rgb_to_yuv.h",
276 "simd/convert_rgb_to_yuv_c.cc",
277 "simd/convert_yuv_to_rgb.h",
278 "simd/convert_yuv_to_rgb_c.cc",
280 "simd/filter_yuv_c.cc",
283 "video_frame_metadata.cc",
284 "video_frame_metadata.h",
291 "//build/config/compiler:no_size_t_to_int_warning",
292 "//media:media_config",
294 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
297 source_set("test_support") {
300 "fake_audio_render_callback.cc",
301 "fake_audio_render_callback.h",
302 "fake_audio_renderer_sink.cc",
303 "fake_audio_renderer_sink.h",
304 "fake_text_track_stream.cc",
305 "fake_text_track_stream.h",
306 "gmock_callback_support.h",
307 "mock_audio_renderer_sink.cc",
308 "mock_audio_renderer_sink.h",
309 "mock_demuxer_host.cc",
310 "mock_demuxer_host.h",
318 configs += [ "//media:media_config" ]
324 source_set("unittests") {
327 "audio_block_fifo_unittest.cc",
328 "audio_buffer_converter_unittest.cc",
329 "audio_buffer_queue_unittest.cc",
330 "audio_buffer_unittest.cc",
331 "audio_bus_unittest.cc",
332 "audio_converter_unittest.cc",
333 "audio_discard_helper_unittest.cc",
334 "audio_fifo_unittest.cc",
335 "audio_hardware_config_unittest.cc",
336 "audio_hash_unittest.cc",
337 "audio_pull_fifo_unittest.cc",
338 "audio_renderer_mixer_input_unittest.cc",
339 "audio_renderer_mixer_unittest.cc",
340 "audio_shifter_unittest.cc",
341 "audio_splicer_unittest.cc",
342 "audio_timestamp_helper_unittest.cc",
343 "bind_to_current_loop_unittest.cc",
344 "bit_reader_unittest.cc",
346 "callback_holder_unittest.cc",
347 "channel_mixer_unittest.cc",
348 "channel_mixing_matrix_unittest.cc",
349 "data_buffer_unittest.cc",
350 "decoder_buffer_queue_unittest.cc",
351 "decoder_buffer_unittest.cc",
353 "gmock_callback_support_unittest.cc",
354 "key_systems_unittest.cc",
355 "multi_channel_resampler_unittest.cc",
356 "pipeline_unittest.cc",
357 "ranges_unittest.cc",
358 "run_all_unittests.cc",
359 "seekable_buffer_unittest.cc",
360 "serial_runner_unittest.cc",
361 "sinc_resampler_unittest.cc",
362 "stream_parser_unittest.cc",
363 "text_ranges_unittest.cc",
364 "text_renderer_unittest.cc",
365 "user_input_monitor_unittest.cc",
366 "vector_math_testing.h",
367 "vector_math_unittest.cc",
368 "video_frame_pool_unittest.cc",
369 "video_frame_unittest.cc",
370 "video_util_unittest.cc",
371 "wall_clock_time_source_unittest.cc",
372 "yuv_convert_unittest.cc",
375 "//build/config/compiler:no_size_t_to_int_warning",
376 "//media:media_config",
386 if (media_use_ffmpeg) {
388 "audio_video_metadata_extractor_unittest.cc",
389 "media_file_checker_unittest.cc",
394 sources += [ "container_names_unittest.cc" ]
396 deps += [ "//ui/gl" ]
399 if (current_cpu == "x86" || current_cpu == "x64") {
400 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
404 source_set("perftests") {
407 "audio_bus_perftest.cc",
408 "audio_converter_perftest.cc",
409 "run_all_perftests.cc",
410 "sinc_resampler_perftest.cc",
411 "vector_math_perftest.cc",
412 "yuv_convert_perftest.cc",
414 configs += [ "//media:media_config" ]
422 if (media_use_ffmpeg) {
423 sources += [ "demuxer_perftest.cc" ]
427 deps += [ "//ui/gl" ]
431 if (current_cpu == "x86" || current_cpu == "x64") {
432 source_set("media_sse2") {
434 "simd/convert_rgb_to_yuv_sse2.cc",
435 "simd/convert_rgb_to_yuv_ssse3.cc",
436 "simd/filter_yuv_sse2.cc",
438 configs += [ "//media:media_config" ]
440 cflags = [ "-msse2" ]
444 import("//third_party/yasm/yasm_assemble.gni")
445 yasm_assemble("media_yasm") {
447 "simd/convert_rgb_to_yuv_ssse3.asm",
448 "simd/convert_yuv_to_rgb_sse.asm",
449 "simd/convert_yuva_to_argb_mmx.asm",
450 "simd/empty_register_state_mmx.asm",
451 "simd/linear_scale_yuv_to_rgb_mmx.asm",
452 "simd/linear_scale_yuv_to_rgb_sse.asm",
453 "simd/scale_yuv_to_rgb_mmx.asm",
454 "simd/scale_yuv_to_rgb_sse.asm",
457 # TODO(ajwong): Only export if shared_library build...
462 # In addition to the same path as source asm, let yasm %include
463 # search path be relative to src/ per Chromium policy.
465 rebase_path("..", root_build_dir),
469 "//third_party/x86inc/x86inc.asm",
470 "simd/convert_rgb_to_yuv_ssse3.inc",
471 "simd/convert_yuv_to_rgb_mmx.inc",
472 "simd/convert_yuva_to_argb_mmx.inc",
473 "simd/linear_scale_yuv_to_rgb_mmx.inc",
474 "simd/media_export.asm",
475 "simd/scale_yuv_to_rgb_mmx.inc",
478 if (current_cpu == "x86") {
479 yasm_flags += [ "-DARCH_X86_32" ]
480 } else if (current_cpu == "x64") {
481 yasm_flags += [ "-DARCH_X86_64" ]
483 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
484 "simd/scale_yuv_to_rgb_sse2_x64.asm",
488 if (is_mac || is_ios) {
495 yasm_flags += [ "-DELF" ]
496 if (current_cpu == "x64") {
497 # TODO(ajwong): Why isn't this true in mac?
498 yasm_flags += [ "-DPIC" ]