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