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