Run SPD in a single-threaded mode.
[chromium-blink-merge.git] / media / media.gyp
blob49ce8d1f63bf130dbc02d480e42816b2bc2a8a05
1 # Copyright (c) 2012 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.
6   'variables': {
7     'chromium_code': 1,
8     # Override to dynamically link the cras (ChromeOS audio) library.
9     'use_cras%': 0,
10     # Option e.g. for Linux distributions to link pulseaudio directly
11     # (DT_NEEDED) instead of using dlopen. This helps with automated
12     # detection of ABI mismatches and prevents silent errors.
13     'linux_link_pulseaudio%': 0,
14     'conditions': [
15       ['OS=="android"', {
16         # Android doesn't use ffmpeg.
17         'media_use_ffmpeg%': 0,
18         # Android doesn't use libvpx.
19         'media_use_libvpx%': 0,
20       }, {  # 'OS!="android"'
21         'media_use_ffmpeg%': 1,
22         'media_use_libvpx%': 1,
23       }],
24       # Enable ALSA and Pulse for runtime selection.
25       ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and embedded!=1 and use_cras==0', {
26         'use_alsa%': 1,
27         'use_pulseaudio%': 1,
28       }, {
29         'use_alsa%': 0,
30         'use_pulseaudio%': 0,
31       }],
32     ],
33   },
34   'includes': [
35     'media_cdm.gypi',
36   ],
37   'targets': [
38     {
39       'target_name': 'media',
40       'type': '<(component)',
41       'dependencies': [
42         '../base/base.gyp:base',
43         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
44         '../crypto/crypto.gyp:crypto',
45         '../gpu/gpu.gyp:command_buffer_common',
46         '../skia/skia.gyp:skia',
47         '../third_party/opus/opus.gyp:opus',
48         '../ui/events/events.gyp:events_base',
49         '../ui/gfx/gfx.gyp:gfx',
50         '../ui/gfx/gfx.gyp:gfx_geometry',
51         '../url/url.gyp:url_lib',
52         'shared_memory_support',
53       ],
54       'defines': [
55         'MEDIA_IMPLEMENTATION',
56       ],
57       'include_dirs': [
58         '..',
59       ],
60       'sources': [
61         'audio/agc_audio_stream.h',
62         'audio/alsa/alsa_input.cc',
63         'audio/alsa/alsa_input.h',
64         'audio/alsa/alsa_output.cc',
65         'audio/alsa/alsa_output.h',
66         'audio/alsa/alsa_util.cc',
67         'audio/alsa/alsa_util.h',
68         'audio/alsa/alsa_wrapper.cc',
69         'audio/alsa/alsa_wrapper.h',
70         'audio/alsa/audio_manager_alsa.cc',
71         'audio/alsa/audio_manager_alsa.h',
72         'audio/android/audio_manager_android.cc',
73         'audio/android/audio_manager_android.h',
74         'audio/android/audio_record_input.cc',
75         'audio/android/audio_record_input.h',
76         'audio/android/opensles_input.cc',
77         'audio/android/opensles_input.h',
78         'audio/android/opensles_output.cc',
79         'audio/android/opensles_output.h',
80         'audio/android/opensles_wrapper.cc',
81         'audio/audio_buffers_state.cc',
82         'audio/audio_buffers_state.h',
83         'audio/audio_device_name.cc',
84         'audio/audio_device_name.h',
85         'audio/audio_device_thread.cc',
86         'audio/audio_device_thread.h',
87         'audio/audio_input_controller.cc',
88         'audio/audio_input_controller.h',
89         'audio/audio_input_device.cc',
90         'audio/audio_input_device.h',
91         'audio/audio_input_ipc.cc',
92         'audio/audio_input_ipc.h',
93         'audio/audio_io.h',
94         'audio/audio_manager.cc',
95         'audio/audio_manager.h',
96         'audio/audio_manager_base.cc',
97         'audio/audio_manager_base.h',
98         'audio/audio_output_controller.cc',
99         'audio/audio_output_controller.h',
100         'audio/audio_output_device.cc',
101         'audio/audio_output_device.h',
102         'audio/audio_output_dispatcher.cc',
103         'audio/audio_output_dispatcher.h',
104         'audio/audio_output_dispatcher_impl.cc',
105         'audio/audio_output_dispatcher_impl.h',
106         'audio/audio_output_ipc.cc',
107         'audio/audio_output_ipc.h',
108         'audio/audio_output_proxy.cc',
109         'audio/audio_output_proxy.h',
110         'audio/audio_output_resampler.cc',
111         'audio/audio_output_resampler.h',
112         'audio/audio_power_monitor.cc',
113         'audio/audio_power_monitor.h',
114         'audio/audio_source_diverter.h',
115         'audio/clockless_audio_sink.cc',
116         'audio/clockless_audio_sink.h',
117         'audio/cras/audio_manager_cras.cc',
118         'audio/cras/audio_manager_cras.h',
119         'audio/cras/cras_input.cc',
120         'audio/cras/cras_input.h',
121         'audio/cras/cras_unified.cc',
122         'audio/cras/cras_unified.h',
123         'audio/fake_audio_consumer.cc',
124         'audio/fake_audio_consumer.h',
125         'audio/fake_audio_input_stream.cc',
126         'audio/fake_audio_input_stream.h',
127         'audio/fake_audio_log_factory.h',
128         'audio/fake_audio_log_factory.cc',
129         'audio/fake_audio_manager.cc',
130         'audio/fake_audio_manager.h',
131         'audio/fake_audio_output_stream.cc',
132         'audio/fake_audio_output_stream.h',
133         'audio/linux/audio_manager_linux.cc',
134         'audio/mac/audio_auhal_mac.cc',
135         'audio/mac/audio_auhal_mac.h',
136         'audio/mac/audio_device_listener_mac.cc',
137         'audio/mac/audio_device_listener_mac.h',
138         'audio/mac/audio_input_mac.cc',
139         'audio/mac/audio_input_mac.h',
140         'audio/mac/audio_low_latency_input_mac.cc',
141         'audio/mac/audio_low_latency_input_mac.h',
142         'audio/mac/audio_low_latency_output_mac.cc',
143         'audio/mac/audio_low_latency_output_mac.h',
144         'audio/mac/audio_manager_mac.cc',
145         'audio/mac/audio_manager_mac.h',
146         'audio/null_audio_sink.cc',
147         'audio/null_audio_sink.h',
148         'audio/openbsd/audio_manager_openbsd.cc',
149         'audio/openbsd/audio_manager_openbsd.h',
150         'audio/pulse/audio_manager_pulse.cc',
151         'audio/pulse/audio_manager_pulse.h',
152         'audio/pulse/pulse_input.cc',
153         'audio/pulse/pulse_input.h',
154         'audio/pulse/pulse_output.cc',
155         'audio/pulse/pulse_output.h',
156         'audio/pulse/pulse_util.cc',
157         'audio/pulse/pulse_util.h',
158         'audio/sample_rates.cc',
159         'audio/sample_rates.h',
160         'audio/scoped_task_runner_observer.cc',
161         'audio/scoped_task_runner_observer.h',
162         'audio/simple_sources.cc',
163         'audio/simple_sources.h',
164         'audio/sounds/audio_stream_handler.cc',
165         'audio/sounds/audio_stream_handler.h',
166         'audio/sounds/sounds_manager.cc',
167         'audio/sounds/sounds_manager.h',
168         'audio/sounds/wav_audio_handler.cc',
169         'audio/sounds/wav_audio_handler.h',
170         'audio/virtual_audio_input_stream.cc',
171         'audio/virtual_audio_input_stream.h',
172         'audio/virtual_audio_output_stream.cc',
173         'audio/virtual_audio_output_stream.h',
174         'audio/win/audio_device_listener_win.cc',
175         'audio/win/audio_device_listener_win.h',
176         'audio/win/audio_low_latency_input_win.cc',
177         'audio/win/audio_low_latency_input_win.h',
178         'audio/win/audio_low_latency_output_win.cc',
179         'audio/win/audio_low_latency_output_win.h',
180         'audio/win/audio_manager_win.cc',
181         'audio/win/audio_manager_win.h',
182         'audio/win/avrt_wrapper_win.cc',
183         'audio/win/avrt_wrapper_win.h',
184         'audio/win/core_audio_util_win.cc',
185         'audio/win/core_audio_util_win.h',
186         'audio/win/device_enumeration_win.cc',
187         'audio/win/device_enumeration_win.h',
188         'audio/win/wavein_input_win.cc',
189         'audio/win/wavein_input_win.h',
190         'audio/win/waveout_output_win.cc',
191         'audio/win/waveout_output_win.h',
192         'base/android/demuxer_android.h',
193         'base/android/demuxer_stream_player_params.cc',
194         'base/android/demuxer_stream_player_params.h',
195         'base/android/media_player_manager.h',
196         'base/android/media_resource_getter.cc',
197         'base/android/media_resource_getter.h',
198         'base/audio_buffer.cc',
199         'base/audio_buffer.h',
200         'base/audio_buffer_queue.cc',
201         'base/audio_buffer_queue.h',
202         'base/audio_capturer_source.h',
203         'base/audio_converter.cc',
204         'base/audio_converter.h',
205         'base/audio_decoder.cc',
206         'base/audio_decoder.h',
207         'base/audio_decoder_config.cc',
208         'base/audio_decoder_config.h',
209         'base/audio_fifo.cc',
210         'base/audio_fifo.h',
211         'base/audio_hardware_config.cc',
212         'base/audio_hardware_config.h',
213         'base/audio_hash.cc',
214         'base/audio_hash.h',
215         'base/audio_pull_fifo.cc',
216         'base/audio_pull_fifo.h',
217         'base/audio_renderer.cc',
218         'base/audio_renderer.h',
219         'base/audio_renderer_mixer.cc',
220         'base/audio_renderer_mixer.h',
221         'base/audio_renderer_mixer_input.cc',
222         'base/audio_renderer_mixer_input.h',
223         'base/audio_renderer_sink.h',
224         'base/audio_splicer.cc',
225         'base/audio_splicer.h',
226         'base/audio_timestamp_helper.cc',
227         'base/audio_timestamp_helper.h',
228         'base/audio_video_metadata_extractor.cc',
229         'base/audio_video_metadata_extractor.h',
230         'base/bind_to_current_loop.h',
231         'base/bit_reader.cc',
232         'base/bit_reader.h',
233         'base/bit_reader_core.cc',
234         'base/bit_reader_core.h',
235         'base/bitstream_buffer.h',
236         'base/buffers.h',
237         'base/byte_queue.cc',
238         'base/byte_queue.h',
239         'base/channel_mixer.cc',
240         'base/channel_mixer.h',
241         'base/clock.cc',
242         'base/clock.h',
243         'base/container_names.cc',
244         'base/container_names.h',
245         'base/data_buffer.cc',
246         'base/data_buffer.h',
247         'base/data_source.cc',
248         'base/data_source.h',
249         'base/decoder_buffer.cc',
250         'base/decoder_buffer.h',
251         'base/decoder_buffer_queue.cc',
252         'base/decoder_buffer_queue.h',
253         'base/decrypt_config.cc',
254         'base/decrypt_config.h',
255         'base/decryptor.cc',
256         'base/decryptor.h',
257         'base/demuxer.cc',
258         'base/demuxer.h',
259         'base/demuxer_stream.cc',
260         'base/demuxer_stream.h',
261         'base/djb2.cc',
262         'base/djb2.h',
263         'base/filter_collection.cc',
264         'base/filter_collection.h',
265         'base/keyboard_event_counter.cc',
266         'base/keyboard_event_counter.h',
267         'base/media.cc',
268         'base/media.h',
269         'base/media_file_checker.cc',
270         'base/media_file_checker.h',
271         'base/media_keys.cc',
272         'base/media_keys.h',
273         'base/media_log.cc',
274         'base/media_log.h',
275         'base/media_log_event.h',
276         'base/media_posix.cc',
277         'base/media_switches.cc',
278         'base/media_switches.h',
279         'base/media_win.cc',
280         'base/multi_channel_resampler.cc',
281         'base/multi_channel_resampler.h',
282         'base/pipeline.cc',
283         'base/pipeline.h',
284         'base/pipeline_status.h',
285         'base/ranges.cc',
286         'base/ranges.h',
287         'base/sample_format.cc',
288         'base/sample_format.h',
289         'base/scoped_histogram_timer.h',
290         'base/seekable_buffer.cc',
291         'base/seekable_buffer.h',
292         'base/serial_runner.cc',
293         'base/serial_runner.h',
294         'base/simd/convert_rgb_to_yuv.h',
295         'base/simd/convert_rgb_to_yuv_c.cc',
296         'base/simd/convert_yuv_to_rgb.h',
297         'base/simd/convert_yuv_to_rgb_c.cc',
298         'base/simd/filter_yuv.h',
299         'base/simd/filter_yuv_c.cc',
300         'base/simd/yuv_to_rgb_table.cc',
301         'base/simd/yuv_to_rgb_table.h',
302         'base/sinc_resampler.cc',
303         'base/sinc_resampler.h',
304         'base/stream_parser.cc',
305         'base/stream_parser.h',
306         'base/stream_parser_buffer.cc',
307         'base/stream_parser_buffer.h',
308         'base/text_cue.cc',
309         'base/text_cue.h',
310         'base/text_ranges.cc',
311         'base/text_ranges.h',
312         'base/text_renderer.cc',
313         'base/text_renderer.h',
314         'base/text_track.h',
315         'base/text_track_config.cc',
316         'base/text_track_config.h',
317         'base/user_input_monitor.cc',
318         'base/user_input_monitor.h',
319         'base/user_input_monitor_linux.cc',
320         'base/user_input_monitor_mac.cc',
321         'base/user_input_monitor_win.cc',
322         'base/video_decoder.cc',
323         'base/video_decoder.h',
324         'base/video_decoder_config.cc',
325         'base/video_decoder_config.h',
326         'base/video_frame.cc',
327         'base/video_frame.h',
328         'base/video_frame_pool.cc',
329         'base/video_frame_pool.h',
330         'base/video_renderer.cc',
331         'base/video_renderer.h',
332         'base/video_util.cc',
333         'base/video_util.h',
334         'base/yuv_convert.cc',
335         'base/yuv_convert.h',
336         'cdm/aes_decryptor.cc',
337         'cdm/aes_decryptor.h',
338         'cdm/json_web_key.cc',
339         'cdm/json_web_key.h',
340         'cdm/key_system_names.cc',
341         'cdm/key_system_names.h',
342         'ffmpeg/ffmpeg_common.cc',
343         'ffmpeg/ffmpeg_common.h',
344         'filters/audio_file_reader.cc',
345         'filters/audio_file_reader.h',
346         'filters/audio_renderer_algorithm.cc',
347         'filters/audio_renderer_algorithm.h',
348         'filters/audio_renderer_impl.cc',
349         'filters/audio_renderer_impl.h',
350         'filters/blocking_url_protocol.cc',
351         'filters/blocking_url_protocol.h',
352         'filters/chunk_demuxer.cc',
353         'filters/chunk_demuxer.h',
354         'filters/decoder_selector.cc',
355         'filters/decoder_selector.h',
356         'filters/decoder_stream_traits.h',
357         'filters/decrypting_audio_decoder.cc',
358         'filters/decrypting_audio_decoder.h',
359         'filters/decrypting_demuxer_stream.cc',
360         'filters/decrypting_demuxer_stream.h',
361         'filters/decrypting_video_decoder.cc',
362         'filters/decrypting_video_decoder.h',
363         'filters/ffmpeg_audio_decoder.cc',
364         'filters/ffmpeg_audio_decoder.h',
365         'filters/ffmpeg_demuxer.cc',
366         'filters/ffmpeg_demuxer.h',
367         'filters/ffmpeg_glue.cc',
368         'filters/ffmpeg_glue.h',
369         'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
370         'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
371         'filters/ffmpeg_video_decoder.cc',
372         'filters/ffmpeg_video_decoder.h',
373         'filters/file_data_source.cc',
374         'filters/file_data_source.h',
375         'filters/gpu_video_accelerator_factories.cc',
376         'filters/gpu_video_accelerator_factories.h',
377         'filters/gpu_video_decoder.cc',
378         'filters/gpu_video_decoder.h',
379         'filters/h264_bit_reader.cc',
380         'filters/h264_bit_reader.h',
381         'filters/h264_parser.cc',
382         'filters/h264_parser.h',
383         'filters/h264_to_annex_b_bitstream_converter.cc',
384         'filters/h264_to_annex_b_bitstream_converter.h',
385         'filters/in_memory_url_protocol.cc',
386         'filters/in_memory_url_protocol.h',
387         'filters/opus_audio_decoder.cc',
388         'filters/opus_audio_decoder.h',
389         'filters/skcanvas_video_renderer.cc',
390         'filters/skcanvas_video_renderer.h',
391         'filters/source_buffer_stream.cc',
392         'filters/source_buffer_stream.h',
393         'filters/stream_parser_factory.cc',
394         'filters/stream_parser_factory.h',
395         'filters/video_frame_painter.cc',
396         'filters/video_frame_painter.h',
397         'filters/video_frame_stream.cc',
398         'filters/video_frame_stream.h',
399         'filters/video_renderer_impl.cc',
400         'filters/video_renderer_impl.h',
401         'filters/vpx_video_decoder.cc',
402         'filters/vpx_video_decoder.h',
403         'filters/webvtt_util.h',
404         'filters/wsola_internals.cc',
405         'filters/wsola_internals.h',
406         'midi/midi_manager.cc',
407         'midi/midi_manager.h',
408         'midi/midi_manager_alsa.cc',
409         'midi/midi_manager_alsa.h',
410         'midi/midi_manager_android.cc',
411         'midi/midi_manager_mac.cc',
412         'midi/midi_manager_mac.h',
413         'midi/midi_manager_usb.cc',
414         'midi/midi_manager_usb.h',
415         'midi/midi_manager_win.cc',
416         'midi/midi_manager_win.h',
417         'midi/midi_message_queue.cc',
418         'midi/midi_message_queue.h',
419         'midi/midi_message_util.cc',
420         'midi/midi_message_util.h',
421         'midi/midi_port_info.cc',
422         'midi/midi_port_info.h',
423         'midi/usb_midi_descriptor_parser.cc',
424         'midi/usb_midi_descriptor_parser.h',
425         'midi/usb_midi_device.h',
426         'midi/usb_midi_device_android.cc',
427         'midi/usb_midi_device_android.h',
428         'midi/usb_midi_device_factory_android.cc',
429         'midi/usb_midi_device_factory_android.h',
430         'midi/usb_midi_input_stream.cc',
431         'midi/usb_midi_input_stream.h',
432         'midi/usb_midi_jack.h',
433         'midi/usb_midi_output_stream.cc',
434         'midi/usb_midi_output_stream.h',
435         'video/capture/android/video_capture_device_android.cc',
436         'video/capture/android/video_capture_device_android.h',
437         'video/capture/fake_video_capture_device.cc',
438         'video/capture/fake_video_capture_device.h',
439         'video/capture/file_video_capture_device.cc',
440         'video/capture/file_video_capture_device.h',
441         'video/capture/linux/video_capture_device_linux.cc',
442         'video/capture/linux/video_capture_device_linux.h',
443         'video/capture/mac/avfoundation_glue.h',
444         'video/capture/mac/avfoundation_glue.mm',
445         'video/capture/mac/coremedia_glue.h',
446         'video/capture/mac/coremedia_glue.mm',
447         'video/capture/mac/platform_video_capturing_mac.h',
448         'video/capture/mac/video_capture_device_avfoundation_mac.h',
449         'video/capture/mac/video_capture_device_avfoundation_mac.mm',
450         'video/capture/mac/video_capture_device_mac.h',
451         'video/capture/mac/video_capture_device_mac.mm',
452         'video/capture/mac/video_capture_device_qtkit_mac.h',
453         'video/capture/mac/video_capture_device_qtkit_mac.mm',
454         'video/capture/video_capture.h',
455         'video/capture/video_capture_device.cc',
456         'video/capture/video_capture_device.h',
457         'video/capture/video_capture_proxy.cc',
458         'video/capture/video_capture_proxy.h',
459         'video/capture/video_capture_types.cc',
460         'video/capture/video_capture_types.h',
461         'video/capture/win/capability_list_win.cc',
462         'video/capture/win/capability_list_win.h',
463         'video/capture/win/filter_base_win.cc',
464         'video/capture/win/filter_base_win.h',
465         'video/capture/win/pin_base_win.cc',
466         'video/capture/win/pin_base_win.h',
467         'video/capture/win/sink_filter_observer_win.h',
468         'video/capture/win/sink_filter_win.cc',
469         'video/capture/win/sink_filter_win.h',
470         'video/capture/win/sink_input_pin_win.cc',
471         'video/capture/win/sink_input_pin_win.h',
472         'video/capture/win/video_capture_device_mf_win.cc',
473         'video/capture/win/video_capture_device_mf_win.h',
474         'video/capture/win/video_capture_device_win.cc',
475         'video/capture/win/video_capture_device_win.h',
476         'video/picture.cc',
477         'video/picture.h',
478         'video/video_decode_accelerator.cc',
479         'video/video_decode_accelerator.h',
480         'video/video_encode_accelerator.cc',
481         'video/video_encode_accelerator.h',
482         'formats/common/offset_byte_queue.cc',
483         'formats/common/offset_byte_queue.h',
484         'formats/webm/webm_audio_client.cc',
485         'formats/webm/webm_audio_client.h',
486         'formats/webm/webm_cluster_parser.cc',
487         'formats/webm/webm_cluster_parser.h',
488         'formats/webm/webm_constants.cc',
489         'formats/webm/webm_constants.h',
490         'formats/webm/webm_content_encodings.cc',
491         'formats/webm/webm_content_encodings.h',
492         'formats/webm/webm_content_encodings_client.cc',
493         'formats/webm/webm_content_encodings_client.h',
494         'formats/webm/webm_crypto_helpers.cc',
495         'formats/webm/webm_crypto_helpers.h',
496         'formats/webm/webm_info_parser.cc',
497         'formats/webm/webm_info_parser.h',
498         'formats/webm/webm_parser.cc',
499         'formats/webm/webm_parser.h',
500         'formats/webm/webm_stream_parser.cc',
501         'formats/webm/webm_stream_parser.h',
502         'formats/webm/webm_tracks_parser.cc',
503         'formats/webm/webm_tracks_parser.h',
504         'formats/webm/webm_video_client.cc',
505         'formats/webm/webm_video_client.h',
506         'formats/webm/webm_webvtt_parser.cc',
507         'formats/webm/webm_webvtt_parser.h'
508       ],
509       'direct_dependent_settings': {
510         'include_dirs': [
511           '..',
512         ],
513       },
514       'conditions': [
515         ['arm_neon==1', {
516           'defines': [
517             'USE_NEON'
518           ],
519         }],
520         ['media_use_ffmpeg==1', {
521           'dependencies': [
522             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
523           ],
524         }, {  # media_use_ffmpeg==0
525           # Exclude the sources that depend on ffmpeg.
526           'sources!': [
527             'base/audio_video_metadata_extractor.cc',
528             'base/audio_video_metadata_extractor.h',
529             'base/container_names.cc',
530             'base/container_names.h',
531             'base/media_file_checker.cc',
532             'base/media_file_checker.h',
533             'base/media_posix.cc',
534             'ffmpeg/ffmpeg_common.cc',
535             'ffmpeg/ffmpeg_common.h',
536             'filters/audio_file_reader.cc',
537             'filters/audio_file_reader.h',
538             'filters/blocking_url_protocol.cc',
539             'filters/blocking_url_protocol.h',
540             'filters/ffmpeg_audio_decoder.cc',
541             'filters/ffmpeg_audio_decoder.h',
542             'filters/ffmpeg_demuxer.cc',
543             'filters/ffmpeg_demuxer.h',
544             'filters/ffmpeg_glue.cc',
545             'filters/ffmpeg_glue.h',
546             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
547             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
548             'filters/ffmpeg_video_decoder.cc',
549             'filters/ffmpeg_video_decoder.h',
550           ],
551         }],
552         ['media_use_libvpx==1', {
553           'dependencies': [
554             '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
555           ],
556         }, {  # media_use_libvpx==0
557           'direct_dependent_settings': {
558             'defines': [
559               'MEDIA_DISABLE_LIBVPX',
560             ],
561           },
562           # Exclude the sources that depend on libvpx.
563           'sources!': [
564             'filters/vpx_video_decoder.cc',
565             'filters/vpx_video_decoder.h',
566           ],
567         }],
568         ['OS=="android"', {
569           'dependencies': [
570             'media_android_jni_headers',
571             'player_android',
572             'video_capture_android_jni_headers',
573           ],
574           'sources': [
575             'base/media.cc',
576             'base/media.h',
577             'base/media_stub.cc',
578           ],
579           'sources!': [
580             'filters/opus_audio_decoder.cc',
581             'filters/opus_audio_decoder.h',
582           ],
583           'conditions': [
584             ['android_webview_build==0', {
585               'dependencies': [
586                 'media_java',
587               ],
588             }],
589           ],
590           'defines': [
591             'DISABLE_USER_INPUT_MONITOR',
592           ],
593         }],
594         # A simple WebM encoder for animated avatars on ChromeOS.
595         ['chromeos==1', {
596           'dependencies': [
597             '../third_party/libvpx/libvpx.gyp:libvpx',
598             '../third_party/libyuv/libyuv.gyp:libyuv',
599           ],
600           'sources': [
601             'formats/webm/chromeos/ebml_writer.cc',
602             'formats/webm/chromeos/ebml_writer.h',
603             'formats/webm/chromeos/webm_encoder.cc',
604             'formats/webm/chromeos/webm_encoder.h',
605           ],
606         }],
607         ['use_alsa==1', {
608           'link_settings': {
609             'libraries': [
610               '-lasound',
611             ],
612           },
613           'defines': [
614             'USE_ALSA',
615           ],
616         }, { # use_alsa==0
617           'sources/': [
618             ['exclude', '(^|/)alsa/'],
619             ['exclude', '_alsa\\.(h|cc)$'],
620           ],
621         }],
622         ['OS!="openbsd"', {
623           'sources!': [
624             'audio/openbsd/audio_manager_openbsd.cc',
625             'audio/openbsd/audio_manager_openbsd.h',
626           ],
627         }],
628         ['OS=="linux"', {
629           'variables': {
630             'conditions': [
631               ['sysroot!=""', {
632                 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
633               }, {
634                 'pkg-config': 'pkg-config'
635               }],
636             ],
637           },
638           'conditions': [
639             ['use_x11==1', {
640               'dependencies': [
641                 '../build/linux/system.gyp:x11',
642                 '../build/linux/system.gyp:xdamage',
643                 '../build/linux/system.gyp:xext',
644                 '../build/linux/system.gyp:xfixes',
645                 '../build/linux/system.gyp:xtst',
646               ],
647             }, {  # else: use_x11==0
648               'sources!': [
649                 'base/user_input_monitor_linux.cc',
650               ],
651               'defines': [
652                 'DISABLE_USER_INPUT_MONITOR',
653               ],
654             }],
655             ['use_cras==1', {
656               'cflags': [
657                 '<!@(<(pkg-config) --cflags libcras)',
658               ],
659               'link_settings': {
660                 'libraries': [
661                   '<!@(<(pkg-config) --libs libcras)',
662                 ],
663               },
664               'defines': [
665                 'USE_CRAS',
666               ],
667             }, {  # else: use_cras==0
668               'sources!': [
669                 'audio/cras/audio_manager_cras.cc',
670                 'audio/cras/audio_manager_cras.h',
671                 'audio/cras/cras_input.cc',
672                 'audio/cras/cras_input.h',
673                 'audio/cras/cras_unified.cc',
674                 'audio/cras/cras_unified.h',
675               ],
676             }],
677           ],
678         }],
679         ['OS!="linux"', {
680           'sources!': [
681             'audio/cras/audio_manager_cras.cc',
682             'audio/cras/audio_manager_cras.h',
683             'audio/cras/cras_input.cc',
684             'audio/cras/cras_input.h',
685             'audio/cras/cras_unified.cc',
686             'audio/cras/cras_unified.h',
687           ],
688         }],
689         ['use_pulseaudio==1', {
690           'cflags': [
691             '<!@(pkg-config --cflags libpulse)',
692           ],
693           'defines': [
694             'USE_PULSEAUDIO',
695           ],
696           'conditions': [
697             ['linux_link_pulseaudio==0', {
698               'defines': [
699                 'DLOPEN_PULSEAUDIO',
700               ],
701               'variables': {
702                 'generate_stubs_script': '../tools/generate_stubs/generate_stubs.py',
703                 'extra_header': 'audio/pulse/pulse_stub_header.fragment',
704                 'sig_files': ['audio/pulse/pulse.sigs'],
705                 'outfile_type': 'posix_stubs',
706                 'stubs_filename_root': 'pulse_stubs',
707                 'project_path': 'media/audio/pulse',
708                 'intermediate_dir': '<(INTERMEDIATE_DIR)',
709                 'output_root': '<(SHARED_INTERMEDIATE_DIR)/pulse',
710               },
711               'include_dirs': [
712                 '<(output_root)',
713               ],
714               'actions': [
715                 {
716                   'action_name': 'generate_stubs',
717                   'inputs': [
718                     '<(generate_stubs_script)',
719                     '<(extra_header)',
720                     '<@(sig_files)',
721                   ],
722                   'outputs': [
723                     '<(intermediate_dir)/<(stubs_filename_root).cc',
724                     '<(output_root)/<(project_path)/<(stubs_filename_root).h',
725                   ],
726                   'action': ['python',
727                              '<(generate_stubs_script)',
728                              '-i', '<(intermediate_dir)',
729                              '-o', '<(output_root)/<(project_path)',
730                              '-t', '<(outfile_type)',
731                              '-e', '<(extra_header)',
732                              '-s', '<(stubs_filename_root)',
733                              '-p', '<(project_path)',
734                              '<@(_inputs)',
735                   ],
736                   'process_outputs_as_sources': 1,
737                   'message': 'Generating Pulse stubs for dynamic loading',
738                 },
739               ],
740               'conditions': [
741                 # Linux/Solaris need libdl for dlopen() and friends.
742                 ['OS=="linux" or OS=="solaris"', {
743                   'link_settings': {
744                     'libraries': [
745                       '-ldl',
746                     ],
747                   },
748                 }],
749               ],
750             }, {  # else: linux_link_pulseaudio==0
751               'link_settings': {
752                 'ldflags': [
753                   '<!@(pkg-config --libs-only-L --libs-only-other libpulse)',
754                 ],
755                 'libraries': [
756                   '<!@(pkg-config --libs-only-l libpulse)',
757                 ],
758               },
759             }],
760           ],
761         }, {  # else: use_pulseaudio==0
762           'sources!': [
763             'audio/pulse/audio_manager_pulse.cc',
764             'audio/pulse/audio_manager_pulse.h',
765             'audio/pulse/pulse_input.cc',
766             'audio/pulse/pulse_input.h',
767             'audio/pulse/pulse_output.cc',
768             'audio/pulse/pulse_output.h',
769             'audio/pulse/pulse_util.cc',
770             'audio/pulse/pulse_util.h',
771           ],
772         }],
773         ['OS=="mac"', {
774           'link_settings': {
775             'libraries': [
776               '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
777               '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
778               '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
779               '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
780               '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
781               '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
782               '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
783             ],
784           },
785         }],
786         ['OS=="win"', {
787           'link_settings':  {
788             'libraries': [
789               '-lmf.lib',
790               '-lmfplat.lib',
791               '-lmfreadwrite.lib',
792               '-lmfuuid.lib',
793             ],
794           },
795           # Specify delayload for media.dll.
796           'msvs_settings': {
797             'VCLinkerTool': {
798               'DelayLoadDLLs': [
799                 'mf.dll',
800                 'mfplat.dll',
801                 'mfreadwrite.dll',
802               ],
803             },
804           },
805           # Specify delayload for components that link with media.lib.
806           'all_dependent_settings': {
807             'msvs_settings': {
808               'VCLinkerTool': {
809                 'DelayLoadDLLs': [
810                   'mf.dll',
811                   'mfplat.dll',
812                   'mfreadwrite.dll',
813                 ],
814               },
815             },
816           },
817           # TODO(wolenetz): Fix size_t to int truncations in win64. See
818           # http://crbug.com/171009
819           'conditions': [
820             ['target_arch=="x64"', {
821               'msvs_disabled_warnings': [ 4267, ],
822             }],
823           ],
824         }],
825         ['proprietary_codecs==1', {
826           'sources': [
827             'formats/mp2t/es_parser.h',
828             'formats/mp2t/es_parser_adts.cc',
829             'formats/mp2t/es_parser_adts.h',
830             'formats/mp2t/es_parser_h264.cc',
831             'formats/mp2t/es_parser_h264.h',
832             'formats/mp2t/mp2t_common.h',
833             'formats/mp2t/mp2t_stream_parser.cc',
834             'formats/mp2t/mp2t_stream_parser.h',
835             'formats/mp2t/ts_packet.cc',
836             'formats/mp2t/ts_packet.h',
837             'formats/mp2t/ts_section.h',
838             'formats/mp2t/ts_section_pat.cc',
839             'formats/mp2t/ts_section_pat.h',
840             'formats/mp2t/ts_section_pes.cc',
841             'formats/mp2t/ts_section_pes.h',
842             'formats/mp2t/ts_section_pmt.cc',
843             'formats/mp2t/ts_section_pmt.h',
844             'formats/mp2t/ts_section_psi.cc',
845             'formats/mp2t/ts_section_psi.h',
846             'formats/mp4/aac.cc',
847             'formats/mp4/aac.h',
848             'formats/mp4/avc.cc',
849             'formats/mp4/avc.h',
850             'formats/mp4/box_definitions.cc',
851             'formats/mp4/box_definitions.h',
852             'formats/mp4/box_reader.cc',
853             'formats/mp4/box_reader.h',
854             'formats/mp4/cenc.cc',
855             'formats/mp4/cenc.h',
856             'formats/mp4/es_descriptor.cc',
857             'formats/mp4/es_descriptor.h',
858             'formats/mp4/mp4_stream_parser.cc',
859             'formats/mp4/mp4_stream_parser.h',
860             'formats/mp4/track_run_iterator.cc',
861             'formats/mp4/track_run_iterator.h',
862             'formats/mpeg/adts_constants.cc',
863             'formats/mpeg/adts_constants.h',
864             'formats/mpeg/adts_stream_parser.cc',
865             'formats/mpeg/adts_stream_parser.h',
866             'formats/mpeg/mp3_stream_parser.cc',
867             'formats/mpeg/mp3_stream_parser.h',
868             'formats/mpeg/mpeg_audio_stream_parser_base.cc',
869             'formats/mpeg/mpeg_audio_stream_parser_base.h',
870           ],
871         }],
872         ['toolkit_uses_gtk==1', {
873           'dependencies': [
874             '../build/linux/system.gyp:gtk',
875           ],
876         }],
877         ['target_arch=="ia32" or target_arch=="x64"', {
878           'dependencies': [
879             'media_asm',
880             'media_mmx',
881             'media_sse',
882             'media_sse2',
883           ],
884           'sources': [
885             'base/simd/convert_yuv_to_rgb_x86.cc',
886           ],
887         }],
888         ['OS!="linux" and OS!="win"', {
889           'sources!': [
890             'base/keyboard_event_counter.cc',
891             'base/keyboard_event_counter.h',
892           ],
893         }],
894       ],
895     },
896     {
897       'target_name': 'media_unittests',
898       'type': '<(gtest_target_type)',
899       'dependencies': [
900         'media',
901         'media_test_support',
902         'shared_memory_support',
903         '../base/base.gyp:base',
904         '../base/base.gyp:base_i18n',
905         '../base/base.gyp:test_support_base',
906         '../gpu/gpu.gyp:command_buffer_common',
907         '../skia/skia.gyp:skia',
908         '../testing/gmock.gyp:gmock',
909         '../testing/gtest.gyp:gtest',
910         '../ui/gfx/gfx.gyp:gfx',
911         '../ui/gfx/gfx.gyp:gfx_geometry',
912         '../ui/ui.gyp:ui',
913       ],
914       'sources': [
915         'audio/android/audio_android_unittest.cc',
916         'audio/alsa/alsa_output_unittest.cc',
917         'audio/audio_input_controller_unittest.cc',
918         'audio/audio_input_unittest.cc',
919         'audio/audio_input_volume_unittest.cc',
920         'audio/audio_low_latency_input_output_unittest.cc',
921         'audio/audio_manager_unittest.cc',
922         'audio/audio_output_controller_unittest.cc',
923         'audio/audio_output_device_unittest.cc',
924         'audio/audio_output_proxy_unittest.cc',
925         'audio/audio_parameters_unittest.cc',
926         'audio/audio_power_monitor_unittest.cc',
927         'audio/fake_audio_consumer_unittest.cc',
928         'audio/mac/audio_auhal_mac_unittest.cc',
929         'audio/mac/audio_device_listener_mac_unittest.cc',
930         'audio/mac/audio_low_latency_input_mac_unittest.cc',
931         'audio/simple_sources_unittest.cc',
932         'audio/sounds/audio_stream_handler_unittest.cc',
933         'audio/sounds/sounds_manager_unittest.cc',
934         'audio/sounds/test_data.cc',
935         'audio/sounds/test_data.h',
936         'audio/sounds/wav_audio_handler_unittest.cc',
937         'audio/virtual_audio_input_stream_unittest.cc',
938         'audio/virtual_audio_output_stream_unittest.cc',
939         'audio/win/audio_device_listener_win_unittest.cc',
940         'audio/win/audio_low_latency_input_win_unittest.cc',
941         'audio/win/audio_low_latency_output_win_unittest.cc',
942         'audio/win/audio_output_win_unittest.cc',
943         'audio/win/core_audio_util_win_unittest.cc',
944         'base/android/media_codec_bridge_unittest.cc',
945         'base/android/media_source_player_unittest.cc',
946         'base/audio_buffer_unittest.cc',
947         'base/audio_buffer_queue_unittest.cc',
948         'base/audio_bus_unittest.cc',
949         'base/audio_converter_unittest.cc',
950         'base/audio_fifo_unittest.cc',
951         'base/audio_hardware_config_unittest.cc',
952         'base/audio_hash_unittest.cc',
953         'base/audio_pull_fifo_unittest.cc',
954         'base/audio_renderer_mixer_input_unittest.cc',
955         'base/audio_renderer_mixer_unittest.cc',
956         'base/audio_splicer_unittest.cc',
957         'base/audio_timestamp_helper_unittest.cc',
958         'base/audio_video_metadata_extractor_unittest.cc',
959         'base/bind_to_current_loop_unittest.cc',
960         'base/bit_reader_unittest.cc',
961         'base/callback_holder.h',
962         'base/callback_holder_unittest.cc',
963         'base/channel_mixer_unittest.cc',
964         'base/clock_unittest.cc',
965         'base/container_names_unittest.cc',
966         'base/data_buffer_unittest.cc',
967         'base/decoder_buffer_queue_unittest.cc',
968         'base/decoder_buffer_unittest.cc',
969         'base/djb2_unittest.cc',
970         'base/gmock_callback_support_unittest.cc',
971         'base/media_file_checker_unittest.cc',
972         'base/multi_channel_resampler_unittest.cc',
973         'base/pipeline_unittest.cc',
974         'base/ranges_unittest.cc',
975         'base/run_all_unittests.cc',
976         'base/scoped_histogram_timer_unittest.cc',
977         'base/serial_runner_unittest.cc',
978         'base/seekable_buffer_unittest.cc',
979         'base/sinc_resampler_unittest.cc',
980         'base/stream_parser_unittest.cc',
981         'base/test_data_util.cc',
982         'base/test_data_util.h',
983         'base/text_ranges_unittest.cc',
984         'base/text_renderer_unittest.cc',
985         'base/user_input_monitor_unittest.cc',
986         'base/vector_math_testing.h',
987         'base/vector_math_unittest.cc',
988         'base/video_frame_unittest.cc',
989         'base/video_frame_pool_unittest.cc',
990         'base/video_util_unittest.cc',
991         'base/yuv_convert_unittest.cc',
992         'cdm/aes_decryptor_unittest.cc',
993         'cdm/json_web_key_unittest.cc',
994         'ffmpeg/ffmpeg_common_unittest.cc',
995         'filters/audio_decoder_selector_unittest.cc',
996         'filters/audio_file_reader_unittest.cc',
997         'filters/audio_renderer_algorithm_unittest.cc',
998         'filters/audio_renderer_impl_unittest.cc',
999         'filters/blocking_url_protocol_unittest.cc',
1000         'filters/chunk_demuxer_unittest.cc',
1001         'filters/decrypting_audio_decoder_unittest.cc',
1002         'filters/decrypting_demuxer_stream_unittest.cc',
1003         'filters/decrypting_video_decoder_unittest.cc',
1004         'filters/fake_demuxer_stream.cc',
1005         'filters/fake_demuxer_stream.h',
1006         'filters/fake_demuxer_stream_unittest.cc',
1007         'filters/fake_video_decoder.cc',
1008         'filters/fake_video_decoder.h',
1009         'filters/fake_video_decoder_unittest.cc',
1010         'filters/ffmpeg_audio_decoder_unittest.cc',
1011         'filters/ffmpeg_demuxer_unittest.cc',
1012         'filters/ffmpeg_glue_unittest.cc',
1013         'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
1014         'filters/ffmpeg_video_decoder_unittest.cc',
1015         'filters/file_data_source_unittest.cc',
1016         'filters/h264_bit_reader_unittest.cc',
1017         'filters/h264_parser_unittest.cc',
1018         'filters/h264_to_annex_b_bitstream_converter_unittest.cc',
1019         'filters/pipeline_integration_test.cc',
1020         'filters/pipeline_integration_test_base.cc',
1021         'filters/skcanvas_video_renderer_unittest.cc',
1022         'filters/source_buffer_stream_unittest.cc',
1023         'filters/video_decoder_selector_unittest.cc',
1024         'filters/video_frame_painter_unittest.cc',
1025         'filters/video_frame_stream_unittest.cc',
1026         'filters/video_renderer_impl_unittest.cc',
1027         'midi/midi_manager_usb_unittest.cc',
1028         'midi/midi_message_queue_unittest.cc',
1029         'midi/midi_message_util_unittest.cc',
1030         'midi/usb_midi_descriptor_parser_unittest.cc',
1031         'midi/usb_midi_input_stream_unittest.cc',
1032         'midi/usb_midi_output_stream_unittest.cc',
1033         'video/capture/video_capture_device_unittest.cc',
1034         'formats/common/offset_byte_queue_unittest.cc',
1035         'formats/webm/cluster_builder.cc',
1036         'formats/webm/cluster_builder.h',
1037         'formats/webm/tracks_builder.cc',
1038         'formats/webm/tracks_builder.h',
1039         'formats/webm/webm_cluster_parser_unittest.cc',
1040         'formats/webm/webm_content_encodings_client_unittest.cc',
1041         'formats/webm/webm_parser_unittest.cc',
1042         'formats/webm/webm_tracks_parser_unittest.cc',
1043         'formats/webm/webm_webvtt_parser_unittest.cc',
1044       ],
1045       'conditions': [
1046         ['arm_neon==1', {
1047           'defines': [
1048             'USE_NEON'
1049           ],
1050         }],
1051         ['media_use_ffmpeg==1', {
1052           'dependencies': [
1053             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1054           ],
1055         }, {  # media_use_ffmpeg== 0
1056           'sources!': [
1057             'base/audio_video_metadata_extractor_unittest.cc',
1058             'base/media_file_checker_unittest.cc',
1059           ],
1060         }],
1061         ['use_alsa==1', {
1062           'defines': [
1063             'USE_ALSA',
1064           ],
1065         }],
1066         ['use_pulseaudio==1', {
1067           'defines': [
1068             'USE_PULSEAUDIO',
1069           ],
1070         }],
1071         ['os_posix==1 and OS!="mac"', {
1072           'conditions': [
1073             ['linux_use_tcmalloc==1', {
1074               'dependencies': [
1075                 '../base/allocator/allocator.gyp:allocator',
1076               ],
1077             }],
1078           ],
1079         }],
1080         ['OS=="android"', {
1081           'sources!': [
1082             'audio/audio_input_volume_unittest.cc',
1083             'base/container_names_unittest.cc',
1084             'ffmpeg/ffmpeg_common_unittest.cc',
1085             'filters/audio_file_reader_unittest.cc',
1086             'filters/blocking_url_protocol_unittest.cc',
1087             'filters/ffmpeg_audio_decoder_unittest.cc',
1088             'filters/ffmpeg_demuxer_unittest.cc',
1089             'filters/ffmpeg_glue_unittest.cc',
1090             'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
1091             'filters/ffmpeg_video_decoder_unittest.cc',
1092             'filters/pipeline_integration_test.cc',
1093             'filters/pipeline_integration_test_base.cc',
1094           ],
1095           'conditions': [
1096             ['gtest_target_type=="shared_library"', {
1097               'dependencies': [
1098                 '../testing/android/native_test.gyp:native_test_native_code',
1099                 'player_android',
1100               ],
1101             }],
1102           ],
1103         }],
1104         ['OS=="linux"', {
1105           'conditions': [
1106             ['use_cras==1', {
1107               'sources': [
1108                 'audio/cras/cras_input_unittest.cc',
1109                 'audio/cras/cras_unified_unittest.cc',
1110               ],
1111               'defines': [
1112                 'USE_CRAS',
1113               ],
1114             }],
1115           ],
1116         }],
1117         ['use_alsa==0', {
1118           'sources!': [
1119             'audio/alsa/alsa_output_unittest.cc',
1120             'audio/audio_low_latency_input_output_unittest.cc',
1121           ],
1122         }],
1123         ['target_arch=="ia32" or target_arch=="x64"', {
1124           'sources': [
1125             'base/simd/convert_rgb_to_yuv_unittest.cc',
1126           ],
1127         }],
1128         ['proprietary_codecs==1', {
1129           'sources': [
1130             'formats/common/stream_parser_test_base.cc',
1131             'formats/common/stream_parser_test_base.h',
1132             'formats/mp2t/mp2t_stream_parser_unittest.cc',
1133             'formats/mp4/aac_unittest.cc',
1134             'formats/mp4/avc_unittest.cc',
1135             'formats/mp4/box_reader_unittest.cc',
1136             'formats/mp4/es_descriptor_unittest.cc',
1137             'formats/mp4/mp4_stream_parser_unittest.cc',
1138             'formats/mp4/track_run_iterator_unittest.cc',
1139             'formats/mpeg/adts_stream_parser_unittest.cc',
1140             'formats/mpeg/mp3_stream_parser_unittest.cc',
1141           ],
1142         }],
1143         # TODO(wolenetz): Fix size_t to int truncations in win64. See
1144         # http://crbug.com/171009
1145         ['OS=="win" and target_arch=="x64"', {
1146           'msvs_disabled_warnings': [ 4267, ],
1147         }],
1148       ],
1149     },
1150     {
1151       'target_name': 'media_perftests',
1152       'type': '<(gtest_target_type)',
1153       'dependencies': [
1154         'media',
1155         'media_test_support',
1156         'shared_memory_support',
1157         '../base/base.gyp:test_support_base',
1158         '../testing/gmock.gyp:gmock',
1159         '../testing/gtest.gyp:gtest',
1160         '../testing/perf/perf_test.gyp:perf_test',
1161         '../ui/gfx/gfx.gyp:gfx',
1162         '../ui/gfx/gfx.gyp:gfx_geometry',
1163         '../ui/gl/gl.gyp:gl',
1164         '../ui/ui.gyp:ui',
1165       ],
1166       'sources': [
1167         'base/audio_bus_perftest.cc',
1168         'base/audio_converter_perftest.cc',
1169         'base/demuxer_perftest.cc',
1170         'base/run_all_perftests.cc',
1171         'base/sinc_resampler_perftest.cc',
1172         'base/test_data_util.cc',
1173         'base/vector_math_perftest.cc',
1174         'filters/pipeline_integration_perftest.cc',
1175         'filters/pipeline_integration_test_base.cc',
1176       ],
1177       'conditions': [
1178         ['arm_neon==1', {
1179           'defines': [
1180             'USE_NEON'
1181           ],
1182         }],
1183         ['OS=="android"', {
1184           'conditions': [
1185             ['gtest_target_type=="shared_library"', {
1186               'dependencies': [
1187                 '../testing/android/native_test.gyp:native_test_native_code',
1188               ],
1189             }],
1190           ],
1191         }],
1192         ['media_use_ffmpeg==1', {
1193           'dependencies': [
1194             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1195           ],
1196         }, {  # media_use_ffmpeg==0
1197           'sources!': [
1198             'base/demuxer_perftest.cc',
1199             'filters/pipeline_integration_perftest.cc',
1200             'filters/pipeline_integration_test_base.cc',
1201           ],
1202         }],
1203       ],
1204     },
1205     {
1206       'target_name': 'media_test_support',
1207       'type': 'static_library',
1208       'dependencies': [
1209         'media',
1210         'shared_memory_support',
1211         '../base/base.gyp:base',
1212         '../skia/skia.gyp:skia',
1213         '../testing/gmock.gyp:gmock',
1214         '../testing/gtest.gyp:gtest',
1215       ],
1216       'sources': [
1217         'audio/mock_audio_manager.cc',
1218         'audio/mock_audio_manager.h',
1219         'audio/mock_audio_source_callback.cc',
1220         'audio/mock_audio_source_callback.h',
1221         'audio/test_audio_input_controller_factory.cc',
1222         'audio/test_audio_input_controller_factory.h',
1223         'base/fake_audio_render_callback.cc',
1224         'base/fake_audio_render_callback.h',
1225         'base/fake_audio_renderer_sink.cc',
1226         'base/fake_audio_renderer_sink.h',
1227         'base/fake_text_track_stream.cc',
1228         'base/fake_text_track_stream.h',
1229         'base/gmock_callback_support.h',
1230         'base/mock_audio_renderer_sink.cc',
1231         'base/mock_audio_renderer_sink.h',
1232         'base/mock_data_source_host.cc',
1233         'base/mock_data_source_host.h',
1234         'base/mock_demuxer_host.cc',
1235         'base/mock_demuxer_host.h',
1236         'base/mock_filters.cc',
1237         'base/mock_filters.h',
1238         'base/test_helpers.cc',
1239         'base/test_helpers.h',
1240         'filters/mock_gpu_video_accelerator_factories.cc',
1241         'filters/mock_gpu_video_accelerator_factories.h',
1242         'video/capture/mock_video_capture_event_handler.cc',
1243         'video/capture/mock_video_capture_event_handler.h',
1244         'video/mock_video_decode_accelerator.cc',
1245         'video/mock_video_decode_accelerator.h',
1246       ],
1247     },
1248     {
1249       # Minimal target for NaCl and other renderer side media clients which
1250       # only need to send audio data across the shared memory to the browser
1251       # process.
1252       'target_name': 'shared_memory_support',
1253       'type': '<(component)',
1254       'dependencies': [
1255         '../base/base.gyp:base',
1256       ],
1257       'defines': [
1258         'MEDIA_IMPLEMENTATION',
1259       ],
1260       'include_dirs': [
1261         '..',
1262       ],
1263       'includes': [
1264         'shared_memory_support.gypi',
1265       ],
1266       'sources': [
1267         '<@(shared_memory_support_sources)',
1268       ],
1269       'conditions': [
1270         ['arm_neon==1', {
1271           'defines': [
1272             'USE_NEON'
1273           ],
1274         }],
1275         ['target_arch=="ia32" or target_arch=="x64"', {
1276           'dependencies': [
1277             'shared_memory_support_sse'
1278           ],
1279         }],
1280       ],
1281     },
1282   ],
1283   'conditions': [
1284     ['target_arch!="arm"', {
1285       'targets': [
1286        {
1287           'target_name': 'media_asm',
1288           'type': 'static_library',
1289           'sources': [
1290             'base/simd/convert_rgb_to_yuv_ssse3.asm',
1291             'base/simd/convert_yuv_to_rgb_mmx.asm',
1292             'base/simd/convert_yuv_to_rgb_sse.asm',
1293             'base/simd/convert_yuva_to_argb_mmx.asm',
1294             'base/simd/empty_register_state_mmx.asm',
1295             'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
1296             'base/simd/linear_scale_yuv_to_rgb_sse.asm',
1297             'base/simd/scale_yuv_to_rgb_mmx.asm',
1298             'base/simd/scale_yuv_to_rgb_sse.asm',
1299           ],
1300           'conditions': [
1301             ['component=="shared_library"', {
1302               'variables': {
1303                 'yasm_flags': ['-DEXPORT_SYMBOLS'],
1304               },
1305             }],
1306             ['target_arch=="x64"', {
1307               # Source files optimized for X64 systems.
1308               'sources': [
1309                 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
1310                 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
1311               ],
1312               'variables': {
1313                 'yasm_flags': ['-DARCH_X86_64'],
1314               },
1315             }],
1316             ['OS=="mac"', {
1317               'variables': {
1318                 'yasm_flags': [
1319                   '-DPREFIX',
1320                   '-DMACHO',
1321                 ],
1322               },
1323               'sources': [
1324                 # XCode doesn't want to link a pure assembly target and will
1325                 # fail to link when it creates an empty file list.  So add a
1326                 # dummy file keep the linker happy.  See http://crbug.com/157073
1327                 'base/simd/xcode_hack.c',
1328               ],
1329             }],
1330             ['os_posix==1 and OS!="mac"', {
1331               'variables': {
1332                 'conditions': [
1333                   ['target_arch=="ia32"', {
1334                     'yasm_flags': [
1335                       '-DARCH_X86_32',
1336                       '-DELF',
1337                     ],
1338                   }, { # target_arch=="x64"
1339                     'yasm_flags': [
1340                       '-DARCH_X86_64',
1341                       '-DELF',
1342                       '-DPIC',
1343                     ],
1344                   }],
1345                 ],
1346               },
1347             }],
1348           ],
1349           'variables': {
1350             'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
1351             'yasm_flags': [
1352               '-DCHROMIUM',
1353               # In addition to the same path as source asm, let yasm %include
1354               # search path be relative to src/ per Chromium policy.
1355               '-I..',
1356             ],
1357             'yasm_includes': [
1358               '../third_party/x86inc/x86inc.asm',
1359               'base/simd/convert_rgb_to_yuv_ssse3.inc',
1360               'base/simd/convert_yuv_to_rgb_mmx.inc',
1361               'base/simd/convert_yuva_to_argb_mmx.inc',
1362               'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
1363               'base/simd/media_export.asm',
1364               'base/simd/scale_yuv_to_rgb_mmx.inc',
1365             ],
1366           },
1367           'msvs_2010_disable_uldi_when_referenced': 1,
1368           'includes': [
1369             '../third_party/yasm/yasm_compile.gypi',
1370           ],
1371         },
1372         {
1373           'target_name': 'media_mmx',
1374           'type': 'static_library',
1375           'cflags': [
1376             '-mmmx',
1377           ],
1378           'defines': [
1379             'MEDIA_IMPLEMENTATION',
1380           ],
1381           'include_dirs': [
1382             '..',
1383           ],
1384           'sources': [
1385             'base/simd/filter_yuv_mmx.cc',
1386           ],
1387         },
1388         {
1389           'target_name': 'media_sse',
1390           'type': 'static_library',
1391           'cflags': [
1392             '-msse',
1393           ],
1394           'defines': [
1395             'MEDIA_IMPLEMENTATION',
1396           ],
1397           'include_dirs': [
1398             '..',
1399           ],
1400           'sources': [
1401             'base/simd/sinc_resampler_sse.cc',
1402           ],
1403         },
1404         {
1405           'target_name': 'media_sse2',
1406           'type': 'static_library',
1407           'cflags': [
1408             '-msse2',
1409           ],
1410           'defines': [
1411             'MEDIA_IMPLEMENTATION',
1412           ],
1413           'include_dirs': [
1414             '..',
1415           ],
1416           'sources': [
1417             'base/simd/convert_rgb_to_yuv_sse2.cc',
1418             'base/simd/convert_rgb_to_yuv_ssse3.cc',
1419             'base/simd/filter_yuv_sse2.cc',
1420           ],
1421         },
1422         {
1423           'target_name': 'shared_memory_support_sse',
1424           'type': 'static_library',
1425           'cflags': [
1426             '-msse',
1427           ],
1428           'defines': [
1429             'MEDIA_IMPLEMENTATION',
1430           ],
1431           'include_dirs': [
1432             '..',
1433           ],
1434           'sources': [
1435             'base/simd/vector_math_sse.cc',
1436           ],
1437         },
1438       ], # targets
1439     }],
1440     ['use_x11==1', {
1441       'targets': [
1442         {
1443           'target_name': 'player_x11',
1444           'type': 'executable',
1445           'dependencies': [
1446             'media',
1447             '../base/base.gyp:base',
1448             '../ui/gl/gl.gyp:gl',
1449             '../ui/gfx/gfx.gyp:gfx',
1450             '../ui/gfx/gfx.gyp:gfx_geometry',
1451             '../build/linux/system.gyp:x11',
1452             '../build/linux/system.gyp:xext',
1453             '../build/linux/system.gyp:xrender',
1454           ],
1455           'conditions': [
1456             # Linux/Solaris need libdl for dlopen() and friends.
1457             ['OS=="linux" or OS=="solaris"', {
1458               'link_settings': {
1459                 'libraries': [
1460                   '-ldl',
1461                 ],
1462               },
1463             }],
1464           ],
1465           'sources': [
1466             'tools/player_x11/data_source_logger.cc',
1467             'tools/player_x11/data_source_logger.h',
1468             'tools/player_x11/gl_video_renderer.cc',
1469             'tools/player_x11/gl_video_renderer.h',
1470             'tools/player_x11/player_x11.cc',
1471             'tools/player_x11/x11_video_renderer.cc',
1472             'tools/player_x11/x11_video_renderer.h',
1473           ],
1474         },
1475       ],
1476     }],
1477     # Special target to wrap a gtest_target_type==shared_library
1478     # media_unittests into an android apk for execution.
1479     ['OS=="android" and gtest_target_type=="shared_library"', {
1480       'targets': [
1481         {
1482           'target_name': 'media_unittests_apk',
1483           'type': 'none',
1484           'dependencies': [
1485             'media_java',
1486             'media_unittests',
1487           ],
1488           'variables': {
1489             'test_suite_name': 'media_unittests',
1490             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_unittests<(SHARED_LIB_SUFFIX)',
1491           },
1492           'includes': ['../build/apk_test.gypi'],
1493         },
1494         {
1495           'target_name': 'media_perftests_apk',
1496           'type': 'none',
1497           'dependencies': [
1498             'media_java',
1499             'media_perftests',
1500           ],
1501           'variables': {
1502             'test_suite_name': 'media_perftests',
1503             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_perftests<(SHARED_LIB_SUFFIX)',
1504           },
1505           'includes': ['../build/apk_test.gypi'],
1506         },
1507       ],
1508     }],
1509     ['OS=="android"', {
1510       'targets': [
1511         {
1512           'target_name': 'media_android_jni_headers',
1513           'type': 'none',
1514           'sources': [
1515             'base/android/java/src/org/chromium/media/AudioManagerAndroid.java',
1516             'base/android/java/src/org/chromium/media/AudioRecordInput.java',
1517             'base/android/java/src/org/chromium/media/MediaCodecBridge.java',
1518             'base/android/java/src/org/chromium/media/MediaDrmBridge.java',
1519             'base/android/java/src/org/chromium/media/MediaPlayerBridge.java',
1520             'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
1521             'base/android/java/src/org/chromium/media/UsbMidiDeviceAndroid.java',
1522             'base/android/java/src/org/chromium/media/UsbMidiDeviceFactoryAndroid.java',
1523             'base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java',
1524           ],
1525           'variables': {
1526             'jni_gen_package': 'media',
1527             'jni_generator_ptr_type': 'long',
1528           },
1529           'includes': ['../build/jni_generator.gypi'],
1530         },
1531         {
1532           'target_name': 'video_capture_android_jni_headers',
1533           'type': 'none',
1534           'sources': [
1535             'base/android/java/src/org/chromium/media/VideoCapture.java',
1536           ],
1537           'variables': {
1538             'jni_gen_package': 'media',
1539             'jni_generator_ptr_type': 'long',
1540           },
1541           'includes': ['../build/jni_generator.gypi'],
1542         },
1543         {
1544           'target_name': 'player_android',
1545           'type': 'static_library',
1546           'sources': [
1547             'base/android/audio_decoder_job.cc',
1548             'base/android/audio_decoder_job.h',
1549             'base/android/media_codec_bridge.cc',
1550             'base/android/media_codec_bridge.h',
1551             'base/android/media_decoder_job.cc',
1552             'base/android/media_decoder_job.h',
1553             'base/android/media_drm_bridge.cc',
1554             'base/android/media_drm_bridge.h',
1555             'base/android/media_jni_registrar.cc',
1556             'base/android/media_jni_registrar.h',
1557             'base/android/media_player_android.cc',
1558             'base/android/media_player_android.h',
1559             'base/android/media_player_bridge.cc',
1560             'base/android/media_player_bridge.h',
1561             'base/android/media_player_listener.cc',
1562             'base/android/media_player_listener.h',
1563             'base/android/media_source_player.cc',
1564             'base/android/media_source_player.h',
1565             'base/android/video_decoder_job.cc',
1566             'base/android/video_decoder_job.h',
1567             'base/android/webaudio_media_codec_bridge.cc',
1568             'base/android/webaudio_media_codec_bridge.h',
1569             'base/android/webaudio_media_codec_info.h',
1570           ],
1571           'dependencies': [
1572             '../base/base.gyp:base',
1573             '../ui/gl/gl.gyp:gl',
1574             '../url/url.gyp:url_lib',
1575             'media_android_jni_headers',
1576           ],
1577           'defines': [
1578             'MEDIA_IMPLEMENTATION',
1579           ],
1580         },
1581         {
1582           'target_name': 'media_java',
1583           'type': 'none',
1584           'dependencies': [
1585             '../base/base.gyp:base',
1586             'media_android_imageformat_list',
1587           ],
1588           'export_dependent_settings': [
1589             '../base/base.gyp:base',
1590           ],
1591           'variables': {
1592             'java_in_dir': 'base/android/java',
1593           },
1594           'includes': ['../build/java.gypi'],
1595         },
1596         {
1597           'target_name': 'media_android_imageformat_list',
1598           'type': 'none',
1599           'sources': [
1600             'base/android/java/src/org/chromium/media/ImageFormat.template',
1601           ],
1602           'variables': {
1603             'package_name': 'org/chromium/media',
1604             'template_deps': ['video/capture/android/imageformat_list.h'],
1605           },
1606           'includes': [ '../build/android/java_cpp_template.gypi' ],
1607         },
1608       ],
1609     }],
1610     ['media_use_ffmpeg==1', {
1611       'targets': [
1612         {
1613           'target_name': 'ffmpeg_unittests',
1614           'type': 'executable',
1615           'dependencies': [
1616             '../base/base.gyp:base',
1617             '../base/base.gyp:base_i18n',
1618             '../base/base.gyp:test_support_base',
1619             '../base/base.gyp:test_support_perf',
1620             '../testing/gtest.gyp:gtest',
1621             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1622             'media',
1623             'media_test_support',
1624           ],
1625           'sources': [
1626             'ffmpeg/ffmpeg_unittest.cc',
1627           ],
1628           'conditions': [
1629             ['toolkit_uses_gtk==1', {
1630               'dependencies': [
1631                 # Needed for the following #include chain:
1632                 #   base/run_all_unittests.cc
1633                 #   ../base/test_suite.h
1634                 #   gtk/gtk.h
1635                 '../build/linux/system.gyp:gtk',
1636               ],
1637               'conditions': [
1638                 ['linux_use_tcmalloc==1', {
1639                   'dependencies': [
1640                     '../base/allocator/allocator.gyp:allocator',
1641                   ],
1642                 }],
1643               ],
1644             }],
1645           ],
1646         },
1647         {
1648           'target_name': 'ffmpeg_regression_tests',
1649           'type': 'executable',
1650           'dependencies': [
1651             '../base/base.gyp:test_support_base',
1652             '../testing/gmock.gyp:gmock',
1653             '../testing/gtest.gyp:gtest',
1654             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1655             'media',
1656             'media_test_support',
1657           ],
1658           'sources': [
1659             'base/run_all_unittests.cc',
1660             'base/test_data_util.cc',
1661             'ffmpeg/ffmpeg_regression_tests.cc',
1662             'filters/pipeline_integration_test_base.cc',
1663           ],
1664           'conditions': [
1665             ['os_posix==1 and OS!="mac"', {
1666               'conditions': [
1667                 ['linux_use_tcmalloc==1', {
1668                   'dependencies': [
1669                     '../base/allocator/allocator.gyp:allocator',
1670                   ],
1671                 }],
1672               ],
1673             }],
1674           ],
1675         },
1676       ],
1677     }],
1678   ],