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_queue.cc",
19 "audio_buffer_queue.h",
20 "audio_capturer_source.h",
21 "audio_buffer_converter.cc",
22 "audio_buffer_converter.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",
48 "audio_timestamp_helper.cc",
49 "audio_timestamp_helper.h",
50 "bind_to_current_loop.h",
60 "cdm_callback_promise.cc",
61 "cdm_callback_promise.h",
70 "channel_mixing_matrix.cc",
71 "channel_mixing_matrix.h",
79 "decoder_buffer_queue.cc",
80 "decoder_buffer_queue.h",
89 "demuxer_stream_provider.cc",
90 "demuxer_stream_provider.h",
98 "key_systems_support_uma.cc",
99 "key_systems_support_uma.h",
112 "multi_channel_resampler.cc",
113 "multi_channel_resampler.h",
123 "renderer_factory.cc",
124 "renderer_factory.h",
127 "scoped_histogram_timer.h",
128 "seekable_buffer.cc",
132 "simd/convert_rgb_to_yuv.h",
133 "simd/convert_rgb_to_yuv_c.cc",
134 "simd/convert_yuv_to_rgb.h",
135 "simd/convert_yuv_to_rgb_c.cc",
137 "simd/filter_yuv_c.cc",
138 "simd/yuv_to_rgb_table.cc",
139 "simd/yuv_to_rgb_table.h",
144 "stream_parser_buffer.cc",
145 "stream_parser_buffer.h",
153 "text_track_config.cc",
154 "text_track_config.h",
155 "time_delta_interpolator.cc",
156 "time_delta_interpolator.h",
158 "user_input_monitor.cc",
159 "user_input_monitor.h",
162 "video_decoder_config.cc",
163 "video_decoder_config.h",
166 "video_frame_pool.cc",
167 "video_frame_pool.h",
173 "wall_clock_time_source.cc",
174 "wall_clock_time_source.h",
183 configs += [ "//media:media_config" ]
185 if (media_use_ffmpeg) {
187 "audio_video_metadata_extractor.cc",
188 "audio_video_metadata_extractor.h",
189 "container_names.cc",
191 "media_file_checker.cc",
192 "media_file_checker.h",
194 deps += [ "//third_party/ffmpeg" ]
197 if (enable_browser_cdms) {
201 "browser_cdm_factory.cc",
202 "browser_cdm_factory.h",
207 sources += [ "media_stub.cc" ]
209 sources += [ "media_win.cc" ]
210 } else if (is_posix) {
211 sources += [ "media_posix.cc" ]
214 if (is_linux && use_x11) {
216 "//build/config/linux:x11",
217 "//build/config/linux:xext",
219 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
220 # "//build/config/linux:xdamage",
221 # "//build/config/linux:xfixes",
222 # "//build/config/linux:xtst",
224 sources += [ "user_input_monitor_linux.cc" ]
226 "//ui/events:events_base",
230 sources += [ "user_input_monitor_mac.cc" ]
232 sources += [ "user_input_monitor_win.cc" ]
234 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
237 if (cpu_arch == "x86" || cpu_arch == "x64") {
238 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
245 if (is_linux || is_win) {
247 "keyboard_event_counter.cc",
248 "keyboard_event_counter.h",
253 # Minimal media component for media/cast on iOS.
254 config("base_for_cast_ios_dependent_config") {
255 defines = [ "MEDIA_FOR_CAST_IOS" ]
258 source_set("base_for_cast_ios") {
263 configs += [ "//media:media_config" ]
264 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
267 source_set("test_support") {
270 "fake_audio_render_callback.cc",
271 "fake_audio_render_callback.h",
272 "fake_audio_renderer_sink.cc",
273 "fake_audio_renderer_sink.h",
274 "fake_text_track_stream.cc",
275 "fake_text_track_stream.h",
276 "gmock_callback_support.h",
277 "mock_audio_renderer_sink.cc",
278 "mock_audio_renderer_sink.h",
279 "mock_demuxer_host.cc",
280 "mock_demuxer_host.h",
288 configs += [ "//media:media_config" ]
294 source_set("unittests") {
297 "audio_block_fifo_unittest.cc",
298 "audio_buffer_converter_unittest.cc",
299 "audio_buffer_unittest.cc",
300 "audio_buffer_queue_unittest.cc",
301 "audio_bus_unittest.cc",
302 "audio_converter_unittest.cc",
303 "audio_discard_helper_unittest.cc",
304 "audio_fifo_unittest.cc",
305 "audio_hardware_config_unittest.cc",
306 "audio_hash_unittest.cc",
307 "audio_pull_fifo_unittest.cc",
308 "audio_renderer_mixer_input_unittest.cc",
309 "audio_renderer_mixer_unittest.cc",
310 "audio_splicer_unittest.cc",
311 "audio_timestamp_helper_unittest.cc",
312 "bind_to_current_loop_unittest.cc",
313 "bit_reader_unittest.cc",
315 "callback_holder_unittest.cc",
316 "channel_mixer_unittest.cc",
317 "channel_mixing_matrix_unittest.cc",
318 "data_buffer_unittest.cc",
319 "decoder_buffer_queue_unittest.cc",
320 "decoder_buffer_unittest.cc",
322 "gmock_callback_support_unittest.cc",
323 "key_systems_unittest.cc",
324 "multi_channel_resampler_unittest.cc",
325 "pipeline_unittest.cc",
326 "ranges_unittest.cc",
327 "run_all_unittests.cc",
328 "scoped_histogram_timer_unittest.cc",
329 "serial_runner_unittest.cc",
330 "seekable_buffer_unittest.cc",
331 "sinc_resampler_unittest.cc",
332 "stream_parser_unittest.cc",
333 "text_ranges_unittest.cc",
334 "text_renderer_unittest.cc",
335 "user_input_monitor_unittest.cc",
336 "vector_math_testing.h",
337 "vector_math_unittest.cc",
338 "video_frame_unittest.cc",
339 "video_frame_pool_unittest.cc",
340 "video_util_unittest.cc",
341 "wall_clock_time_source_unittest.cc",
342 "yuv_convert_unittest.cc",
344 configs += [ "//media:media_config" ]
353 if (media_use_ffmpeg) {
355 "audio_video_metadata_extractor_unittest.cc",
356 "media_file_checker_unittest.cc",
361 sources += [ "container_names_unittest.cc" ]
363 deps += [ "//ui/gl" ]
366 if (cpu_arch == "x86" || cpu_arch == "x64") {
367 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
371 source_set("perftests") {
374 "audio_bus_perftest.cc",
375 "audio_converter_perftest.cc",
376 "run_all_perftests.cc",
377 "sinc_resampler_perftest.cc",
378 "vector_math_perftest.cc",
379 "yuv_convert_perftest.cc",
381 configs += [ "//media:media_config" ]
389 if (media_use_ffmpeg) {
390 sources += [ "demuxer_perftest.cc" ]
394 deps += [ "//ui/gl" ]
398 if (cpu_arch == "x86" || cpu_arch == "x64") {
399 source_set("media_sse2") {
401 "simd/convert_rgb_to_yuv_sse2.cc",
402 "simd/convert_rgb_to_yuv_ssse3.cc",
403 "simd/filter_yuv_sse2.cc",
405 configs += [ "//media:media_config" ]
407 cflags = [ "-msse2" ]
411 import("//third_party/yasm/yasm_assemble.gni")
412 yasm_assemble("media_yasm") {
414 "simd/convert_rgb_to_yuv_ssse3.asm",
415 "simd/convert_yuv_to_rgb_sse.asm",
416 "simd/convert_yuva_to_argb_mmx.asm",
417 "simd/empty_register_state_mmx.asm",
418 "simd/linear_scale_yuv_to_rgb_mmx.asm",
419 "simd/linear_scale_yuv_to_rgb_sse.asm",
420 "simd/scale_yuv_to_rgb_mmx.asm",
421 "simd/scale_yuv_to_rgb_sse.asm",
424 # TODO(ajwong): Only export if shared_library build...
429 # In addition to the same path as source asm, let yasm %include
430 # search path be relative to src/ per Chromium policy.
432 rebase_path("..", root_build_dir),
436 "//third_party/x86inc/x86inc.asm",
437 "simd/convert_rgb_to_yuv_ssse3.inc",
438 "simd/convert_yuv_to_rgb_mmx.inc",
439 "simd/convert_yuva_to_argb_mmx.inc",
440 "simd/linear_scale_yuv_to_rgb_mmx.inc",
441 "simd/media_export.asm",
442 "simd/scale_yuv_to_rgb_mmx.inc",
445 if (cpu_arch == "x86") {
446 yasm_flags += [ "-DARCH_X86_32" ]
447 } else if (cpu_arch == "x64") {
448 yasm_flags += [ "-DARCH_X86_64" ]
450 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
451 "simd/scale_yuv_to_rgb_sse2_x64.asm",
455 if (is_mac || is_ios) {
462 yasm_flags += [ "-DELF" ]
463 if (cpu_arch == "x64") {
464 # TODO(ajwong): Why isn't this true in mac?
465 yasm_flags += [ "-DPIC" ]