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",
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",
104 "key_systems_support_uma.cc",
105 "key_systems_support_uma.h",
118 "multi_channel_resampler.cc",
119 "multi_channel_resampler.h",
129 "renderer_factory.cc",
130 "renderer_factory.h",
133 "scoped_histogram_timer.h",
134 "seekable_buffer.cc",
138 "simd/convert_rgb_to_yuv.h",
139 "simd/convert_rgb_to_yuv_c.cc",
140 "simd/convert_yuv_to_rgb.h",
141 "simd/convert_yuv_to_rgb_c.cc",
143 "simd/filter_yuv_c.cc",
148 "stream_parser_buffer.cc",
149 "stream_parser_buffer.h",
157 "text_track_config.cc",
158 "text_track_config.h",
159 "time_delta_interpolator.cc",
160 "time_delta_interpolator.h",
162 "user_input_monitor.cc",
163 "user_input_monitor.h",
166 "video_decoder_config.cc",
167 "video_decoder_config.h",
170 "video_frame_pool.cc",
171 "video_frame_pool.h",
177 "wall_clock_time_source.cc",
178 "wall_clock_time_source.h",
187 configs += [ "//media:media_config" ]
189 if (media_use_ffmpeg) {
191 "audio_video_metadata_extractor.cc",
192 "audio_video_metadata_extractor.h",
193 "container_names.cc",
195 "media_file_checker.cc",
196 "media_file_checker.h",
198 deps += [ "//third_party/ffmpeg" ]
201 if (enable_browser_cdms) {
205 "browser_cdm_factory.cc",
206 "browser_cdm_factory.h",
211 sources += [ "media_stub.cc" ]
213 sources += [ "media_win.cc" ]
214 } else if (is_posix) {
215 sources += [ "media_posix.cc" ]
218 if (is_linux && use_x11) {
220 "//build/config/linux:x11",
221 "//build/config/linux:xext",
223 # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
224 # "//build/config/linux:xdamage",
225 # "//build/config/linux:xfixes",
226 # "//build/config/linux:xtst",
228 sources += [ "user_input_monitor_linux.cc" ]
230 "//ui/events:events_base",
234 sources += [ "user_input_monitor_mac.cc" ]
236 sources += [ "user_input_monitor_win.cc" ]
238 defines += [ "DISABLE_USER_INPUT_MONITOR" ]
241 if (cpu_arch == "x86" || cpu_arch == "x64") {
242 sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
249 if (is_linux || is_win) {
251 "keyboard_event_counter.cc",
252 "keyboard_event_counter.h",
257 # Minimal media component for media/cast on iOS.
258 config("base_for_cast_ios_dependent_config") {
259 defines = [ "MEDIA_FOR_CAST_IOS" ]
262 source_set("base_for_cast_ios") {
267 configs += [ "//media:media_config" ]
268 all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
271 source_set("test_support") {
274 "fake_audio_render_callback.cc",
275 "fake_audio_render_callback.h",
276 "fake_audio_renderer_sink.cc",
277 "fake_audio_renderer_sink.h",
278 "fake_text_track_stream.cc",
279 "fake_text_track_stream.h",
280 "gmock_callback_support.h",
281 "mock_audio_renderer_sink.cc",
282 "mock_audio_renderer_sink.h",
283 "mock_demuxer_host.cc",
284 "mock_demuxer_host.h",
292 configs += [ "//media:media_config" ]
298 source_set("unittests") {
301 "audio_block_fifo_unittest.cc",
302 "audio_buffer_converter_unittest.cc",
303 "audio_buffer_unittest.cc",
304 "audio_buffer_queue_unittest.cc",
305 "audio_bus_unittest.cc",
306 "audio_converter_unittest.cc",
307 "audio_discard_helper_unittest.cc",
308 "audio_fifo_unittest.cc",
309 "audio_hardware_config_unittest.cc",
310 "audio_hash_unittest.cc",
311 "audio_pull_fifo_unittest.cc",
312 "audio_renderer_mixer_input_unittest.cc",
313 "audio_renderer_mixer_unittest.cc",
314 "audio_shifter_unittest.cc",
315 "audio_splicer_unittest.cc",
316 "audio_timestamp_helper_unittest.cc",
317 "bind_to_current_loop_unittest.cc",
318 "bit_reader_unittest.cc",
320 "callback_holder_unittest.cc",
321 "channel_mixer_unittest.cc",
322 "channel_mixing_matrix_unittest.cc",
323 "data_buffer_unittest.cc",
324 "decoder_buffer_queue_unittest.cc",
325 "decoder_buffer_unittest.cc",
327 "gmock_callback_support_unittest.cc",
328 "key_systems_unittest.cc",
329 "multi_channel_resampler_unittest.cc",
330 "pipeline_unittest.cc",
331 "ranges_unittest.cc",
332 "run_all_unittests.cc",
333 "scoped_histogram_timer_unittest.cc",
334 "serial_runner_unittest.cc",
335 "seekable_buffer_unittest.cc",
336 "sinc_resampler_unittest.cc",
337 "stream_parser_unittest.cc",
338 "text_ranges_unittest.cc",
339 "text_renderer_unittest.cc",
340 "user_input_monitor_unittest.cc",
341 "vector_math_testing.h",
342 "vector_math_unittest.cc",
343 "video_frame_unittest.cc",
344 "video_frame_pool_unittest.cc",
345 "video_util_unittest.cc",
346 "wall_clock_time_source_unittest.cc",
347 "yuv_convert_unittest.cc",
349 configs += [ "//media:media_config" ]
358 if (media_use_ffmpeg) {
360 "audio_video_metadata_extractor_unittest.cc",
361 "media_file_checker_unittest.cc",
366 sources += [ "container_names_unittest.cc" ]
368 deps += [ "//ui/gl" ]
371 if (cpu_arch == "x86" || cpu_arch == "x64") {
372 sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
376 source_set("perftests") {
379 "audio_bus_perftest.cc",
380 "audio_converter_perftest.cc",
381 "run_all_perftests.cc",
382 "sinc_resampler_perftest.cc",
383 "vector_math_perftest.cc",
384 "yuv_convert_perftest.cc",
386 configs += [ "//media:media_config" ]
394 if (media_use_ffmpeg) {
395 sources += [ "demuxer_perftest.cc" ]
399 deps += [ "//ui/gl" ]
403 if (cpu_arch == "x86" || cpu_arch == "x64") {
404 source_set("media_sse2") {
406 "simd/convert_rgb_to_yuv_sse2.cc",
407 "simd/convert_rgb_to_yuv_ssse3.cc",
408 "simd/filter_yuv_sse2.cc",
410 configs += [ "//media:media_config" ]
412 cflags = [ "-msse2" ]
416 import("//third_party/yasm/yasm_assemble.gni")
417 yasm_assemble("media_yasm") {
419 "simd/convert_rgb_to_yuv_ssse3.asm",
420 "simd/convert_yuv_to_rgb_sse.asm",
421 "simd/convert_yuva_to_argb_mmx.asm",
422 "simd/empty_register_state_mmx.asm",
423 "simd/linear_scale_yuv_to_rgb_mmx.asm",
424 "simd/linear_scale_yuv_to_rgb_sse.asm",
425 "simd/scale_yuv_to_rgb_mmx.asm",
426 "simd/scale_yuv_to_rgb_sse.asm",
429 # TODO(ajwong): Only export if shared_library build...
434 # In addition to the same path as source asm, let yasm %include
435 # search path be relative to src/ per Chromium policy.
437 rebase_path("..", root_build_dir),
441 "//third_party/x86inc/x86inc.asm",
442 "simd/convert_rgb_to_yuv_ssse3.inc",
443 "simd/convert_yuv_to_rgb_mmx.inc",
444 "simd/convert_yuva_to_argb_mmx.inc",
445 "simd/linear_scale_yuv_to_rgb_mmx.inc",
446 "simd/media_export.asm",
447 "simd/scale_yuv_to_rgb_mmx.inc",
450 if (cpu_arch == "x86") {
451 yasm_flags += [ "-DARCH_X86_32" ]
452 } else if (cpu_arch == "x64") {
453 yasm_flags += [ "-DARCH_X86_64" ]
455 "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
456 "simd/scale_yuv_to_rgb_sse2_x64.asm",
460 if (is_mac || is_ios) {
467 yasm_flags += [ "-DELF" ]
468 if (cpu_arch == "x64") {
469 # TODO(ajwong): Why isn't this true in mac?
470 yasm_flags += [ "-DPIC" ]