Removed unused VideoCaptureCapability parameters.
[chromium-blink-merge.git] / media / media.gyp
blob51faab482b0505c428c07264040e37e35563a61d
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/avfoundation_glue.h',
397         'video/capture/mac/avfoundation_glue.mm',
398         'video/capture/mac/video_capture_device_mac.h',
399         'video/capture/mac/video_capture_device_mac.mm',
400         'video/capture/mac/video_capture_device_qtkit_mac.h',
401         'video/capture/mac/video_capture_device_qtkit_mac.mm',
402         'video/capture/video_capture.h',
403         'video/capture/video_capture_device.cc',
404         'video/capture/video_capture_device.h',
405         'video/capture/video_capture_proxy.cc',
406         'video/capture/video_capture_proxy.h',
407         'video/capture/video_capture_types.cc',
408         'video/capture/video_capture_types.h',
409         'video/capture/win/capability_list_win.cc',
410         'video/capture/win/capability_list_win.h',
411         'video/capture/win/filter_base_win.cc',
412         'video/capture/win/filter_base_win.h',
413         'video/capture/win/pin_base_win.cc',
414         'video/capture/win/pin_base_win.h',
415         'video/capture/win/sink_filter_observer_win.h',
416         'video/capture/win/sink_filter_win.cc',
417         'video/capture/win/sink_filter_win.h',
418         'video/capture/win/sink_input_pin_win.cc',
419         'video/capture/win/sink_input_pin_win.h',
420         'video/capture/win/video_capture_device_mf_win.cc',
421         'video/capture/win/video_capture_device_mf_win.h',
422         'video/capture/win/video_capture_device_win.cc',
423         'video/capture/win/video_capture_device_win.h',
424         'video/picture.cc',
425         'video/picture.h',
426         'video/video_decode_accelerator.cc',
427         'video/video_decode_accelerator.h',
428         'video/video_encode_accelerator.cc',
429         'video/video_encode_accelerator.h',
430         'webm/webm_audio_client.cc',
431         'webm/webm_audio_client.h',
432         'webm/webm_cluster_parser.cc',
433         'webm/webm_cluster_parser.h',
434         'webm/webm_constants.cc',
435         'webm/webm_constants.h',
436         'webm/webm_content_encodings.cc',
437         'webm/webm_content_encodings.h',
438         'webm/webm_content_encodings_client.cc',
439         'webm/webm_content_encodings_client.h',
440         'webm/webm_crypto_helpers.cc',
441         'webm/webm_crypto_helpers.h',
442         'webm/webm_info_parser.cc',
443         'webm/webm_info_parser.h',
444         'webm/webm_parser.cc',
445         'webm/webm_parser.h',
446         'webm/webm_stream_parser.cc',
447         'webm/webm_stream_parser.h',
448         'webm/webm_tracks_parser.cc',
449         'webm/webm_tracks_parser.h',
450         'webm/webm_video_client.cc',
451         'webm/webm_video_client.h',
452         'webm/webm_webvtt_parser.cc',
453         'webm/webm_webvtt_parser.h'
454       ],
455       'direct_dependent_settings': {
456         'include_dirs': [
457           '..',
458         ],
459       },
460       'conditions': [
461         ['arm_neon==1', {
462           'defines': [
463             'USE_NEON'
464           ],
465         }],
466         ['media_use_ffmpeg==1', {
467           'dependencies': [
468             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
469           ],
470         }, {  # media_use_ffmpeg==0
471           # Exclude the sources that depend on ffmpeg.
472           'sources!': [
473             'base/container_names.cc',
474             'base/container_names.h',
475             'base/media_file_checker.cc',
476             'base/media_file_checker.h',
477             'base/media_posix.cc',
478             'ffmpeg/ffmpeg_common.cc',
479             'ffmpeg/ffmpeg_common.h',
480             'filters/audio_file_reader.cc',
481             'filters/audio_file_reader.h',
482             'filters/blocking_url_protocol.cc',
483             'filters/blocking_url_protocol.h',
484             'filters/ffmpeg_audio_decoder.cc',
485             'filters/ffmpeg_audio_decoder.h',
486             'filters/ffmpeg_demuxer.cc',
487             'filters/ffmpeg_demuxer.h',
488             'filters/ffmpeg_glue.cc',
489             'filters/ffmpeg_glue.h',
490             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.cc',
491             'filters/ffmpeg_h264_to_annex_b_bitstream_converter.h',
492             'filters/ffmpeg_video_decoder.cc',
493             'filters/ffmpeg_video_decoder.h',
494           ],
495         }],
496         ['media_use_libvpx==1', {
497           'dependencies': [
498             '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
499           ],
500         }, {  # media_use_libvpx==0
501           'direct_dependent_settings': {
502             'defines': [
503               'MEDIA_DISABLE_LIBVPX',
504             ],
505           },
506           # Exclude the sources that depend on libvpx.
507           'sources!': [
508             'filters/vpx_video_decoder.cc',
509             'filters/vpx_video_decoder.h',
510           ],
511         }],
512         ['OS=="android"', {
513           'include_dirs': [
514             '<(SHARED_INTERMEDIATE_DIR)/media',
515           ],
516           'dependencies': [
517             'media_android_jni_headers',
518             'player_android',
519             'video_capture_android_jni_headers',
520           ],
521           'sources': [
522             'base/media.cc',
523             'base/media.h',
524             'base/media_stub.cc',
525           ],
526           'conditions': [
527             ['android_webview_build==0', {
528               'dependencies': [
529                 'media_java',
530               ],
531             }],
532           ],
533           'defines': [
534             'DISABLE_USER_INPUT_MONITOR',
535           ],
536         }],
537         # A simple WebM encoder for animated avatars on ChromeOS.
538         ['chromeos==1', {
539           'dependencies': [
540             '../third_party/libvpx/libvpx.gyp:libvpx',
541             '../third_party/libyuv/libyuv.gyp:libyuv',
542           ],
543           'sources': [
544             'webm/chromeos/ebml_writer.cc',
545             'webm/chromeos/ebml_writer.h',
546             'webm/chromeos/webm_encoder.cc',
547             'webm/chromeos/webm_encoder.h',
548           ],
549         }],
550         ['use_alsa==1', {
551           'link_settings': {
552             'libraries': [
553               '-lasound',
554             ],
555           },
556         }, { # use_alsa==0
557           'sources/': [ ['exclude', '/alsa_'],
558                       ['exclude', '/audio_manager_linux'] ],
559         }],
560         ['OS!="openbsd"', {
561           'sources!': [
562             'audio/openbsd/audio_manager_openbsd.cc',
563             'audio/openbsd/audio_manager_openbsd.h',
564           ],
565         }],
566         ['OS=="linux"', {
567           'variables': {
568             'conditions': [
569               ['sysroot!=""', {
570                 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
571               }, {
572                 'pkg-config': 'pkg-config'
573               }],
574             ],
575           },
576           'conditions': [
577             ['use_x11==1', {
578               'link_settings': {
579                 'libraries': [
580                   '-lX11',
581                   '-lXdamage',
582                   '-lXext',
583                   '-lXfixes',
584                   '-lXtst',
585                 ],
586               },
587             }, {  # else: use_x11==0
588               'sources!': [
589                 'base/user_input_monitor_linux.cc',
590               ],
591               'defines': [
592                 'DISABLE_USER_INPUT_MONITOR',
593               ],
594             }],
595             ['use_cras==1', {
596               'cflags': [
597                 '<!@(<(pkg-config) --cflags libcras)',
598               ],
599               'link_settings': {
600                 'libraries': [
601                   '<!@(<(pkg-config) --libs libcras)',
602                 ],
603               },
604               'defines': [
605                 'USE_CRAS',
606               ],
607             }, {  # else: use_cras==0
608               'sources!': [
609                 'audio/cras/audio_manager_cras.cc',
610                 'audio/cras/audio_manager_cras.h',
611                 'audio/cras/cras_input.cc',
612                 'audio/cras/cras_input.h',
613                 'audio/cras/cras_unified.cc',
614                 'audio/cras/cras_unified.h',
615               ],
616             }],
617           ],
618         }],
619         ['OS!="linux"', {
620           'sources!': [
621             'audio/cras/audio_manager_cras.cc',
622             'audio/cras/audio_manager_cras.h',
623             'audio/cras/cras_input.cc',
624             'audio/cras/cras_input.h',
625             'audio/cras/cras_unified.cc',
626             'audio/cras/cras_unified.h',
627           ],
628         }],
629         ['use_pulseaudio==1', {
630           'cflags': [
631             '<!@(pkg-config --cflags libpulse)',
632           ],
633           'defines': [
634             'USE_PULSEAUDIO',
635           ],
636           'conditions': [
637             ['linux_link_pulseaudio==0', {
638               'defines': [
639                 'DLOPEN_PULSEAUDIO',
640               ],
641               'variables': {
642                 'generate_stubs_script': '../tools/generate_stubs/generate_stubs.py',
643                 'extra_header': 'audio/pulse/pulse_stub_header.fragment',
644                 'sig_files': ['audio/pulse/pulse.sigs'],
645                 'outfile_type': 'posix_stubs',
646                 'stubs_filename_root': 'pulse_stubs',
647                 'project_path': 'media/audio/pulse',
648                 'intermediate_dir': '<(INTERMEDIATE_DIR)',
649                 'output_root': '<(SHARED_INTERMEDIATE_DIR)/pulse',
650               },
651               'include_dirs': [
652                 '<(output_root)',
653               ],
654               'actions': [
655                 {
656                   'action_name': 'generate_stubs',
657                   'inputs': [
658                     '<(generate_stubs_script)',
659                     '<(extra_header)',
660                     '<@(sig_files)',
661                   ],
662                   'outputs': [
663                     '<(intermediate_dir)/<(stubs_filename_root).cc',
664                     '<(output_root)/<(project_path)/<(stubs_filename_root).h',
665                   ],
666                   'action': ['python',
667                              '<(generate_stubs_script)',
668                              '-i', '<(intermediate_dir)',
669                              '-o', '<(output_root)/<(project_path)',
670                              '-t', '<(outfile_type)',
671                              '-e', '<(extra_header)',
672                              '-s', '<(stubs_filename_root)',
673                              '-p', '<(project_path)',
674                              '<@(_inputs)',
675                   ],
676                   'process_outputs_as_sources': 1,
677                   'message': 'Generating Pulse stubs for dynamic loading.',
678                 },
679               ],
680               'conditions': [
681                 # Linux/Solaris need libdl for dlopen() and friends.
682                 ['OS=="linux" or OS=="solaris"', {
683                   'link_settings': {
684                     'libraries': [
685                       '-ldl',
686                     ],
687                   },
688                 }],
689               ],
690             }, {  # else: linux_link_pulseaudio==0
691               'link_settings': {
692                 'ldflags': [
693                   '<!@(pkg-config --libs-only-L --libs-only-other libpulse)',
694                 ],
695                 'libraries': [
696                   '<!@(pkg-config --libs-only-l libpulse)',
697                 ],
698               },
699             }],
700           ],
701         }, {  # else: use_pulseaudio==0
702           'sources!': [
703             'audio/pulse/audio_manager_pulse.cc',
704             'audio/pulse/audio_manager_pulse.h',
705             'audio/pulse/pulse_input.cc',
706             'audio/pulse/pulse_input.h',
707             'audio/pulse/pulse_output.cc',
708             'audio/pulse/pulse_output.h',
709             'audio/pulse/pulse_unified.cc',
710             'audio/pulse/pulse_unified.h',
711             'audio/pulse/pulse_util.cc',
712             'audio/pulse/pulse_util.h',
713           ],
714         }],
715         ['OS=="mac"', {
716           'link_settings': {
717             'libraries': [
718               '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
719               '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
720               '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
721               '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
722               '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
723               '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
724               '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
725             ],
726           },
727         }],
728         ['OS=="win"', {
729           'link_settings':  {
730             'libraries': [
731               '-lmf.lib',
732               '-lmfplat.lib',
733               '-lmfreadwrite.lib',
734               '-lmfuuid.lib',
735             ],
736           },
737           # Specify delayload for media.dll.
738           'msvs_settings': {
739             'VCLinkerTool': {
740               'DelayLoadDLLs': [
741                 'mf.dll',
742                 'mfplat.dll',
743                 'mfreadwrite.dll',
744               ],
745             },
746           },
747           # Specify delayload for components that link with media.lib.
748           'all_dependent_settings': {
749             'msvs_settings': {
750               'VCLinkerTool': {
751                 'DelayLoadDLLs': [
752                   'mf.dll',
753                   'mfplat.dll',
754                   'mfreadwrite.dll',
755                 ],
756               },
757             },
758           },
759           # TODO(wolenetz): Fix size_t to int truncations in win64. See
760           # http://crbug.com/171009
761           'conditions': [
762             ['target_arch=="x64"', {
763               'msvs_disabled_warnings': [ 4267, ],
764             }],
765           ],
766         }],
767         ['proprietary_codecs==1', {
768           'sources': [
769             'mp2t/es_parser.h',
770             'mp2t/es_parser_adts.cc',
771             'mp2t/es_parser_adts.h',
772             'mp2t/es_parser_h264.cc',
773             'mp2t/es_parser_h264.h',
774             'mp2t/mp2t_common.h',
775             'mp2t/mp2t_stream_parser.cc',
776             'mp2t/mp2t_stream_parser.h',
777             'mp2t/ts_packet.cc',
778             'mp2t/ts_packet.h',
779             'mp2t/ts_section.h',
780             'mp2t/ts_section_pat.cc',
781             'mp2t/ts_section_pat.h',
782             'mp2t/ts_section_pes.cc',
783             'mp2t/ts_section_pes.h',
784             'mp2t/ts_section_pmt.cc',
785             'mp2t/ts_section_pmt.h',
786             'mp2t/ts_section_psi.cc',
787             'mp2t/ts_section_psi.h',
788             'mp3/mp3_stream_parser.cc',
789             'mp3/mp3_stream_parser.h',
790             'mp4/aac.cc',
791             'mp4/aac.h',
792             'mp4/avc.cc',
793             'mp4/avc.h',
794             'mp4/box_definitions.cc',
795             'mp4/box_definitions.h',
796             'mp4/box_reader.cc',
797             'mp4/box_reader.h',
798             'mp4/cenc.cc',
799             'mp4/cenc.h',
800             'mp4/es_descriptor.cc',
801             'mp4/es_descriptor.h',
802             'mp4/mp4_stream_parser.cc',
803             'mp4/mp4_stream_parser.h',
804             'mp4/offset_byte_queue.cc',
805             'mp4/offset_byte_queue.h',
806             'mp4/track_run_iterator.cc',
807             'mp4/track_run_iterator.h',
808           ],
809         }],
810         ['toolkit_uses_gtk==1', {
811           'dependencies': [
812             '../build/linux/system.gyp:gtk',
813           ],
814         }],
815         ['target_arch=="ia32" or target_arch=="x64"', {
816           'dependencies': [
817             'media_asm',
818             'media_mmx',
819             'media_sse',
820             'media_sse2',
821           ],
822           'sources': [
823             'base/simd/convert_yuv_to_rgb_x86.cc',
824           ],
825         }],
826         ['google_tv==1', {
827           'defines': [
828             'ENABLE_EAC3_PLAYBACK',
829           ],
830         }],
831         ['OS!="linux" and OS!="win"', {
832           'sources!': [
833             'base/keyboard_event_counter.cc',
834             'base/keyboard_event_counter.h',
835           ],
836         }],
837       ],
838     },
839     {
840       'target_name': 'media_unittests',
841       'type': '<(gtest_target_type)',
842       'dependencies': [
843         'media',
844         'media_test_support',
845         'shared_memory_support',
846         '../base/base.gyp:base',
847         '../base/base.gyp:base_i18n',
848         '../base/base.gyp:test_support_base',
849         '../gpu/gpu.gyp:command_buffer_common',
850         '../skia/skia.gyp:skia',
851         '../testing/gmock.gyp:gmock',
852         '../testing/gtest.gyp:gtest',
853         '../ui/gfx/gfx.gyp:gfx',
854         '../ui/ui.gyp:ui',
855       ],
856       'sources': [
857         'audio/android/audio_android_unittest.cc',
858         'audio/audio_input_controller_unittest.cc',
859         'audio/audio_input_unittest.cc',
860         'audio/audio_input_volume_unittest.cc',
861         'audio/audio_low_latency_input_output_unittest.cc',
862         'audio/audio_manager_unittest.cc',
863         'audio/audio_output_controller_unittest.cc',
864         'audio/audio_output_device_unittest.cc',
865         'audio/audio_output_proxy_unittest.cc',
866         'audio/audio_parameters_unittest.cc',
867         'audio/audio_power_monitor_unittest.cc',
868         'audio/fake_audio_consumer_unittest.cc',
869         'audio/linux/alsa_output_unittest.cc',
870         'audio/mac/audio_auhal_mac_unittest.cc',
871         'audio/mac/audio_device_listener_mac_unittest.cc',
872         'audio/mac/audio_low_latency_input_mac_unittest.cc',
873         'audio/simple_sources_unittest.cc',
874         'audio/virtual_audio_input_stream_unittest.cc',
875         'audio/virtual_audio_output_stream_unittest.cc',
876         'audio/win/audio_device_listener_win_unittest.cc',
877         'audio/win/audio_low_latency_input_win_unittest.cc',
878         'audio/win/audio_low_latency_output_win_unittest.cc',
879         'audio/win/audio_output_win_unittest.cc',
880         'audio/win/audio_unified_win_unittest.cc',
881         'audio/win/core_audio_util_win_unittest.cc',
882         'base/android/media_codec_bridge_unittest.cc',
883         'base/android/media_source_player_unittest.cc',
884         'base/audio_buffer_unittest.cc',
885         'base/audio_buffer_queue_unittest.cc',
886         'base/audio_bus_unittest.cc',
887         'base/audio_converter_unittest.cc',
888         'base/audio_fifo_unittest.cc',
889         'base/audio_hardware_config_unittest.cc',
890         'base/audio_hash_unittest.cc',
891         'base/audio_pull_fifo_unittest.cc',
892         'base/audio_renderer_mixer_input_unittest.cc',
893         'base/audio_renderer_mixer_unittest.cc',
894         'base/audio_splicer_unittest.cc',
895         'base/audio_timestamp_helper_unittest.cc',
896         'base/bind_to_loop_unittest.cc',
897         'base/bit_reader_unittest.cc',
898         'base/callback_holder.h',
899         'base/callback_holder_unittest.cc',
900         'base/channel_mixer_unittest.cc',
901         'base/clock_unittest.cc',
902         'base/container_names_unittest.cc',
903         'base/data_buffer_unittest.cc',
904         'base/decoder_buffer_queue_unittest.cc',
905         'base/decoder_buffer_unittest.cc',
906         'base/djb2_unittest.cc',
907         'base/gmock_callback_support_unittest.cc',
908         'base/media_file_checker_unittest.cc',
909         'base/multi_channel_resampler_unittest.cc',
910         'base/pipeline_unittest.cc',
911         'base/ranges_unittest.cc',
912         'base/run_all_unittests.cc',
913         'base/scoped_histogram_timer_unittest.cc',
914         'base/serial_runner_unittest.cc',
915         'base/seekable_buffer_unittest.cc',
916         'base/sinc_resampler_unittest.cc',
917         'base/test_data_util.cc',
918         'base/test_data_util.h',
919         'base/user_input_monitor_unittest.cc',
920         'base/vector_math_testing.h',
921         'base/vector_math_unittest.cc',
922         'base/video_frame_unittest.cc',
923         'base/video_util_unittest.cc',
924         'base/yuv_convert_unittest.cc',
925         'cdm/aes_decryptor_unittest.cc',
926         'ffmpeg/ffmpeg_common_unittest.cc',
927         'filters/audio_decoder_selector_unittest.cc',
928         'filters/audio_file_reader_unittest.cc',
929         'filters/audio_renderer_algorithm_unittest.cc',
930         'filters/audio_renderer_impl_unittest.cc',
931         'filters/blocking_url_protocol_unittest.cc',
932         'filters/chunk_demuxer_unittest.cc',
933         'filters/decrypting_audio_decoder_unittest.cc',
934         'filters/decrypting_demuxer_stream_unittest.cc',
935         'filters/decrypting_video_decoder_unittest.cc',
936         'filters/fake_demuxer_stream.cc',
937         'filters/fake_demuxer_stream.h',
938         'filters/fake_demuxer_stream_unittest.cc',
939         'filters/fake_video_decoder.cc',
940         'filters/fake_video_decoder.h',
941         'filters/fake_video_decoder_unittest.cc',
942         'filters/ffmpeg_audio_decoder_unittest.cc',
943         'filters/ffmpeg_demuxer_unittest.cc',
944         'filters/ffmpeg_glue_unittest.cc',
945         'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
946         'filters/ffmpeg_video_decoder_unittest.cc',
947         'filters/file_data_source_unittest.cc',
948         'filters/h264_to_annex_b_bitstream_converter_unittest.cc',
949         'filters/pipeline_integration_test.cc',
950         'filters/pipeline_integration_test_base.cc',
951         'filters/skcanvas_video_renderer_unittest.cc',
952         'filters/source_buffer_stream_unittest.cc',
953         'filters/video_decoder_selector_unittest.cc',
954         'filters/video_frame_stream_unittest.cc',
955         'filters/video_renderer_base_unittest.cc',
956         'video/capture/video_capture_device_unittest.cc',
957         'webm/cluster_builder.cc',
958         'webm/cluster_builder.h',
959         'webm/tracks_builder.cc',
960         'webm/tracks_builder.h',
961         'webm/webm_cluster_parser_unittest.cc',
962         'webm/webm_content_encodings_client_unittest.cc',
963         'webm/webm_parser_unittest.cc',
964         'webm/webm_tracks_parser_unittest.cc',
965         'webm/webm_webvtt_parser_unittest.cc',
966       ],
967       'conditions': [
968         ['arm_neon==1', {
969           'defines': [
970             'USE_NEON'
971           ],
972         }],
973         ['media_use_ffmpeg==1', {
974           'dependencies': [
975             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
976           ],
977         }, {  # media_use_ffmpeg== 0
978           'sources!': [
979             'base/media_file_checker_unittest.cc',
980           ],
981         }],
982         ['use_alsa==1', {
983           'defines': [
984             'USE_ALSA',
985           ],
986         }],
987         ['use_pulseaudio==1', {
988           'defines': [
989             'USE_PULSEAUDIO',
990           ],
991         }],
992         ['os_posix==1 and OS!="mac"', {
993           'conditions': [
994             ['linux_use_tcmalloc==1', {
995               'dependencies': [
996                 '../base/allocator/allocator.gyp:allocator',
997               ],
998             }],
999           ],
1000         }],
1001         ['OS=="android"', {
1002           'sources!': [
1003             'audio/audio_input_volume_unittest.cc',
1004             'base/container_names_unittest.cc',
1005             'ffmpeg/ffmpeg_common_unittest.cc',
1006             'filters/audio_file_reader_unittest.cc',
1007             'filters/blocking_url_protocol_unittest.cc',
1008             'filters/ffmpeg_audio_decoder_unittest.cc',
1009             'filters/ffmpeg_demuxer_unittest.cc',
1010             'filters/ffmpeg_glue_unittest.cc',
1011             'filters/ffmpeg_h264_to_annex_b_bitstream_converter_unittest.cc',
1012             'filters/ffmpeg_video_decoder_unittest.cc',
1013             'filters/pipeline_integration_test.cc',
1014             'filters/pipeline_integration_test_base.cc',
1015           ],
1016           'conditions': [
1017             ['gtest_target_type=="shared_library"', {
1018               'dependencies': [
1019                 '../testing/android/native_test.gyp:native_test_native_code',
1020                 'player_android',
1021               ],
1022             }],
1023           ],
1024         }],
1025         ['OS=="linux"', {
1026           'conditions': [
1027             ['use_cras==1', {
1028               'sources': [
1029                 'audio/cras/cras_input_unittest.cc',
1030                 'audio/cras/cras_unified_unittest.cc',
1031               ],
1032               'defines': [
1033                 'USE_CRAS',
1034               ],
1035             }],
1036           ],
1037         }],
1038         ['use_alsa==0', {
1039           'sources!': [
1040             'audio/linux/alsa_output_unittest.cc',
1041             'audio/audio_low_latency_input_output_unittest.cc',
1042           ],
1043         }],
1044         ['target_arch=="ia32" or target_arch=="x64"', {
1045           'sources': [
1046             'base/simd/convert_rgb_to_yuv_unittest.cc',
1047           ],
1048         }],
1049         ['proprietary_codecs==1', {
1050           'sources': [
1051             'mp2t/mp2t_stream_parser_unittest.cc',
1052             'mp3/mp3_stream_parser_unittest.cc',
1053             'mp4/aac_unittest.cc',
1054             'mp4/avc_unittest.cc',
1055             'mp4/box_reader_unittest.cc',
1056             'mp4/es_descriptor_unittest.cc',
1057             'mp4/mp4_stream_parser_unittest.cc',
1058             'mp4/offset_byte_queue_unittest.cc',
1059             'mp4/track_run_iterator_unittest.cc',
1060           ],
1061         }],
1062         # TODO(wolenetz): Fix size_t to int truncations in win64. See
1063         # http://crbug.com/171009
1064         ['OS=="win" and target_arch=="x64"', {
1065           'msvs_disabled_warnings': [ 4267, ],
1066         }],
1067       ],
1068     },
1069     {
1070       'target_name': 'media_perftests',
1071       'type': '<(gtest_target_type)',
1072       'dependencies': [
1073         'media',
1074         '../base/base.gyp:test_support_base',
1075         '../testing/gmock.gyp:gmock',
1076         '../testing/gtest.gyp:gtest',
1077       ],
1078       'sources': [
1079         'base/run_all_unittests.cc',
1080       ],
1081     },
1082     {
1083       'target_name': 'media_test_support',
1084       'type': 'static_library',
1085       'dependencies': [
1086         'media',
1087         'shared_memory_support',
1088         '../base/base.gyp:base',
1089         '../skia/skia.gyp:skia',
1090         '../testing/gmock.gyp:gmock',
1091         '../testing/gtest.gyp:gtest',
1092       ],
1093       'sources': [
1094         'audio/mock_audio_manager.cc',
1095         'audio/mock_audio_manager.h',
1096         'audio/test_audio_input_controller_factory.cc',
1097         'audio/test_audio_input_controller_factory.h',
1098         'base/fake_audio_render_callback.cc',
1099         'base/fake_audio_render_callback.h',
1100         'base/fake_audio_renderer_sink.cc',
1101         'base/fake_audio_renderer_sink.h',
1102         'base/gmock_callback_support.h',
1103         'base/mock_audio_renderer_sink.cc',
1104         'base/mock_audio_renderer_sink.h',
1105         'base/mock_data_source_host.cc',
1106         'base/mock_data_source_host.h',
1107         'base/mock_demuxer_host.cc',
1108         'base/mock_demuxer_host.h',
1109         'base/mock_filters.cc',
1110         'base/mock_filters.h',
1111         'base/test_helpers.cc',
1112         'base/test_helpers.h',
1113         'filters/mock_gpu_video_accelerator_factories.cc',
1114         'filters/mock_gpu_video_accelerator_factories.h',
1115         'video/mock_video_decode_accelerator.cc',
1116         'video/mock_video_decode_accelerator.h',
1117       ],
1118     },
1119     {
1120       # Minimal target for NaCl and other renderer side media clients which
1121       # only need to send audio data across the shared memory to the browser
1122       # process.
1123       'target_name': 'shared_memory_support',
1124       'type': '<(component)',
1125       'dependencies': [
1126         '../base/base.gyp:base',
1127       ],
1128       'defines': [
1129         'MEDIA_IMPLEMENTATION',
1130       ],
1131       'include_dirs': [
1132         '..',
1133       ],
1134       'includes': [
1135         'shared_memory_support.gypi',
1136       ],
1137       'sources': [
1138         '<@(shared_memory_support_sources)',
1139       ],
1140       'conditions': [
1141         ['arm_neon==1', {
1142           'defines': [
1143             'USE_NEON'
1144           ],
1145         }],
1146         ['target_arch=="ia32" or target_arch=="x64"', {
1147           'dependencies': [
1148             'shared_memory_support_sse'
1149           ],
1150         }],
1151       ],
1152     },
1153     {
1154       'target_name': 'demuxer_bench',
1155       'type': 'executable',
1156       'dependencies': [
1157         'media',
1158         '../base/base.gyp:base',
1159       ],
1160       'sources': [
1161         'tools/demuxer_bench/demuxer_bench.cc',
1162       ],
1163       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1164       'msvs_disabled_warnings': [ 4267, ],
1165     },
1166   ],
1167   'conditions': [
1168     ['target_arch!="arm"', {
1169       'targets': [
1170        {
1171           'target_name': 'media_asm',
1172           'type': 'static_library',
1173           'sources': [
1174             'base/simd/convert_rgb_to_yuv_ssse3.asm',
1175             'base/simd/convert_yuv_to_rgb_mmx.asm',
1176             'base/simd/convert_yuv_to_rgb_sse.asm',
1177             'base/simd/convert_yuva_to_argb_mmx.asm',
1178             'base/simd/empty_register_state_mmx.asm',
1179             'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
1180             'base/simd/linear_scale_yuv_to_rgb_sse.asm',
1181             'base/simd/scale_yuv_to_rgb_mmx.asm',
1182             'base/simd/scale_yuv_to_rgb_sse.asm',
1183           ],
1184           'conditions': [
1185             ['component=="shared_library"', {
1186               'variables': {
1187                 'yasm_flags': ['-DEXPORT_SYMBOLS'],
1188               },
1189             }],
1190             ['target_arch=="x64"', {
1191               # Source files optimized for X64 systems.
1192               'sources': [
1193                 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
1194                 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
1195               ],
1196               'variables': {
1197                 'yasm_flags': ['-DARCH_X86_64'],
1198               },
1199             }],
1200             ['OS=="mac"', {
1201               'variables': {
1202                 'yasm_flags': [
1203                   '-DPREFIX',
1204                   '-DMACHO',
1205                 ],
1206               },
1207               'sources': [
1208                 # XCode doesn't want to link a pure assembly target and will
1209                 # fail to link when it creates an empty file list.  So add a
1210                 # dummy file keep the linker happy.  See http://crbug.com/157073
1211                 'base/simd/xcode_hack.c',
1212               ],
1213             }],
1214             ['os_posix==1 and OS!="mac"', {
1215               'variables': {
1216                 'conditions': [
1217                   ['target_arch=="ia32"', {
1218                     'yasm_flags': [
1219                       '-DX86_32',
1220                       '-DELF',
1221                     ],
1222                   }, {
1223                     'yasm_flags': [
1224                       '-DELF',
1225                       '-DPIC',
1226                     ],
1227                   }],
1228                 ],
1229               },
1230             }],
1231           ],
1232           'variables': {
1233             'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
1234             'yasm_flags': [
1235               '-DCHROMIUM',
1236               # In addition to the same path as source asm, let yasm %include
1237               # search path be relative to src/ per Chromium policy.
1238               '-I..',
1239             ],
1240             'yasm_includes': [
1241               '../third_party/x86inc/x86inc.asm',
1242               'base/simd/convert_rgb_to_yuv_ssse3.inc',
1243               'base/simd/convert_yuv_to_rgb_mmx.inc',
1244               'base/simd/convert_yuva_to_argb_mmx.inc',
1245               'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
1246               'base/simd/media_export.asm',
1247               'base/simd/scale_yuv_to_rgb_mmx.inc',
1248             ],
1249           },
1250           'msvs_2010_disable_uldi_when_referenced': 1,
1251           'includes': [
1252             '../third_party/yasm/yasm_compile.gypi',
1253           ],
1254         },
1255         {
1256           'target_name': 'media_mmx',
1257           'type': 'static_library',
1258           'cflags': [
1259             '-mmmx',
1260           ],
1261           'defines': [
1262             'MEDIA_IMPLEMENTATION',
1263           ],
1264           'include_dirs': [
1265             '..',
1266           ],
1267           'sources': [
1268             'base/simd/filter_yuv_mmx.cc',
1269           ],
1270         },
1271         {
1272           'target_name': 'media_sse',
1273           'type': 'static_library',
1274           'cflags': [
1275             '-msse',
1276           ],
1277           'defines': [
1278             'MEDIA_IMPLEMENTATION',
1279           ],
1280           'include_dirs': [
1281             '..',
1282           ],
1283           'sources': [
1284             'base/simd/sinc_resampler_sse.cc',
1285           ],
1286         },
1287         {
1288           'target_name': 'media_sse2',
1289           'type': 'static_library',
1290           'cflags': [
1291             '-msse2',
1292           ],
1293           'defines': [
1294             'MEDIA_IMPLEMENTATION',
1295           ],
1296           'include_dirs': [
1297             '..',
1298           ],
1299           'sources': [
1300             'base/simd/convert_rgb_to_yuv_sse2.cc',
1301             'base/simd/convert_rgb_to_yuv_ssse3.cc',
1302             'base/simd/filter_yuv_sse2.cc',
1303           ],
1304         },
1305         {
1306           'target_name': 'shared_memory_support_sse',
1307           'type': 'static_library',
1308           'cflags': [
1309             '-msse',
1310           ],
1311           'defines': [
1312             'MEDIA_IMPLEMENTATION',
1313           ],
1314           'include_dirs': [
1315             '..',
1316           ],
1317           'sources': [
1318             'base/simd/vector_math_sse.cc',
1319           ],
1320         },
1321       ], # targets
1322     }],
1323     ['use_x11==1', {
1324       'targets': [
1325         {
1326           'target_name': 'player_x11',
1327           'type': 'executable',
1328           'dependencies': [
1329             'media',
1330             '../base/base.gyp:base',
1331             '../ui/gl/gl.gyp:gl',
1332             '../ui/gfx/gfx.gyp:gfx',
1333             '../ui/ui.gyp:ui',
1334           ],
1335           'link_settings': {
1336             'libraries': [
1337               '-lX11',
1338               '-lXrender',
1339               '-lXext',
1340             ],
1341           },
1342           'conditions': [
1343             # Linux/Solaris need libdl for dlopen() and friends.
1344             ['OS=="linux" or OS=="solaris"', {
1345               'link_settings': {
1346                 'libraries': [
1347                   '-ldl',
1348                 ],
1349               },
1350             }],
1351           ],
1352           'sources': [
1353             'tools/player_x11/data_source_logger.cc',
1354             'tools/player_x11/data_source_logger.h',
1355             'tools/player_x11/gl_video_renderer.cc',
1356             'tools/player_x11/gl_video_renderer.h',
1357             'tools/player_x11/player_x11.cc',
1358             'tools/player_x11/x11_video_renderer.cc',
1359             'tools/player_x11/x11_video_renderer.h',
1360           ],
1361         },
1362       ],
1363     }],
1364     # Special target to wrap a gtest_target_type==shared_library
1365     # media_unittests into an android apk for execution.
1366     ['OS=="android" and gtest_target_type=="shared_library"', {
1367       'targets': [
1368         {
1369           'target_name': 'media_unittests_apk',
1370           'type': 'none',
1371           'dependencies': [
1372             'media_java',
1373             'media_unittests',
1374           ],
1375           'variables': {
1376             'test_suite_name': 'media_unittests',
1377             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)media_unittests<(SHARED_LIB_SUFFIX)',
1378           },
1379           'includes': ['../build/apk_test.gypi'],
1380         },
1381       ],
1382     }],
1383     ['OS=="android"', {
1384       'targets': [
1385         {
1386           'target_name': 'media_android_jni_headers',
1387           'type': 'none',
1388           'sources': [
1389             'base/android/java/src/org/chromium/media/AudioManagerAndroid.java',
1390             'base/android/java/src/org/chromium/media/MediaCodecBridge.java',
1391             'base/android/java/src/org/chromium/media/MediaDrmBridge.java',
1392             'base/android/java/src/org/chromium/media/MediaPlayerBridge.java',
1393             'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
1394             'base/android/java/src/org/chromium/media/WebAudioMediaCodecBridge.java',
1395           ],
1396           'variables': {
1397             'jni_gen_package': 'media',
1398           },
1399           'includes': ['../build/jni_generator.gypi'],
1400         },
1401         {
1402           'target_name': 'video_capture_android_jni_headers',
1403           'type': 'none',
1404           'sources': [
1405             'base/android/java/src/org/chromium/media/VideoCapture.java',
1406           ],
1407           'variables': {
1408             'jni_gen_package': 'media',
1409           },
1410           'includes': ['../build/jni_generator.gypi'],
1411         },
1412         {
1413           'target_name': 'player_android',
1414           'type': 'static_library',
1415           'sources': [
1416             'base/android/audio_decoder_job.cc',
1417             'base/android/audio_decoder_job.h',
1418             'base/android/media_codec_bridge.cc',
1419             'base/android/media_codec_bridge.h',
1420             'base/android/media_decoder_job.cc',
1421             'base/android/media_decoder_job.h',
1422             'base/android/media_drm_bridge.cc',
1423             'base/android/media_drm_bridge.h',
1424             'base/android/media_jni_registrar.cc',
1425             'base/android/media_jni_registrar.h',
1426             'base/android/media_player_android.cc',
1427             'base/android/media_player_android.h',
1428             'base/android/media_player_bridge.cc',
1429             'base/android/media_player_bridge.h',
1430             'base/android/media_player_listener.cc',
1431             'base/android/media_player_listener.h',
1432             'base/android/media_source_player.cc',
1433             'base/android/media_source_player.h',
1434             'base/android/video_decoder_job.cc',
1435             'base/android/video_decoder_job.h',
1436             'base/android/webaudio_media_codec_bridge.cc',
1437             'base/android/webaudio_media_codec_bridge.h',
1438             'base/android/webaudio_media_codec_info.h',
1439           ],
1440           'dependencies': [
1441             '../base/base.gyp:base',
1442             '../ui/gl/gl.gyp:gl',
1443             '../url/url.gyp:url_lib',
1444             'media_android_jni_headers',
1445           ],
1446           'defines': [
1447             'MEDIA_IMPLEMENTATION',
1448           ],
1449           'include_dirs': [
1450             '<(SHARED_INTERMEDIATE_DIR)/media',
1451           ],
1452         },
1453         {
1454           'target_name': 'media_java',
1455           'type': 'none',
1456           'dependencies': [
1457             '../base/base.gyp:base',
1458             'media_android_imageformat_list',
1459           ],
1460           'export_dependent_settings': [
1461             '../base/base.gyp:base',
1462           ],
1463           'variables': {
1464             'java_in_dir': 'base/android/java',
1465           },
1466           'includes': ['../build/java.gypi'],
1467         },
1468         {
1469           'target_name': 'media_android_imageformat_list',
1470           'type': 'none',
1471           'sources': [
1472             'base/android/java/src/org/chromium/media/ImageFormat.template',
1473           ],
1474           'variables': {
1475             'package_name': 'org/chromium/media',
1476             'template_deps': ['video/capture/android/imageformat_list.h'],
1477           },
1478           'includes': [ '../build/android/java_cpp_template.gypi' ],
1479         },
1480       ],
1481     }],
1482     ['media_use_ffmpeg==1', {
1483       'targets': [
1484         {
1485           'target_name': 'ffmpeg_unittests',
1486           'type': 'executable',
1487           'dependencies': [
1488             '../base/base.gyp:base',
1489             '../base/base.gyp:base_i18n',
1490             '../base/base.gyp:test_support_base',
1491             '../base/base.gyp:test_support_perf',
1492             '../testing/gtest.gyp:gtest',
1493             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1494             'media',
1495             'media_test_support',
1496           ],
1497           'sources': [
1498             'ffmpeg/ffmpeg_unittest.cc',
1499           ],
1500           'conditions': [
1501             ['toolkit_uses_gtk==1', {
1502               'dependencies': [
1503                 # Needed for the following #include chain:
1504                 #   base/run_all_unittests.cc
1505                 #   ../base/test_suite.h
1506                 #   gtk/gtk.h
1507                 '../build/linux/system.gyp:gtk',
1508               ],
1509               'conditions': [
1510                 ['linux_use_tcmalloc==1', {
1511                   'dependencies': [
1512                     '../base/allocator/allocator.gyp:allocator',
1513                   ],
1514                 }],
1515               ],
1516             }],
1517           ],
1518         },
1519         {
1520           'target_name': 'ffmpeg_regression_tests',
1521           'type': 'executable',
1522           'dependencies': [
1523             '../base/base.gyp:test_support_base',
1524             '../testing/gmock.gyp:gmock',
1525             '../testing/gtest.gyp:gtest',
1526             '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1527             'media',
1528             'media_test_support',
1529           ],
1530           'sources': [
1531             'base/run_all_unittests.cc',
1532             'base/test_data_util.cc',
1533             'ffmpeg/ffmpeg_regression_tests.cc',
1534             'filters/pipeline_integration_test_base.cc',
1535           ],
1536           'conditions': [
1537             ['os_posix==1 and OS!="mac"', {
1538               'conditions': [
1539                 ['linux_use_tcmalloc==1', {
1540                   'dependencies': [
1541                     '../base/allocator/allocator.gyp:allocator',
1542                   ],
1543                 }],
1544               ],
1545             }],
1546           ],
1547         },
1548       ],
1549     }],
1550   ],