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