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