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