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