16e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)# Copyright 2014 The Chromium Authors. All rights reserved.
26e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be
36e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)# found in the LICENSE file.
46e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
56e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)import("//build/config/android/config.gni")
66e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)import("//build/config/arm.gni")
76e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)import("//build/config/ui.gni")
86e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)import("//build/config/linux/pkg_config.gni")
96e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)import("//media/media_options.gni")
106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)source_set("base") {
126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  sources = [
136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_block_fifo.cc",
146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_block_fifo.h",
156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer.cc",
166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer.h",
176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_queue.cc",
186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_queue.h",
196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_capturer_source.h",
206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_converter.cc",
216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_converter.h",
226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_converter.cc",
236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_converter.h",
246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_decoder.cc",
256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_decoder.h",
266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_decoder_config.cc",
276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_decoder_config.h",
286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_discard_helper.cc",
296e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_discard_helper.h",
306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_fifo.cc",
316e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_fifo.h",
326e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_hardware_config.cc",
336e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_hardware_config.h",
346e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_hash.cc",
356e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_hash.h",
366e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_pull_fifo.cc",
376e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_pull_fifo.h",
386e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer.cc",
396e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer.h",
406e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_mixer.cc",
416e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_mixer.h",
426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_mixer_input.cc",
436e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_mixer_input.h",
446e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_sink.h",
456e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_splicer.cc",
466e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_splicer.h",
476e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_timestamp_helper.cc",
486e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_timestamp_helper.h",
496e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bind_to_current_loop.h",
506e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bit_reader.cc",
516e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bit_reader.h",
526e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bit_reader_core.cc",
536e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bit_reader_core.h",
546e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bitstream_buffer.h",
556e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "buffering_state.h",
566e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "buffers.h",
576e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "byte_queue.cc",
586e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "byte_queue.h",
596e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "cdm_promise.cc",
606e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "cdm_promise.h",
616e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "channel_mixer.cc",
626e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "channel_mixer.h",
636e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "clock.h",
646e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "data_buffer.cc",
656e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "data_buffer.h",
666e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "data_source.cc",
676e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "data_source.h",
686e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decoder_buffer.cc",
696e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decoder_buffer.h",
706e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decoder_buffer_queue.cc",
716e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decoder_buffer_queue.h",
726e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decrypt_config.cc",
736e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decrypt_config.h",
746e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decryptor.cc",
756e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decryptor.h",
766e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "demuxer.cc",
776e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "demuxer.h",
786e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "demuxer_stream.cc",
796e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "demuxer_stream.h",
801320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    "demuxer_stream_provider.cc",
811320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    "demuxer_stream_provider.h",
826e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "djb2.cc",
836e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "djb2.h",
846e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media.cc",
856e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media.h",
866e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_keys.cc",
876e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_keys.h",
886e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_log.cc",
896e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_log.h",
906e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_log_event.h",
916e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_switches.cc",
926e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "media_switches.h",
936e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "multi_channel_resampler.cc",
946e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "multi_channel_resampler.h",
956e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "pipeline.cc",
966e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "pipeline.h",
976e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "pipeline_status.h",
986e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "player_tracker.cc",
996e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "player_tracker.h",
1006e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "ranges.cc",
1016e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "ranges.h",
1021320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    "renderer.cc",
1031320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    "renderer.h",
1046e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "sample_format.cc",
1056e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "sample_format.h",
1066e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "scoped_histogram_timer.h",
1076e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "seekable_buffer.cc",
1086e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "seekable_buffer.h",
1096e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "serial_runner.cc",
1106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "serial_runner.h",
1116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/convert_rgb_to_yuv.h",
1126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/convert_rgb_to_yuv_c.cc",
1136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/convert_yuv_to_rgb.h",
1146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/convert_yuv_to_rgb_c.cc",
1156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/filter_yuv.h",
1166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/filter_yuv_c.cc",
1176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/yuv_to_rgb_table.cc",
1186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "simd/yuv_to_rgb_table.h",
1196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "sinc_resampler.cc",
1206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "sinc_resampler.h",
1216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "stream_parser.cc",
1226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "stream_parser.h",
1236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "stream_parser_buffer.cc",
1246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "stream_parser_buffer.h",
1256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_cue.cc",
1266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_cue.h",
1276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_ranges.cc",
1286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_ranges.h",
1296e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_renderer.cc",
1306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_renderer.h",
1316e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_track.h",
1326e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_track_config.cc",
1336e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_track_config.h",
1346e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "time_delta_interpolator.cc",
1356e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "time_delta_interpolator.h",
1366e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "time_source.h",
1376e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "user_input_monitor.cc",
1386e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "user_input_monitor.h",
1396e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_decoder.cc",
1406e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_decoder.h",
1416e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_decoder_config.cc",
1426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_decoder_config.h",
1436e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_frame.cc",
1446e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_frame.h",
1456e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_frame_pool.cc",
1466e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_frame_pool.h",
1476e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_renderer.cc",
1486e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_renderer.h",
1496e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_rotation.h",
1506e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_util.cc",
1516e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_util.h",
1526e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "wall_clock_time_source.cc",
1536e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "wall_clock_time_source.h",
1546e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "yuv_convert.cc",
1556e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "yuv_convert.h",
1566e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  ]
1576e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  defines = []
1586e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  deps = [ "//skia" ]
1596e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  libs = []
1606e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  configs += [ "//media:media_config" ]
1616e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
1626e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (media_use_ffmpeg) {
1636e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [
1646e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "audio_video_metadata_extractor.cc",
1656e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "audio_video_metadata_extractor.h",
1666e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "container_names.cc",
1676e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "container_names.h",
1686e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "media_file_checker.cc",
1696e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "media_file_checker.h",
1706e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
1716e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    deps += [ "//third_party/ffmpeg" ]
1726e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
1736e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
1746e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (enable_browser_cdms) {
1756e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [
1766e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "browser_cdm.cc",
1776e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "browser_cdm.h",
1786e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "browser_cdm_factory.h",
1796e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
1806e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
1816e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
1826e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (is_android) {
1836e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "media_stub.cc" ]
1846e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  } else if (is_win) {
1856e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "media_win.cc" ]
1866e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  } else if (is_posix) {
1876e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "media_posix.cc" ]
1886e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
1896e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
1906e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (is_linux && use_x11) {
1916e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    configs += [
1926e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "//build/config/linux:x11",
1936e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "//build/config/linux:xext",
1946e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  # TODO(ajwong): Why does xent get a separate thing in //build/config/linux:BUILD.gn
1956e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  #         "//build/config/linux:xdamage",
1966e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  #         "//build/config/linux:xfixes",
1976e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  #         "//build/config/linux:xtst",
1986e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
1996e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "user_input_monitor_linux.cc" ]
2001320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    deps += [
2011320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      "//ui/events:events_base",
2021320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      "//ui/gfx/x",
2031320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    ]
2046e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  } else if (is_mac) {
2056e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "user_input_monitor_mac.cc" ]
2066e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  } else if (is_win) {
2076e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "user_input_monitor_win.cc" ]
2086e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  } else {
2096e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    defines += [ "DISABLE_USER_INPUT_MONITOR" ]
2106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
2116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
2126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (cpu_arch == "x86" || cpu_arch == "x64") {
2136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
2146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    deps += [
2156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      ":media_yasm",
2166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      ":media_sse2",
2176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
2186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
2196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
2206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (is_linux || is_win) {
2216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [
2226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "keyboard_event_counter.cc",
2236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "keyboard_event_counter.h",
2246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
2256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
2266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}
2276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
2281320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci# Minimal media component for media/cast on iOS.
2291320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconfig("base_for_cast_ios_dependent_config") {
2301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  defines = [ "MEDIA_FOR_CAST_IOS" ]
2311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}
2321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
2331320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccisource_set("base_for_cast_ios") {
2341320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  sources = [
2351320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    "video_frame.cc",
2361320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    "video_frame.h",
2371320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  ]
2381320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  configs += [ "//media:media_config" ]
2391320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  all_dependent_configs = [ ":base_for_cast_ios_dependent_config" ]
2401320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}
2411320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
2426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)source_set("test_support") {
2431320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  testonly = true
2446e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  sources = [
2456e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "fake_audio_render_callback.cc",
2466e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "fake_audio_render_callback.h",
2476e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "fake_audio_renderer_sink.cc",
2486e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "fake_audio_renderer_sink.h",
2496e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "fake_text_track_stream.cc",
2506e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "fake_text_track_stream.h",
2516e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "gmock_callback_support.h",
2526e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "mock_audio_renderer_sink.cc",
2536e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "mock_audio_renderer_sink.h",
2546e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "mock_demuxer_host.cc",
2556e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "mock_demuxer_host.h",
2566e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "mock_filters.cc",
2576e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "mock_filters.h",
2586e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "test_data_util.cc",
2596e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "test_data_util.h",
2606e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "test_helpers.cc",
2616e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "test_helpers.h",
2626e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  ]
2636e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  configs += [ "//media:media_config" ]
2646e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  deps = [ "//testing/gmock" ]
2656e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}
2666e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
2676e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)source_set("unittests") {
2681320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  testonly = true
2696e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  sources = [
2706e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_block_fifo_unittest.cc",
2716e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_converter_unittest.cc",
2726e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_unittest.cc",
2736e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_buffer_queue_unittest.cc",
2746e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_bus_unittest.cc",
2756e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_converter_unittest.cc",
2766e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_discard_helper_unittest.cc",
2776e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_fifo_unittest.cc",
2786e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_hardware_config_unittest.cc",
2796e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_hash_unittest.cc",
2806e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_pull_fifo_unittest.cc",
2816e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_mixer_input_unittest.cc",
2826e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_renderer_mixer_unittest.cc",
2836e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_splicer_unittest.cc",
2846e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_timestamp_helper_unittest.cc",
2856e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bind_to_current_loop_unittest.cc",
2866e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "bit_reader_unittest.cc",
2876e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "callback_holder.h",
2886e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "callback_holder_unittest.cc",
2896e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "channel_mixer_unittest.cc",
2906e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "data_buffer_unittest.cc",
2916e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decoder_buffer_queue_unittest.cc",
2926e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "decoder_buffer_unittest.cc",
2936e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "djb2_unittest.cc",
2946e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "gmock_callback_support_unittest.cc",
2956e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "multi_channel_resampler_unittest.cc",
2966e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "pipeline_unittest.cc",
2976e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "ranges_unittest.cc",
2986e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "run_all_unittests.cc",
2996e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "scoped_histogram_timer_unittest.cc",
3006e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "serial_runner_unittest.cc",
3016e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "seekable_buffer_unittest.cc",
3026e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "sinc_resampler_unittest.cc",
3036e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "stream_parser_unittest.cc",
3046e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_ranges_unittest.cc",
3056e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "text_renderer_unittest.cc",
3066e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "user_input_monitor_unittest.cc",
3076e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "vector_math_testing.h",
3086e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "vector_math_unittest.cc",
3096e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_frame_unittest.cc",
3106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_frame_pool_unittest.cc",
3116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "video_util_unittest.cc",
3126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "wall_clock_time_source_unittest.cc",
3136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "yuv_convert_unittest.cc",
3146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  ]
3156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  configs += [ "//media:media_config" ]
3166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  deps = [
3176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ":base",
3186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ":test_support",
3196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "//skia",
3206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "//testing/gmock",
3216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "//testing/gtest",
3226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  ]
3236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (media_use_ffmpeg) {
3256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [
3266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "audio_video_metadata_extractor_unittest.cc",
3276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "media_file_checker_unittest.cc",
3286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
3296e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
3306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3316e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (!is_android) {
3326e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [
3336e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "container_names_unittest.cc",
3346e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
3356e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  } else {
3366e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    deps += [ "//ui/gl" ]
3376e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
3386e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3396e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (cpu_arch == "x86" || cpu_arch == "x64") {
3406e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [ "simd/convert_rgb_to_yuv_unittest.cc" ]
3416e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
3426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}
3436e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3446e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)source_set("perftests") {
3451320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  testonly = true
3466e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  sources = [
3476e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_bus_perftest.cc",
3486e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "audio_converter_perftest.cc",
3496e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "run_all_perftests.cc",
3506e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "sinc_resampler_perftest.cc",
3516e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "vector_math_perftest.cc",
3526e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "yuv_convert_perftest.cc",
3536e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  ]
3546e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  configs += [ "//media:media_config" ]
3556e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  deps = [
3566e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ":base",
3576e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ":test_support",
3586e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "//testing/gmock",
3596e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    "//testing/gtest",
3606e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  ]
3616e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3626e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (media_use_ffmpeg) {
3636e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources += [
3646e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "demuxer_perftest.cc",
3656e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
3666e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
3676e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3686e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  if (is_android) {
3696e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    deps += [ "//ui/gl"]
3706e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
3716e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}
3726e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3736e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)if (cpu_arch == "x86" || cpu_arch == "x64") {
3746e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  source_set("media_sse2") {
3756e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources = [
3766e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_rgb_to_yuv_sse2.cc",
3776e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_rgb_to_yuv_ssse3.cc",
3786e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/filter_yuv_sse2.cc",
3796e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
3806e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    configs += [ "//media:media_config" ]
3816e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    if (!is_win) {
3826e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      cflags = [ "-msse2" ]
3836e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    }
3846e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
3856e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3866e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  import("//third_party/yasm/yasm_assemble.gni")
3876e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  yasm_assemble("media_yasm") {
3886e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    sources = [
3896e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_rgb_to_yuv_ssse3.asm",
3906e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_yuv_to_rgb_sse.asm",
3916e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_yuva_to_argb_mmx.asm",
3926e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/empty_register_state_mmx.asm",
3936e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/linear_scale_yuv_to_rgb_mmx.asm",
3946e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/linear_scale_yuv_to_rgb_sse.asm",
3956e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/scale_yuv_to_rgb_mmx.asm",
3966e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/scale_yuv_to_rgb_sse.asm",
3976e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
3986e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
3996e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    # TODO(ajwong): Only export if shared_library build...
4006e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    yasm_flags = [
4016e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "-DCHROMIUM",
4026e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "-DEXPORT_SYMBOLS",
4036e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      # In addition to the same path as source asm, let yasm %include
4046e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      # search path be relative to src/ per Chromium policy.
4056e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "-I", rebase_path("..", root_build_dir),
4066e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
4076e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
4086e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    inputs = [
4096e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "//third_party/x86inc/x86inc.asm",
4106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_rgb_to_yuv_ssse3.inc",
4116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_yuv_to_rgb_mmx.inc",
4126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/convert_yuva_to_argb_mmx.inc",
4136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/linear_scale_yuv_to_rgb_mmx.inc",
4146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/media_export.asm",
4156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      "simd/scale_yuv_to_rgb_mmx.inc",
4166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ]
4176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
4186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    if (cpu_arch == "x86") {
4196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      yasm_flags += [ "-DARCH_X86_32" ]
4206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    } else if (cpu_arch == "x64") {
4216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      yasm_flags += [ "-DARCH_X86_64" ]
4226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      sources += [
4236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        "simd/linear_scale_yuv_to_rgb_mmx_x64.asm",
4246e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        "simd/scale_yuv_to_rgb_sse2_x64.asm",
4256e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      ]
4266e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    }
4276e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
4286e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    if (is_mac || is_ios) {
4296e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      yasm_flags += [
4306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        "-DPREFIX",
4316e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        "-DMACHO",
4326e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      ]
4336e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    } else {
4346e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      if (is_posix) {
4356e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        yasm_flags += [ "-DELF" ]
4366e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        if (cpu_arch == "x64") {
4376e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        # TODO(ajwong): Why isn't this true in mac?
4386e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)          yasm_flags += [ "-DPIC" ]
4396e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)        }
4406e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)      }
4416e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    }
4426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  }
4436e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}
444