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