Fix style for cast_unittest: Add newlines at EOF
[chromium-blink-merge.git] / media / media.gyp
blob686163c57be9fcb21d962f97c773d6e3b2bcf268
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/gmock_callback_support.h',
1085         'base/mock_audio_renderer_sink.cc',
1086         'base/mock_audio_renderer_sink.h',
1087         'base/mock_data_source_host.cc',
1088         'base/mock_data_source_host.h',
1089         'base/mock_demuxer_host.cc',
1090         'base/mock_demuxer_host.h',
1091         'base/mock_filters.cc',
1092         'base/mock_filters.h',
1093         'base/test_helpers.cc',
1094         'base/test_helpers.h',
1095         'filters/mock_gpu_video_accelerator_factories.cc',
1096         'filters/mock_gpu_video_accelerator_factories.h',
1097         'video/mock_video_decode_accelerator.cc',
1098         'video/mock_video_decode_accelerator.h',
1099       ],
1100     },
1101     {
1102       # Minimal target for NaCl and other renderer side media clients which
1103       # only need to send audio data across the shared memory to the browser
1104       # process.
1105       'target_name': 'shared_memory_support',
1106       'type': '<(component)',
1107       'dependencies': [
1108         '../base/base.gyp:base',
1109       ],
1110       'defines': [
1111         'MEDIA_IMPLEMENTATION',
1112       ],
1113       'include_dirs': [
1114         '..',
1115       ],
1116       'includes': [
1117         'shared_memory_support.gypi',
1118       ],
1119       'sources': [
1120         '<@(shared_memory_support_sources)',
1121       ],
1122       'conditions': [
1123         ['arm_neon==1', {
1124           'defines': [
1125             'USE_NEON'
1126           ],
1127         }],
1128         ['target_arch=="ia32" or target_arch=="x64"', {
1129           'dependencies': [
1130             'shared_memory_support_sse'
1131           ],
1132         }],
1133       ],
1134     },
1135     {
1136       'target_name': 'demuxer_bench',
1137       'type': 'executable',
1138       'dependencies': [
1139         'media',
1140         '../base/base.gyp:base',
1141       ],
1142       'sources': [
1143         'tools/demuxer_bench/demuxer_bench.cc',
1144       ],
1145       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1146       'msvs_disabled_warnings': [ 4267, ],
1147     },
1148   ],
1149   'conditions': [
1150     ['target_arch!="arm"', {
1151       'targets': [
1152        {
1153           'target_name': 'media_asm',
1154           'type': 'static_library',
1155           'sources': [
1156             'base/simd/convert_rgb_to_yuv_ssse3.asm',
1157             'base/simd/convert_yuv_to_rgb_mmx.asm',
1158             'base/simd/convert_yuv_to_rgb_sse.asm',
1159             'base/simd/convert_yuva_to_argb_mmx.asm',
1160             'base/simd/empty_register_state_mmx.asm',
1161             'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
1162             'base/simd/linear_scale_yuv_to_rgb_sse.asm',
1163             'base/simd/scale_yuv_to_rgb_mmx.asm',
1164             'base/simd/scale_yuv_to_rgb_sse.asm',
1165           ],
1166           'conditions': [
1167             ['component=="shared_library"', {
1168               'variables': {
1169                 'yasm_flags': ['-DEXPORT_SYMBOLS'],
1170               },
1171             }],
1172             ['target_arch=="x64"', {
1173               # Source files optimized for X64 systems.
1174               'sources': [
1175                 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
1176                 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
1177               ],
1178               'variables': {
1179                 'yasm_flags': ['-DARCH_X86_64'],
1180               },
1181             }],
1182             ['OS=="mac"', {
1183               'variables': {
1184                 'yasm_flags': [
1185                   '-DPREFIX',
1186                   '-DMACHO',
1187                 ],
1188               },
1189               'sources': [
1190                 # XCode doesn't want to link a pure assembly target and will
1191                 # fail to link when it creates an empty file list.  So add a
1192                 # dummy file keep the linker happy.  See http://crbug.com/157073
1193                 'base/simd/xcode_hack.c',
1194               ],
1195             }],
1196             ['os_posix==1 and OS!="mac"', {
1197               'variables': {
1198                 'conditions': [
1199                   ['target_arch=="ia32"', {
1200                     'yasm_flags': [
1201                       '-DX86_32',
1202                       '-DELF',
1203                     ],
1204                   }, {
1205                     'yasm_flags': [
1206                       '-DELF',
1207                       '-DPIC',
1208                     ],
1209                   }],
1210                 ],
1211               },
1212             }],
1213           ],
1214           'variables': {
1215             'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
1216             'yasm_flags': [
1217               '-DCHROMIUM',
1218               # In addition to the same path as source asm, let yasm %include
1219               # search path be relative to src/ per Chromium policy.
1220               '-I..',
1221             ],
1222             'yasm_includes': [
1223               '../third_party/x86inc/x86inc.asm',
1224               'base/simd/convert_rgb_to_yuv_ssse3.inc',
1225               'base/simd/convert_yuv_to_rgb_mmx.inc',
1226               'base/simd/convert_yuva_to_argb_mmx.inc',
1227               'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
1228               'base/simd/media_export.asm',
1229               'base/simd/scale_yuv_to_rgb_mmx.inc',
1230             ],
1231           },
1232           'msvs_2010_disable_uldi_when_referenced': 1,
1233           'includes': [
1234             '../third_party/yasm/yasm_compile.gypi',
1235           ],
1236         },
1237         {
1238           'target_name': 'media_mmx',
1239           'type': 'static_library',
1240           'cflags': [
1241             '-mmmx',
1242           ],
1243           'defines': [
1244             'MEDIA_IMPLEMENTATION',
1245           ],
1246           'include_dirs': [
1247             '..',
1248           ],
1249           'sources': [
1250             'base/simd/filter_yuv_mmx.cc',
1251           ],
1252         },
1253         {
1254           'target_name': 'media_sse',
1255           'type': 'static_library',
1256           'cflags': [
1257             '-msse',
1258           ],
1259           'defines': [
1260             'MEDIA_IMPLEMENTATION',
1261           ],
1262           'include_dirs': [
1263             '..',
1264           ],
1265           'sources': [
1266             'base/simd/sinc_resampler_sse.cc',
1267           ],
1268         },
1269         {
1270           'target_name': 'media_sse2',
1271           'type': 'static_library',
1272           'cflags': [
1273             '-msse2',
1274           ],
1275           'defines': [
1276             'MEDIA_IMPLEMENTATION',
1277           ],
1278           'include_dirs': [
1279             '..',
1280           ],
1281           'sources': [
1282             'base/simd/convert_rgb_to_yuv_sse2.cc',
1283             'base/simd/convert_rgb_to_yuv_ssse3.cc',
1284             'base/simd/filter_yuv_sse2.cc',
1285           ],
1286         },
1287         {
1288           'target_name': 'shared_memory_support_sse',
1289           'type': 'static_library',
1290           'cflags': [
1291             '-msse',
1292           ],
1293           'defines': [
1294             'MEDIA_IMPLEMENTATION',
1295           ],
1296           'include_dirs': [
1297             '..',
1298           ],
1299           'sources': [
1300             'base/simd/vector_math_sse.cc',
1301           ],
1302         },
1303       ], # targets
1304     }],
1305     ['use_x11==1', {
1306       'targets': [
1307         {
1308           'target_name': 'player_x11',
1309           'type': 'executable',
1310           'dependencies': [
1311             'media',
1312             '../base/base.gyp:base',
1313             '../ui/gl/gl.gyp:gl',
1314             '../ui/gfx/gfx.gyp:gfx',
1315             '../ui/ui.gyp:ui',
1316           ],
1317           'link_settings': {
1318             'libraries': [
1319               '-lX11',
1320               '-lXrender',
1321               '-lXext',
1322             ],
1323           },
1324           'conditions': [
1325             # Linux/Solaris need libdl for dlopen() and friends.
1326             ['OS=="linux" or OS=="solaris"', {
1327               'link_settings': {
1328                 'libraries': [
1329                   '-ldl',
1330                 ],
1331               },
1332             }],
1333           ],
1334           'sources': [
1335             'tools/player_x11/data_source_logger.cc',
1336             'tools/player_x11/data_source_logger.h',
1337             'tools/player_x11/gl_video_renderer.cc',
1338             'tools/player_x11/gl_video_renderer.h',
1339             'tools/player_x11/player_x11.cc',
1340             'tools/player_x11/x11_video_renderer.cc',
1341             'tools/player_x11/x11_video_renderer.h',
1342           ],
1343         },
1344       ],
1345     }],
1346     # Special target to wrap a gtest_target_type==shared_library
1347     # media_unittests into an android apk for execution.
1348     ['OS=="android" and gtest_target_type=="shared_library"', {
1349       'targets': [
1350         {
1351           'target_name': 'media_unittests_apk',
1352           'type': 'none',
1353           'dependencies': [
1354             'media_java',
1355             'media_unittests',
1356           ],
1357           'variables': {
1358             'test_suite_name': 'media_unittests',
1359             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_unittests<(SHARED_LIB_SUFFIX)',
1360           },
1361           'includes': ['../build/apk_test.gypi'],
1362         },
1363       ],
1364     }],
1365     ['OS=="android"', {
1366       'targets': [
1367         {
1368           'target_name': 'media_android_jni_headers',
1369           'type': 'none',
1370           'sources': [
1371             'base/android/java/src/org/chromium/media/AudioManagerAndroid.java',
1372             'base/android/java/src/org/chromium/media/MediaCodecBridge.java',
1373             'base/android/java/src/org/chromium/media/MediaDrmBridge.java',
1374             'base/android/java/src/org/chromium/media/MediaPlayerBridge.java',
1375             'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
1376             'base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java',
1377           ],
1378           'variables': {
1379             'jni_gen_package': 'media',
1380           },
1381           'includes': ['../build/jni_generator.gypi'],
1382         },
1383         {
1384           'target_name': 'video_capture_android_jni_headers',
1385           'type': 'none',
1386           'sources': [
1387             'base/android/java/src/org/chromium/media/VideoCapture.java',
1388           ],
1389           'variables': {
1390             'jni_gen_package': 'media',
1391           },
1392           'includes': ['../build/jni_generator.gypi'],
1393         },
1394         {
1395           'target_name': 'player_android',
1396           'type': 'static_library',
1397           'sources': [
1398             'base/android/audio_decoder_job.cc',
1399             'base/android/audio_decoder_job.h',
1400             'base/android/media_codec_bridge.cc',
1401             'base/android/media_codec_bridge.h',
1402             'base/android/media_decoder_job.cc',
1403             'base/android/media_decoder_job.h',
1404             'base/android/media_drm_bridge.cc',
1405             'base/android/media_drm_bridge.h',
1406             'base/android/media_jni_registrar.cc',
1407             'base/android/media_jni_registrar.h',
1408             'base/android/media_player_android.cc',
1409             'base/android/media_player_android.h',
1410             'base/android/media_player_bridge.cc',
1411             'base/android/media_player_bridge.h',
1412             'base/android/media_player_listener.cc',
1413             'base/android/media_player_listener.h',
1414             'base/android/media_source_player.cc',
1415             'base/android/media_source_player.h',
1416             'base/android/video_decoder_job.cc',
1417             'base/android/video_decoder_job.h',
1418             'base/android/webaudio_media_codec_bridge.cc',
1419             'base/android/webaudio_media_codec_bridge.h',
1420             'base/android/webaudio_media_codec_info.h',
1421           ],
1422           'dependencies': [
1423             '../base/base.gyp:base',
1424             '../ui/gl/gl.gyp:gl',
1425             '../url/url.gyp:url_lib',
1426             'media_android_jni_headers',
1427           ],
1428           'defines': [
1429             'MEDIA_IMPLEMENTATION',
1430           ],
1431           'include_dirs': [
1432             '<(SHARED_INTERMEDIATE_DIR)/media',
1433           ],
1434         },
1435         {
1436           'target_name': 'media_java',
1437           'type': 'none',
1438           'dependencies': [
1439             '../base/base.gyp:base',
1440             'media_android_imageformat_list',
1441           ],
1442           'export_dependent_settings': [
1443             '../base/base.gyp:base',
1444           ],
1445           'variables': {
1446             'java_in_dir': 'base/android/java',
1447           },
1448           'includes': ['../build/java.gypi'],
1449         },
1450         {
1451           'target_name': 'media_android_imageformat_list',
1452           'type': 'none',
1453           'sources': [
1454             'base/android/java/src/org/chromium/media/ImageFormat.template',
1455           ],
1456           'variables': {
1457             'package_name': 'org/chromium/media',
1458             'template_deps': ['video/capture/android/imageformat_list.h'],
1459           },
1460           'includes': [ '../build/android/java_cpp_template.gypi' ],
1461         },
1462       ],
1463     }],
1464     ['media_use_ffmpeg==1', {
1465       'targets': [
1466         {
1467           'target_name': 'ffmpeg_unittests',
1468           'type': 'executable',
1469           'dependencies': [
1470             '../base/base.gyp:base',
1471             '../base/base.gyp:base_i18n',
1472             '../base/base.gyp:test_support_base',
1473             '../base/base.gyp:test_support_perf',
1474             '../testing/gtest.gyp:gtest',
1475             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1476             'media',
1477             'media_test_support',
1478           ],
1479           'sources': [
1480             'ffmpeg/ffmpeg_unittest.cc',
1481           ],
1482           'conditions': [
1483             ['toolkit_uses_gtk==1', {
1484               'dependencies': [
1485                 # Needed for the following #include chain:
1486                 #   base/run_all_unittests.cc
1487                 #   ../base/test_suite.h
1488                 #   gtk/gtk.h
1489                 '../build/linux/system.gyp:gtk',
1490               ],
1491               'conditions': [
1492                 ['linux_use_tcmalloc==1', {
1493                   'dependencies': [
1494                     '../base/allocator/allocator.gyp:allocator',
1495                   ],
1496                 }],
1497               ],
1498             }],
1499           ],
1500         },
1501         {
1502           'target_name': 'ffmpeg_regression_tests',
1503           'type': 'executable',
1504           'dependencies': [
1505             '../base/base.gyp:test_support_base',
1506             '../testing/gmock.gyp:gmock',
1507             '../testing/gtest.gyp:gtest',
1508             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1509             'media',
1510             'media_test_support',
1511           ],
1512           'sources': [
1513             'base/run_all_unittests.cc',
1514             'base/test_data_util.cc',
1515             'ffmpeg/ffmpeg_regression_tests.cc',
1516             'filters/pipeline_integration_test_base.cc',
1517           ],
1518           'conditions': [
1519             ['os_posix==1 and OS!="mac"', {
1520               'conditions': [
1521                 ['linux_use_tcmalloc==1', {
1522                   'dependencies': [
1523                     '../base/allocator/allocator.gyp:allocator',
1524                   ],
1525                 }],
1526               ],
1527             }],
1528           ],
1529         },
1530       ],
1531     }],
1532   ],