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 visibility = [ "//media/*" ]
15 "audio_block_fifo.cc",
19 "audio_buffer_converter.cc",
20 "audio_buffer_converter.h",
21 "audio_buffer_queue.cc",
22 "audio_buffer_queue.h",
23 "audio_capturer_source.h",
28 "audio_decoder_config.cc",
29 "audio_decoder_config.h",
30 "audio_discard_helper.cc",
31 "audio_discard_helper.h",
34 "audio_hardware_config.cc",
35 "audio_hardware_config.h",
42 "audio_renderer_mixer.cc",
43 "audio_renderer_mixer.h",
44 "audio_renderer_mixer_input.cc",
45 "audio_renderer_mixer_input.h",
46 "audio_renderer_sink.h",
51 "audio_timestamp_helper.cc",
52 "audio_timestamp_helper.h",
53 "bind_to_current_loop.h",
63 "cdm_callback_promise.cc",
64 "cdm_callback_promise.h",
69 "cdm_key_information.cc",
70 "cdm_key_information.h",
73 "cdm_promise_adapter.cc",
74 "cdm_promise_adapter.h",
77 "channel_mixing_matrix.cc",
78 "channel_mixing_matrix.h",
86 "decoder_buffer_queue.cc",
87 "decoder_buffer_queue.h",
96 "demuxer_stream_provider.cc",
97 "demuxer_stream_provider.h",
101 "key_system_info.cc",
106 "key_systems_support_uma.cc",
107 "key_systems_support_uma.h",
117 "media_permission.cc",
118 "media_permission.h",
121 "multi_channel_resampler.cc",
122 "multi_channel_resampler.h",
132 "renderer_factory.cc",
133 "renderer_factory.h",
136 "seekable_buffer.cc",
140 "simd/convert_rgb_to_yuv.h",
141 "simd/convert_rgb_to_yuv_c.cc",
142 "simd/convert_yuv_to_rgb.h",
143 "simd/convert_yuv_to_rgb_c.cc",
145 "simd/filter_yuv_c.cc",
150 "stream_parser_buffer.cc",
151 "stream_parser_buffer.h",
159 "text_track_config.cc",
160 "text_track_config.h",
161 "time_delta_interpolator.cc",
162 "time_delta_interpolator.h",
164 "user_input_monitor.cc",
165 "user_input_monitor.h",
166 "video_capture_types.cc",
167 "video_capture_types.h",
168 "video_capturer_source.cc",
169 "video_capturer_source.h",
172 "video_decoder_config.cc",
173 "video_decoder_config.h",
176 "video_frame_metadata.cc",
177 "video_frame_metadata.h",
178 "video_frame_pool.cc",
179 "video_frame_pool.h",
185 "wall_clock_time_source.cc",
186 "wall_clock_time_source.h",
195 configs += [ "//media:media_config" ]
197 if (media_use_ffmpeg) {
199 "audio_video_metadata_extractor.cc",
200 "audio_video_metadata_extractor.h",
201 "container_names.cc",
203 "media_file_checker.cc",
204 "media_file_checker.h",
206 deps += [ "//third_party/ffmpeg" ]
209 if (enable_browser_cdms) {
213 "browser_cdm_factory.cc",
214 "browser_cdm_factory.h",
219 sources += [ "media_stub.cc" ]
221 sources += [ "media_win.cc" ]
222 } else if (is_posix) {
223 sources += [ "media_posix.cc" ]
226 if (is_linux && use_x11) {
228 "//build/config/linux:x11",
229 "//build/config/linux:xext",
231 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
232 # "//build/config/linux:xdamage",
233 # "//build/config/linux:xfixes",
234 # "//build/config/linux:xtst",
236 sources += [ "user_input_monitor_linux.cc" ]
238 "//ui/events:events_base",
242 sources += [ "user_input_monitor_mac.cc" ]
244 # Required by video_frame.cc.
245 libs = [ "CoreVideo.framework" ]
247 sources += [ "user_input_monitor_win.cc" ]
249 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
252 if (current_cpu == "x86" || current_cpu == "x64") {
253 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
260 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
262 if (is_linux || is_win) {
264 "keyboard_event_counter.cc",
265 "keyboard_event_counter.h",
270 # Minimal media component for media/cast on iOS.
271 config("base_for_cast_ios_dependent_config") {
272 defines = [ "MEDIA_FOR_CAST_IOS" ]
275 source_set("base_for_cast_ios") {
277 "simd/convert_rgb_to_yuv.h",
278 "simd/convert_rgb_to_yuv_c.cc",
279 "simd/convert_yuv_to_rgb.h",
280 "simd/convert_yuv_to_rgb_c.cc",
282 "simd/filter_yuv_c.cc",
285 "video_frame_metadata.cc",
286 "video_frame_metadata.h",
293 "//build/config/compiler:no_size_t_to_int_warning",
294 "//media:media_config",
296 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
299 source_set("test_support") {
302 "fake_audio_render_callback.cc",
303 "fake_audio_render_callback.h",
304 "fake_audio_renderer_sink.cc",
305 "fake_audio_renderer_sink.h",
306 "fake_text_track_stream.cc",
307 "fake_text_track_stream.h",
308 "gmock_callback_support.h",
309 "mock_audio_renderer_sink.cc",
310 "mock_audio_renderer_sink.h",
311 "mock_demuxer_host.cc",
312 "mock_demuxer_host.h",
320 configs += [ "//media:media_config" ]
326 source_set("unittests") {
329 "audio_block_fifo_unittest.cc",
330 "audio_buffer_converter_unittest.cc",
331 "audio_buffer_queue_unittest.cc",
332 "audio_buffer_unittest.cc",
333 "audio_bus_unittest.cc",
334 "audio_converter_unittest.cc",
335 "audio_discard_helper_unittest.cc",
336 "audio_fifo_unittest.cc",
337 "audio_hardware_config_unittest.cc",
338 "audio_hash_unittest.cc",
339 "audio_pull_fifo_unittest.cc",
340 "audio_renderer_mixer_input_unittest.cc",
341 "audio_renderer_mixer_unittest.cc",
342 "audio_shifter_unittest.cc",
343 "audio_splicer_unittest.cc",
344 "audio_timestamp_helper_unittest.cc",
345 "bind_to_current_loop_unittest.cc",
346 "bit_reader_unittest.cc",
348 "callback_holder_unittest.cc",
349 "channel_mixer_unittest.cc",
350 "channel_mixing_matrix_unittest.cc",
351 "data_buffer_unittest.cc",
352 "decoder_buffer_queue_unittest.cc",
353 "decoder_buffer_unittest.cc",
355 "gmock_callback_support_unittest.cc",
356 "key_systems_unittest.cc",
357 "multi_channel_resampler_unittest.cc",
358 "pipeline_unittest.cc",
359 "ranges_unittest.cc",
360 "run_all_unittests.cc",
361 "seekable_buffer_unittest.cc",
362 "serial_runner_unittest.cc",
363 "sinc_resampler_unittest.cc",
364 "stream_parser_unittest.cc",
365 "text_ranges_unittest.cc",
366 "text_renderer_unittest.cc",
367 "user_input_monitor_unittest.cc",
368 "vector_math_testing.h",
369 "vector_math_unittest.cc",
370 "video_frame_pool_unittest.cc",
371 "video_frame_unittest.cc",
372 "video_util_unittest.cc",
373 "wall_clock_time_source_unittest.cc",
374 "yuv_convert_unittest.cc",
377 "//build/config/compiler:no_size_t_to_int_warning",
378 "//media:media_config",
383 "//gpu/command_buffer/common",
389 if (media_use_ffmpeg) {
391 "audio_video_metadata_extractor_unittest.cc",
392 "media_file_checker_unittest.cc",
397 sources += [ "container_names_unittest.cc" ]
399 deps += [ "//ui/gl" ]
402 if (current_cpu == "x86" || current_cpu == "x64") {
403 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
407 source_set("perftests") {
410 "audio_bus_perftest.cc",
411 "audio_converter_perftest.cc",
412 "run_all_perftests.cc",
413 "sinc_resampler_perftest.cc",
414 "vector_math_perftest.cc",
415 "yuv_convert_perftest.cc",
417 configs += [ "//media:media_config" ]
425 if (media_use_ffmpeg) {
426 sources += [ "demuxer_perftest.cc" ]
430 deps += [ "//ui/gl" ]
434 if (current_cpu == "x86" || current_cpu == "x64") {
435 source_set("media_sse2") {
437 "simd/convert_rgb_to_yuv_sse2.cc",
438 "simd/convert_rgb_to_yuv_ssse3.cc",
439 "simd/filter_yuv_sse2.cc",
441 configs += [ "//media:media_config" ]
443 cflags = [ "-msse2" ]
447 import("//third_party/yasm/yasm_assemble.gni")
448 yasm_assemble("media_yasm") {
450 "simd/convert_rgb_to_yuv_ssse3.asm",
451 "simd/convert_yuv_to_rgb_sse.asm",
452 "simd/convert_yuva_to_argb_mmx.asm",
453 "simd/empty_register_state_mmx.asm",
454 "simd/linear_scale_yuv_to_rgb_mmx.asm",
455 "simd/linear_scale_yuv_to_rgb_sse.asm",
456 "simd/scale_yuv_to_rgb_mmx.asm",
457 "simd/scale_yuv_to_rgb_sse.asm",
460 # TODO(ajwong): Only export if shared_library build...
465 # In addition to the same path as source asm, let yasm %include
466 # search path be relative to src/ per Chromium policy.
468 rebase_path("..", root_build_dir),
472 "//third_party/x86inc/x86inc.asm",
473 "simd/convert_rgb_to_yuv_ssse3.inc",
474 "simd/convert_yuv_to_rgb_mmx.inc",
475 "simd/convert_yuva_to_argb_mmx.inc",
476 "simd/linear_scale_yuv_to_rgb_mmx.inc",
477 "simd/media_export.asm",
478 "simd/scale_yuv_to_rgb_mmx.inc",
481 if (current_cpu == "x86") {
482 yasm_flags += [ "-DARCH_X86_32" ]
483 } else if (current_cpu == "x64") {
484 yasm_flags += [ "-DARCH_X86_64" ]
486 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
487 "simd/scale_yuv_to_rgb_sse2_x64.asm",
491 if (is_mac || is_ios) {
498 yasm_flags += [ "-DELF" ]
499 if (current_cpu == "x64") {
500 # TODO(ajwong): Why isn't this true in mac?
501 yasm_flags += [ "-DPIC" ]